Skip to content

Commit 047e97f

Browse files
author
Albert (AJ) St. Aubin
authored
Merge pull request #74 from edx/aj/config
adding discovery to config
2 parents 37112b2 + 941bb5a commit 047e97f

File tree

6 files changed

+14
-6
lines changed

6 files changed

+14
-6
lines changed

.env.development

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ ACCESS_TOKEN_COOKIE_NAME=edx-jwt-cookie-header-payload
33
BASE_URL=localhost:8080
44
CREDENTIALS_BASE_URL=http://localhost:18150
55
CSRF_TOKEN_API_PATH=/csrf/api/v1/token
6+
DISCOVERY_BASE_URL=http://localhost:18381
67
ECOMMERCE_BASE_URL=http://localhost:18130
78
LANGUAGE_PREFERENCE_COOKIE_NAME=openedx-language-preference
89
LMS_BASE_URL=http://localhost:18000

.env.test

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ ACCESS_TOKEN_COOKIE_NAME=edx-jwt-cookie-header-payload
33
BASE_URL=localhost:8080
44
CREDENTIALS_BASE_URL=http://localhost:18150
55
CSRF_TOKEN_API_PATH=/csrf/api/v1/token
6+
DISCOVERY_BASE_URL=http://localhost:18381
67
ECOMMERCE_BASE_URL=http://localhost:18130
78
LANGUAGE_PREFERENCE_COOKIE_NAME=openedx-language-preference
89
LMS_BASE_URL=http://localhost:18000

example/index.jsx

+7-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,13 @@ subscribe(APP_READY, () => {
1515
ReactDOM.render(
1616
<AppProvider>
1717
<Route exact path="/" component={ExamplePage} />
18-
<Route exact path="/error_example" component={ () =>
19-
<ErrorPage message="Test error message"/>
20-
}/>
18+
<Route
19+
exact
20+
path="/error_example"
21+
component={() =>
22+
<ErrorPage message="Test error message" />
23+
}
24+
/>
2125
<AuthenticatedPageRoute exact path="/authenticated" component={AuthenticatedPage} />
2226
</AppProvider>,
2327
document.getElementById('root'),

src/config.js

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ let config = {
3737
BASE_URL: process.env.BASE_URL,
3838
CREDENTIALS_BASE_URL: process.env.CREDENTIALS_BASE_URL,
3939
CSRF_TOKEN_API_PATH: process.env.CSRF_TOKEN_API_PATH,
40+
DISCOVERY_BASE_URL: process.env.DISCOVERY_BASE_URL,
4041
ECOMMERCE_BASE_URL: process.env.ECOMMERCE_BASE_URL,
4142
ENVIRONMENT,
4243
LANGUAGE_PREFERENCE_COOKIE_NAME: process.env.LANGUAGE_PREFERENCE_COOKIE_NAME,
@@ -153,6 +154,7 @@ export function ensureConfig(keys, requester = 'unspecified application code') {
153154
* @property {string} BASE_URL The URL of the current application.
154155
* @property {string} CREDENTIALS_BASE_URL
155156
* @property {string} CSRF_TOKEN_API_PATH
157+
* @property {string} DISCOVERY_BASE_URL
156158
* @property {string} ECOMMERCE_BASE_URL
157159
* @property {string} ENVIRONMENT This is one of: development, production, or test.
158160
* @property {string} LANGUAGE_PREFERENCE_COOKIE_NAME

src/react/ErrorPage.jsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import React, { Component } from 'react';
2+
import PropTypes from 'prop-types';
23
import { Button } from '@edx/paragon';
34

45
import { FormattedMessage } from '../i18n';
5-
import PropTypes from "prop-types";
6-
import AppProvider from "./AppProvider";
76

87
/**
98
* An error page that displays a generic message for unexpected errors. Also contains a "Try
@@ -58,7 +57,7 @@ class ErrorPage extends Component {
5857
}
5958

6059
ErrorPage.propTypes = {
61-
message: PropTypes.string
60+
message: PropTypes.string,
6261
};
6362

6463
ErrorPage.defaultProps = {

src/setupTest.js

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ process.env.ACCESS_TOKEN_COOKIE_NAME = 'edx-jwt-cookie-header-payload';
1212
process.env.BASE_URL = 'localhost:8080';
1313
process.env.CREDENTIALS_BASE_URL = 'http://localhost:18150';
1414
process.env.CSRF_TOKEN_API_PATH = '/csrf/api/v1/token';
15+
process.env.DISCOVERY_BASE_URL = 'http://localhost:18381';
1516
process.env.ECOMMERCE_BASE_URL = 'http://localhost:18130';
1617
process.env.LANGUAGE_PREFERENCE_COOKIE_NAME = 'openedx-language-preference';
1718
process.env.LMS_BASE_URL = 'http://localhost:18000';

0 commit comments

Comments
 (0)