Part of #521 — Remove Legacy Studio UI Waffle Flags
Frontend ticket: openedx/frontend-app-authoring#3063
/cc @openedx/axim-aximprovements
Scope
Remove routing flag consumers from the four most complex files in `frontend-app-authoring`. These require more involved logic simplification.
Tasks
9. `src/CourseAuthoringContext.tsx`
- 1 flag (`useNewUnitPage`) gating two code paths: `getUnitUrl` (line 69) and `openUnitPage` (line 81)
- Both also check `ENABLE_UNIT_PAGE === 'true'`; collapse to always use `navigate` and the React route
- Remove `useWaffleFlags` call (and import if unused); remove `getConfig` call if the env-var check is also dropped
10. `src/pages-and-resources/pages/PageSettingButton.jsx`
- 2 flags (`useNewTextbooksPage`, `useNewCustomPages`) inside the `determineLinkDestination` memo
- Both branches now always resolve to the new path; simplify to return `/course/${courseId}/${id.replace('_', '-')}` directly for textbooks/tabs
- Remove `useWaffleFlags` call and import
11. `src/editors/containers/VideoEditor/` (two files)
- `components/VideoEditorModal.tsx`: remove `useNewVideoUploadsPage` from the `useWaffleFlags()` destructure (line 45) and from the props passed to `VideoSettingsModal` (line 57)
- `components/VideoSettingsModal/index.tsx`: remove `useNewVideoUploadsPage` from the prop type (line 24), the destructure (line 31), and the conditional render (line 34) — hardcode the upload button to always render when `!isLibrary`
12. `src/header/hooks.tsx`
- 5 flags across 3 functions:
- `useContentMenuItems`: hardcode outline, updates, files/uploads links to new paths (3 ternaries); simplify the video-upload `if` to always push the item
- `useSettingMenuItems`: remove `useNewCertificatesPage` guard (line 135) — always push the certificates link
- `useToolsMenuItems`: hardcode import and export links to new paths (2 ternaries)
- Remove `useWaffleFlags` calls from functions that no longer need routing flags (keep for `enableAuthzCourseAuthoring` and `enableCourseOptimizer`)
Acceptance Criteria
Part of #521 — Remove Legacy Studio UI Waffle Flags
Frontend ticket: openedx/frontend-app-authoring#3063
/cc @openedx/axim-aximprovements
Scope
Remove routing flag consumers from the four most complex files in `frontend-app-authoring`. These require more involved logic simplification.
Tasks
9. `src/CourseAuthoringContext.tsx`
10. `src/pages-and-resources/pages/PageSettingButton.jsx`
11. `src/editors/containers/VideoEditor/` (two files)
12. `src/header/hooks.tsx`
Acceptance Criteria