Skip to content

Commit a554cb6

Browse files
committed
refactor: update authoring url
1 parent c7ab74e commit a554cb6

4 files changed

Lines changed: 5 additions & 8 deletions

File tree

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
NODE_ENV='production'
22
ACCESS_TOKEN_COOKIE_NAME=''
3-
AUTHORING_BASE_URL= ''
43
BASE_URL=''
4+
COURSE_AUTHORING_MICROFRONTEND_URL= ''
55
CREDENTIALS_BASE_URL=''
66
CSRF_TOKEN_API_PATH=''
77
ECOMMERCE_BASE_URL=''

.env.development

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
NODE_ENV='development'
22
PORT=2025
33
ACCESS_TOKEN_COOKIE_NAME='edx-jwt-cookie-header-payload'
4-
AUTHORING_BASE_URL= 'http://apps.local.openedx.io:2001'
54
BASE_URL='http://localhost:2025'
5+
COURSE_AUTHORING_MICROFRONTEND_URL= 'http://apps.local.openedx.io:2001/authoring'
66
CREDENTIALS_BASE_URL='http://localhost:18150'
77
CSRF_TOKEN_API_PATH='/csrf/api/v1/token'
88
ECOMMERCE_BASE_URL='http://localhost:18130'

src/authz-module/libraries-manager/ErrorPage/index.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ const getErrorConfig = ({ errorMessage, errorStatus }) => {
4343
});
4444
};
4545

46-
const librariesUrl = () => `${getConfig().AUTHORING_BASE_URL}/libraries`;
47-
4846
const ErrorPage = ({ error, resetErrorBoundary }: FallbackProps) => {
4947
const intl = useIntl();
5048
const [reloading, setReloading] = useState(false);
@@ -56,12 +54,11 @@ const ErrorPage = ({ error, resetErrorBoundary }: FallbackProps) => {
5654
} = getErrorConfig({ errorMessage, errorStatus });
5755

5856
const handleReload = () => {
59-
if (reloading) { return; }
6057
setReloading(true);
6158
resetErrorBoundary();
6259
};
6360
return (
64-
<Container className="d-flex flex-column align-items-center justify-content-center min-vh-100 bg-light-200" data-testid="error-page">
61+
<Container className="d-flex flex-column align-items-center justify-content-center min-vh-100 bg-light-200">
6562
<h1 className="display-4 text-primary-200">{statusCode}</h1>
6663
<h1 className="text-primary">{intl.formatMessage(title)}</h1>
6764
<p>{intl.formatMessage(description)}</p>
@@ -78,7 +75,7 @@ const ErrorPage = ({ error, resetErrorBoundary }: FallbackProps) => {
7875
{showBackButton && (
7976
<Button
8077
as={Hyperlink}
81-
destination={librariesUrl()}
78+
destination={`${getConfig().COURSE_AUTHORING_MICROFRONTEND_URL}/libraries`}
8279
className="m-2"
8380
variant={showReloadButton ? 'outline-primary' : 'primary'}
8481
>

src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ initialize({
4646
handlers: {
4747
config: () => {
4848
mergeConfig({
49-
AUTHORING_BASE_URL: process.env.AUTHORING_BASE_URL || null,
49+
COURSE_AUTHORING_MICROFRONTEND_URL: process.env.COURSE_AUTHORING_MICROFRONTEND_URL || null,
5050
}, 'AdminConsoleAppConfig');
5151
},
5252
},

0 commit comments

Comments
 (0)