richie-education 2.25.0-b2.dev23 → 2.25.0-b2.dev24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/js/api/lms/dummy.ts +2 -2
- package/js/settings.dev.dist.ts +14 -0
- package/js/settings.ts +11 -0
- package/package.json +1 -1
package/js/api/lms/dummy.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { User } from 'types/User';
|
|
|
4
4
|
import { APILms } from 'types/api';
|
|
5
5
|
import { Enrollment, OpenEdXEnrollment } from 'types';
|
|
6
6
|
import { location } from 'utils/indirection/window';
|
|
7
|
-
import { RICHIE_USER_TOKEN } from 'settings';
|
|
7
|
+
import { CURRENT_JOANIE_DEV_DEMO_USER, RICHIE_USER_TOKEN } from 'settings';
|
|
8
8
|
import { base64Decode } from 'utils/base64Parser';
|
|
9
9
|
|
|
10
10
|
type JWTPayload = {
|
|
@@ -71,7 +71,7 @@ const API = (APIConf: LMSBackend | AuthenticationBackend): APILms => {
|
|
|
71
71
|
"username": "admin",
|
|
72
72
|
}
|
|
73
73
|
*/
|
|
74
|
-
return getUserInfo(
|
|
74
|
+
return getUserInfo(CURRENT_JOANIE_DEV_DEMO_USER) || null;
|
|
75
75
|
},
|
|
76
76
|
login: () => location.reload(),
|
|
77
77
|
register: () => location.reload(),
|
package/js/settings.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import defaultDevSettings from './settings.dev.dist';
|
|
2
|
+
|
|
1
3
|
export const API_LIST_DEFAULT_PARAMS = {
|
|
2
4
|
limit: '21',
|
|
3
5
|
offset: '0',
|
|
@@ -52,6 +54,15 @@ export const PER_PAGE = {
|
|
|
52
54
|
useOrdersEnrollments: DEFAULT_PER_PAGE,
|
|
53
55
|
};
|
|
54
56
|
|
|
57
|
+
let devSettings;
|
|
58
|
+
try {
|
|
59
|
+
devSettings = require('settings.dev.ts');
|
|
60
|
+
} catch {
|
|
61
|
+
devSettings = defaultDevSettings;
|
|
62
|
+
}
|
|
63
|
+
|
|
55
64
|
export const MOCK_SERVICE_WORKER_ENABLED = false;
|
|
56
65
|
|
|
57
66
|
export const DEBUG_UNION_RESOURCES_HOOK = process.env.NODE_ENV !== 'production' && false;
|
|
67
|
+
|
|
68
|
+
export const { CURRENT_JOANIE_DEV_DEMO_USER } = devSettings;
|