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.
@@ -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('admin') || null;
74
+ return getUserInfo(CURRENT_JOANIE_DEV_DEMO_USER) || null;
75
75
  },
76
76
  login: () => location.reload(),
77
77
  register: () => location.reload(),
@@ -0,0 +1,14 @@
1
+ export default {
2
+ /**
3
+ * Available users:
4
+ * * admin
5
+ * * user0
6
+ * * user1
7
+ * * user2
8
+ * * user3
9
+ * * user4
10
+ * * organization_owner
11
+ * * student_user
12
+ */
13
+ CURRENT_JOANIE_DEV_DEMO_USER: 'admin',
14
+ };
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "richie-education",
3
- "version": "2.25.0-b2.dev23",
3
+ "version": "2.25.0-b2.dev24",
4
4
  "description": "A CMS to build learning portals for Open Education",
5
5
  "main": "sandbox/manage.py",
6
6
  "scripts": {