Skip to content

Commit 23d3018

Browse files
farhanclaude
andcommitted
refactor: remove ENABLE_UNIT_PAGE, ENABLE_UNIT_PAGE_NEW_DESIGN, and ENABLE_NEW_VIDEO_UPLOAD_PAGE env flags
The legacy_studio.unit_editor waffle flag is being removed, making the new unit page design the only experience. These env flags no longer serve a purpose: ENABLE_UNIT_PAGE was unused in source, ENABLE_NEW_VIDEO_UPLOAD_PAGE was never registered, and ENABLE_UNIT_PAGE_NEW_DESIGN gated the new design which is now permanent. Removes isUnitPageNewDesignEnabled() and all its call sites, replacing conditional branches with the new-design path only. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 65f4d7a commit 23d3018

15 files changed

Lines changed: 25 additions & 236 deletions

File tree

.env

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,11 @@ USER_INFO_COOKIE_NAME=''
3131
ENABLE_ACCESSIBILITY_PAGE=false
3232
ENABLE_PROGRESS_GRAPH_SETTINGS=false
3333
ENABLE_TEAM_TYPE_SETTING=false
34-
ENABLE_UNIT_PAGE=false
3534
ENABLE_ASSETS_PAGE=false
3635
ENABLE_VIDEO_UPLOAD_PAGE_LINK_IN_CONTENT_DROPDOWN=false
3736
ENABLE_TAGGING_TAXONOMY_PAGES=true
3837
ENABLE_CERTIFICATE_PAGE=true
3938
ENABLE_COURSE_IMPORT_IN_LIBRARY=false
40-
ENABLE_UNIT_PAGE_NEW_DESIGN=true
4139
BBB_LEARN_MORE_URL=''
4240
HOTJAR_APP_ID=''
4341
HOTJAR_VERSION=6

.env.development

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,10 @@ USER_INFO_COOKIE_NAME='edx-user-info'
3333
ENABLE_ACCESSIBILITY_PAGE=false
3434
ENABLE_PROGRESS_GRAPH_SETTINGS=false
3535
ENABLE_TEAM_TYPE_SETTING=false
36-
ENABLE_UNIT_PAGE=false
3736
ENABLE_ASSETS_PAGE=false
3837
ENABLE_VIDEO_UPLOAD_PAGE_LINK_IN_CONTENT_DROPDOWN=true
3938
ENABLE_CERTIFICATE_PAGE=true
4039
ENABLE_COURSE_IMPORT_IN_LIBRARY=true
41-
ENABLE_UNIT_PAGE_NEW_DESIGN=true
42-
ENABLE_NEW_VIDEO_UPLOAD_PAGE=true
4340
ENABLE_TAGGING_TAXONOMY_PAGES=true
4441
BBB_LEARN_MORE_URL=''
4542
HOTJAR_APP_ID=''

