Skip to content

Commit b584ff9

Browse files
arbrandesclaude
andcommitted
fix!: adapt to upstream provides data shape change
The provides data shape changed from { courseNavigationRoles: string[] } to string[] in frontend-base. Use the exported constant key. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent ddaa1ac commit b584ff9

4 files changed

Lines changed: 13 additions & 6 deletions

File tree

src/app.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,18 @@ import { appId } from '@src/constants';
33
import routes from '@src/routes';
44
import slots from '@src/slots';
55
import providers from '@src/providers';
6+
import provides from '@src/provides';
67

78
const app: App = {
89
appId,
910
routes,
1011
providers,
12+
provides,
1113
slots,
1214
config: {
1315
NODE_ENV: 'development',
1416
LMS_BASE_URL: 'http://local.openedx.io:8000'
1517
},
16-
provides: {
17-
'org.openedx.frontend.provides.courseNavigationRoles.v1': {
18-
courseNavigationRoles: ['org.openedx.frontend.role.instructor'],
19-
},
20-
},
2118
};
2219

2320
export default app;

src/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
export const appId = 'org.openedx.frontend.app.instructor';
2+
export const instructorDashboardRole = 'org.openedx.frontend.role.instructor';

src/provides.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { courseNavigationRolesProvidesKey } from '@openedx/frontend-base';
2+
import { instructorDashboardRole } from './constants';
3+
4+
const provides = {
5+
[courseNavigationRolesProvidesKey]: instructorDashboardRole
6+
};
7+
8+
export default provides;

src/routes.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import OpenResponsesPage from '@src/openResponses/OpenResponsesPage';
1111
import SpecialExamsPage from '@src/specialExams/SpecialExamsPage';
1212
import PageNotFound from '@src/components/PageNotFound';
1313
import { useWidgetProps } from './slots/SlotUtils';
14+
import { instructorDashboardRole } from './constants';
1415

1516
interface InstructorRouteProps {
1617
tabId: string,
@@ -51,7 +52,7 @@ const routes = [
5152
id: 'org.openedx.frontend.route.instructor.main',
5253
path: 'instructor-dashboard/:courseId',
5354
handle: {
54-
role: 'org.openedx.frontend.role.instructor'
55+
role: instructorDashboardRole
5556
},
5657
async lazy() {
5758
const module = await import('./Main');

0 commit comments

Comments
 (0)