src/course-unit/CourseUnit.test.tsx

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ describe('<CourseUnit />', () => {
183183
it('render CourseUnit component correctly', async () => {
184184
setConfig({
185185
...getConfig(),
186-
ENABLE_UNIT_PAGE_NEW_DESIGN: false,
187186
});
188187
render(<RootWrapper />);
189188
const currentSectionName = courseSectionVerticalMock.xblock_info.ancestor_info.ancestors[1].display_name;
@@ -278,7 +277,6 @@ describe('<CourseUnit />', () => {
278277
it('closes legacy edit modal and updates course unit sidebar after saveEditedXBlockData message', async () => {
279278
setConfig({
280279
...getConfig(),
281-
ENABLE_UNIT_PAGE_NEW_DESIGN: false,
282280
});
283281
render(<RootWrapper />);
284282

@@ -319,7 +317,6 @@ describe('<CourseUnit />', () => {
319317
it('updates course unit sidebar after receiving refreshPositions message', async () => {
320318
setConfig({
321319
...getConfig(),
322-
ENABLE_UNIT_PAGE_NEW_DESIGN: false,
323320
});
324321
render(<RootWrapper />);
325322

@@ -356,7 +353,6 @@ describe('<CourseUnit />', () => {
356353
const user = userEvent.setup();
357354
setConfig({
358355
...getConfig(),
359-
ENABLE_UNIT_PAGE_NEW_DESIGN: false,
360356
});
361357
render(<RootWrapper />);
362358

@@ -532,7 +528,6 @@ describe('<CourseUnit />', () => {
532528
it('checks if xblock is a duplicate when the corresponding duplicate button is clicked and if the sidebar status is updated', async () => {
533529
setConfig({
534530
...getConfig(),
535-
ENABLE_UNIT_PAGE_NEW_DESIGN: false,
536531
});
537532
axiosMock
538533
.onGet(getCourseSectionVerticalApiUrl(blockId))
@@ -1153,7 +1148,6 @@ describe('<CourseUnit />', () => {
11531148
it('renders course unit details for a draft with unpublished changes', async () => {
11541149
setConfig({
11551150
...getConfig(),
1156-
ENABLE_UNIT_PAGE_NEW_DESIGN: false,
11571151
});
11581152
render(<RootWrapper />);
11591153

@@ -1233,7 +1227,6 @@ describe('<CourseUnit />', () => {
12331227
const user = userEvent.setup();
12341228
setConfig({
12351229
...getConfig(),
1236-
ENABLE_UNIT_PAGE_NEW_DESIGN: false,
12371230
});
12381231
render(<RootWrapper />);
12391232
const courseUnitSidebar = await screen.findByTestId('course-unit-sidebar');
@@ -1329,7 +1322,6 @@ describe('<CourseUnit />', () => {
13291322
const user = userEvent.setup();
13301323
setConfig({
13311324
...getConfig(),
1332-
ENABLE_UNIT_PAGE_NEW_DESIGN: false,
13331325
});
13341326
render(<RootWrapper />);
13351327
let courseUnitSidebar;
@@ -1385,7 +1377,6 @@ describe('<CourseUnit />', () => {
13851377
const user = userEvent.setup();
13861378
setConfig({
13871379
...getConfig(),
1388-
ENABLE_UNIT_PAGE_NEW_DESIGN: false,
13891380
});
13901381
render(<RootWrapper />);
13911382
let courseUnitSidebar;
@@ -1464,7 +1455,6 @@ describe('<CourseUnit />', () => {
14641455
it('should toggle visibility from header configure modal and update course unit state accordingly', async () => {
14651456
setConfig({
14661457
...getConfig(),
1467-
ENABLE_UNIT_PAGE_NEW_DESIGN: false,
14681458
});
14691459
const user = userEvent.setup();
14701460
render(<RootWrapper />);
@@ -1568,7 +1558,6 @@ describe('<CourseUnit />', () => {
15681558
beforeEach(() => {
15691559
setConfig({
15701560
...getConfig(),
1571-
ENABLE_UNIT_PAGE_NEW_DESIGN: false,
15721561
});
15731562
});
15741563

@@ -2371,15 +2360,13 @@ describe('<CourseUnit />', () => {
23712360
it('should display visibility modal correctly', async () => {
23722361
setConfig({
23732362
...getConfig(),
2374-
ENABLE_UNIT_PAGE_NEW_DESIGN: false,
23752363
});
23762364
await checkRenderVisibilityModal('libraryContentAccess');
23772365
});
23782366

23792367
it('opens legacy edit modal on edit button click', async () => {
23802368
setConfig({
23812369
...getConfig(),
2382-
ENABLE_UNIT_PAGE_NEW_DESIGN: false,
23832370
});
23842371
await checkLegacyEditModalOnEditMessage();
23852372
});
@@ -2391,7 +2378,6 @@ describe('<CourseUnit />', () => {
23912378
beforeEach(async () => {
23922379
setConfig({
23932380
...getConfig(),
2394-
ENABLE_UNIT_PAGE_NEW_DESIGN: false,
23952381
});
23962382
axiosMock
23972383
.onGet(getCourseSectionVerticalApiUrl(blockId))
@@ -2586,7 +2572,6 @@ describe('<CourseUnit />', () => {
25862572
setConfig({
25872573
...getConfig(),
25882574
ENABLE_TAGGING_TAXONOMY_PAGES: 'true',
2589-
ENABLE_UNIT_PAGE_NEW_DESIGN: false,
25902575
});
25912576
render(<RootWrapper />);
25922577

@@ -2632,7 +2617,6 @@ describe('<CourseUnit />', () => {
26322617
it('renders new unit info/settings sidebar', async () => {
26332618
setConfig({
26342619
...getConfig(),
2635-
ENABLE_UNIT_PAGE_NEW_DESIGN: 'true',
26362620
});
26372621
const user = userEvent.setup();
26382622
render(<RootWrapper />);
@@ -2660,7 +2644,6 @@ describe('<CourseUnit />', () => {
26602644
it('displays the live state in the status bar', async () => {
26612645
setConfig({
26622646
...getConfig(),
2663-
ENABLE_UNIT_PAGE_NEW_DESIGN: 'true',
26642647
});
26652648
axiosMock
26662649
.onGet(getCourseSectionVerticalApiUrl(blockId))
@@ -2679,7 +2662,6 @@ describe('<CourseUnit />', () => {
26792662
it('should change the visibility of the unit in the settings sidebar', async () => {
26802663
setConfig({
26812664
...getConfig(),
2682-
ENABLE_UNIT_PAGE_NEW_DESIGN: 'true',
26832665
});
26842666
const user = userEvent.setup();
26852667
render(<RootWrapper />);
@@ -2756,7 +2738,6 @@ describe('<CourseUnit />', () => {
27562738
it('displays the staff only state in the status bar', async () => {
27572739
setConfig({
27582740
...getConfig(),
2759-
ENABLE_UNIT_PAGE_NEW_DESIGN: 'true',
27602741
});
27612742

27622743
axiosMock
@@ -2780,7 +2761,6 @@ describe('<CourseUnit />', () => {
27802761
const user = userEvent.setup();
27812762
setConfig({
27822763
...getConfig(),
2783-
ENABLE_UNIT_PAGE_NEW_DESIGN: 'true',
27842764
});
27852765
render(<RootWrapper />);
27862766

@@ -2829,7 +2809,6 @@ describe('<CourseUnit />', () => {
28292809

28302810
setConfig({
28312811
...getConfig(),
2832-
ENABLE_UNIT_PAGE_NEW_DESIGN: 'true',
28332812
});
28342813
render(<RootWrapper />);
28352814

@@ -2908,7 +2887,6 @@ describe('<CourseUnit />', () => {
29082887
it('should one group in the visibility field in the unit sidebar', async () => {
29092888
setConfig({
29102889
...getConfig(),
2911-
ENABLE_UNIT_PAGE_NEW_DESIGN: 'true',
29122890
});
29132891
render(<RootWrapper />);
29142892

@@ -2963,7 +2941,6 @@ describe('<CourseUnit />', () => {
29632941
it('should multiple groups in the visibility field in the unit sidebar', async () => {
29642942
setConfig({
29652943
...getConfig(),
2966-
ENABLE_UNIT_PAGE_NEW_DESIGN: 'true',
29672944
});
29682945
render(<RootWrapper />);
29692946

@@ -3023,7 +3000,6 @@ describe('<CourseUnit />', () => {
30233000
it('should render never published state in the unit sidebar', async () => {
30243001
setConfig({
30253002
...getConfig(),
3026-
ENABLE_UNIT_PAGE_NEW_DESIGN: 'true',
30273003
});
30283004
render(<RootWrapper />);
30293005

@@ -3053,7 +3029,6 @@ describe('<CourseUnit />', () => {
30533029
it('displays the scheduled state in the status bar', async () => {
30543030
setConfig({
30553031
...getConfig(),
3056-
ENABLE_UNIT_PAGE_NEW_DESIGN: 'true',
30573032
});
30583033
axiosMock
30593034
.onGet(getCourseSectionVerticalApiUrl(blockId))
@@ -3073,7 +3048,6 @@ describe('<CourseUnit />', () => {
30733048
it('displays the draft changes state in the status bar', async () => {
30743049
setConfig({
30753050
...getConfig(),
3076-
ENABLE_UNIT_PAGE_NEW_DESIGN: 'true',
30773051
});
30783052
axiosMock
30793053
.onGet(getCourseSectionVerticalApiUrl(blockId))
@@ -3093,7 +3067,6 @@ describe('<CourseUnit />', () => {
30933067
it('displays discussions enabled label in the status bar', async () => {
30943068
setConfig({
30953069
...getConfig(),
3096-
ENABLE_UNIT_PAGE_NEW_DESIGN: 'true',
30973070
});
30983071
axiosMock
30993072
.onGet(getCourseSectionVerticalApiUrl(blockId))
@@ -3112,7 +3085,6 @@ describe('<CourseUnit />', () => {
31123085
it('displays group access with one group in the status bar', async () => {
31133086
setConfig({
31143087
...getConfig(),
3115-
ENABLE_UNIT_PAGE_NEW_DESIGN: 'true',
31163088
});
31173089
axiosMock
31183090
.onGet(getCourseSectionVerticalApiUrl(blockId))
@@ -3159,7 +3131,6 @@ describe('<CourseUnit />', () => {
31593131
it('displays group access with multiple groups in the status bar', async () => {
31603132
setConfig({
31613133
...getConfig(),
3162-
ENABLE_UNIT_PAGE_NEW_DESIGN: 'true',
31633134
});
31643135
axiosMock
31653136
.onGet(getCourseSectionVerticalApiUrl(blockId))
@@ -3207,7 +3178,6 @@ describe('<CourseUnit />', () => {
32073178
setConfig({
32083179
...getConfig(),
32093180
ENABLE_TAGGING_TAXONOMY_PAGES: 'true',
3210-
ENABLE_UNIT_PAGE_NEW_DESIGN: 'true',
32113181
});
32123182

32133183
render(<RootWrapper />);
@@ -3240,7 +3210,6 @@ describe('<CourseUnit />', () => {
32403210
beforeEach(async () => {
32413211
setConfig({
32423212
...getConfig(),
3243-
ENABLE_UNIT_PAGE_NEW_DESIGN: 'true',
32443213
});
32453214

32463215
// The Meilisearch client-side API uses fetch, not Axios.
@@ -3495,7 +3464,6 @@ describe('<CourseUnit />', () => {
34953464
it('not render add sidebar in units from libraries (read-only)', async () => {
34963465
setConfig({
34973466
...getConfig(),
3498-
ENABLE_UNIT_PAGE_NEW_DESIGN: 'true',
34993467
});
35003468
render(<RootWrapper />);
35013469

@@ -3531,7 +3499,6 @@ describe('<CourseUnit />', () => {
35313499
it('opens the component info sidebar on postMessage event', async () => {
35323500
setConfig({
35333501
...getConfig(),
3534-
ENABLE_UNIT_PAGE_NEW_DESIGN: 'true',
35353502
});
35363503

35373504
axiosMock
@@ -3561,7 +3528,6 @@ describe('<CourseUnit />', () => {
35613528

35623529
// eslint-disable-next-line @typescript-eslint/no-explicit-any
35633530
const renderComponentSidebar = async (data: any = componentData) => {
3564-
setConfig({ ...getConfig(), ENABLE_UNIT_PAGE_NEW_DESIGN: 'true' });
35653531
axiosMock.onGet(getXBlockApiUrl(componentId)).reply(200, data);
35663532
render(<RootWrapper />);
35673533
await screen.findByTitle(xblockContainerIframeMessages.xblockIframeTitle.defaultMessage);
@@ -3700,7 +3666,6 @@ describe('<CourseUnit />', () => {
37003666

37013667
// eslint-disable-next-line @typescript-eslint/no-explicit-any
37023668
const renderUnitInfoSidebar = async (itemData: any = unitItemData) => {
3703-
setConfig({ ...getConfig(), ENABLE_UNIT_PAGE_NEW_DESIGN: 'true' });
37043669
axiosMock.onGet(getXBlockApiUrl(unitId)).reply(200, itemData);
37053670
render(<RootWrapper />);
37063671
// Wait for the Details tab which is unique to the new unit info sidebar

src/course-unit/CourseUnit.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ import CourseUnitHeaderActionsSlot from '../plugin-slots/CourseUnitHeaderActions
4747
import { UnitSidebarProvider } from './unit-sidebar/UnitSidebarContext';
4848
import { UnitSidebarPagesProvider } from './unit-sidebar/UnitSidebarPagesContext';
4949
import { UNIT_VISIBILITY_STATES } from './constants';
50-
import { isUnitPageNewDesignEnabled } from './utils';
5150
import { useHelpUrls } from '@src/help-urls/hooks';
5251

5352
const StatusBar = ({ courseUnit }: { courseUnit: any; }) => {
@@ -322,7 +321,7 @@ const CourseUnit = () => {
322321
}
323322
/>
324323
<div className="unit-header-status-bar h5 mt-2 mb-4 font-weight-normal">
325-
{isUnitPageNewDesignEnabled() && isUnitVerticalType && <StatusBar courseUnit={courseUnit} />}
324+
{isUnitVerticalType && <StatusBar courseUnit={courseUnit} />}
326325
</div>
327326
{isUnitVerticalType && (
328327
<Sequence

src/course-unit/header-navigations/HeaderNavigations.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ describe('<HeaderNavigations />', () => {
9494
it('click Info button should open info sidebar', async () => {
9595
setConfig({
9696
...getConfig(),
97-
ENABLE_UNIT_PAGE_NEW_DESIGN: 'true',
9897
});
9998

10099
const user = userEvent.setup();

src/course-unit/header-navigations/HeaderNavigations.tsx

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
import { COURSE_BLOCK_NAMES } from '@src/constants';
1414

1515
import messages from './messages';
16-
import { isUnitPageNewDesignEnabled } from '../utils';
1716
import { useUnitSidebarContext } from '../unit-sidebar/UnitSidebarContext';
1817

1918
export type HeaderNavigationActions = {
@@ -48,8 +47,6 @@ const HeaderNavigations = ({
4847

4948
const { setCurrentPageKey, readOnly } = useUnitSidebarContext();
5049

51-
const showNewDesignButtons = isUnitPageNewDesignEnabled();
52-
5350
return (
5451
<nav className="header-navigations ml-auto flex-shrink-0">
5552
{
@@ -59,26 +56,24 @@ const HeaderNavigations = ({
5956
}
6057
{category === COURSE_BLOCK_NAMES.vertical.id && (
6158
<Stack direction="horizontal" gap={3}>
62-
{showNewDesignButtons && (
63-
<>
59+
<>
60+
<Button
61+
variant="outline-primary"
62+
iconBefore={InfoOutline}
63+
onClick={() => setCurrentPageKey('info', null)}
64+
>
65+
{intl.formatMessage(messages.infoButton)}
66+
</Button>
67+
{!readOnly && (
6468
<Button
6569
variant="outline-primary"
66-
iconBefore={InfoOutline}
67-
onClick={() => setCurrentPageKey('info', null)}
70+
iconBefore={Add}
71+
onClick={() => setCurrentPageKey('add', null)}
6872
>
69-
{intl.formatMessage(messages.infoButton)}
73+
{intl.formatMessage(messages.addButton)}
7074
</Button>
71-
{!readOnly && (
72-
<Button
73-
variant="outline-primary"
74-
iconBefore={Add}
75-
onClick={() => setCurrentPageKey('add', null)}
76-
>
77-
{intl.formatMessage(messages.addButton)}
78-
</Button>
79-
)}
80-
</>
81-
)}
75+
)}
76+
</>
8277
<ButtonGroup>
8378
<Button
8479
variant="outline-primary"

0 commit comments

Comments
 (0)