diff --git a/src/index.jsx b/src/index.jsx index b0247846bd..609e045d92 100755 --- a/src/index.jsx +++ b/src/index.jsx @@ -28,7 +28,6 @@ import messages from './i18n'; import { LibraryAndComponentPicker, CreateLibrary, - CreateLegacyLibrary, LibraryLayout, PreviewChangesEmbed, } from './library-authoring'; @@ -75,9 +74,8 @@ const App = () => { } /> } /> - } /> + } /> - } /> } /> } /> ', () => { cancelButton.click(); - // Should navigate to legacy libraries tab on studio home + // Should navigate to libraries tab on studio home expect(await screen.findByText('Exit Migration?')).toBeInTheDocument(); const exitButton = screen.getByRole('button', { name: /exit/i }); exitButton.click(); await waitFor(() => { - expect(mockNavigate).toHaveBeenCalledWith('/libraries-v1'); + expect(mockNavigate).toHaveBeenCalledWith('/libraries'); }); }); diff --git a/src/legacy-libraries-migration/LegacyLibMigrationPage.tsx b/src/legacy-libraries-migration/LegacyLibMigrationPage.tsx index c0777d004e..0e106054e8 100644 --- a/src/legacy-libraries-migration/LegacyLibMigrationPage.tsx +++ b/src/legacy-libraries-migration/LegacyLibMigrationPage.tsx @@ -64,7 +64,7 @@ const ExitModal = ({ - diff --git a/src/studio-home/StudioHome.test.tsx b/src/studio-home/StudioHome.test.tsx index ec3d195e76..79b2bb089b 100644 --- a/src/studio-home/StudioHome.test.tsx +++ b/src/studio-home/StudioHome.test.tsx @@ -5,7 +5,6 @@ import { fireEvent, render, screen, - waitFor, initializeMocks, within, } from '@src/testUtils'; @@ -126,25 +125,9 @@ describe('', () => { }); describe('render new library button', () => { - it('should navigate to legacy library creation when libraries-v2 disabled', async () => { - mockUseSelector.mockReturnValue({ - ...studioHomeMock, - courseCreatorStatus: COURSE_CREATOR_STATES.granted, - librariesV2Enabled: false, - }); - render(, { path: '/home' }); - await waitFor(() => { - const createNewLibraryButton = screen.getByRole('button', { name: 'New library' }); - - fireEvent.click(createNewLibraryButton); - expect(mockNavigate).toHaveBeenCalledWith('/libraries-v1/create'); - }); - }); - it('should navigate to the library authoring page in course authoring', async () => { mockUseSelector.mockReturnValue({ ...studioHomeMock, - librariesV1Enabled: false, }); render(, { path: '/home' }); const createNewLibraryButton = screen.getByRole('button', { name: 'New library' }); @@ -153,26 +136,6 @@ describe('', () => { }); }); - it('does not render new library button for "v1 only" mode if showNewLibraryButton is False', () => { - mockUseSelector.mockReturnValue({ - ...studioHomeMock, - showNewLibraryButton: false, - librariesV2Enabled: false, - }); - render(, { path: '/home' }); - expect(screen.queryByRole('button', { name: 'New library' })).not.toBeInTheDocument(); - }); - - it('render new library button for "v2 only" mode even if showNewLibraryButton is False', () => { - mockUseSelector.mockReturnValue({ - ...studioHomeMock, - showNewLibraryButton: false, - librariesV1Enabled: false, - }); - render(, { path: '/home' }); - expect(screen.queryByRole('button', { name: 'New library' })).toBeInTheDocument(); - }); - it('should render "create new course" container', async () => { mockUseSelector.mockReturnValue({ ...studioHomeMock, diff --git a/src/studio-home/StudioHome.tsx b/src/studio-home/StudioHome.tsx index a2be1984da..d323cd7ec2 100644 --- a/src/studio-home/StudioHome.tsx +++ b/src/studio-home/StudioHome.tsx @@ -44,20 +44,15 @@ const StudioHome = () => { hasAbilityToCreateNewCourse, isFiltered, setShowNewCourseContainer, - librariesV1Enabled, librariesV2Enabled, } = useStudioHome(); const adminConsoleUrl = `${getConfig().ADMIN_CONSOLE_URL}/authz`; - const v1LibraryTab = librariesV1Enabled && location?.pathname.split('/').pop() === 'libraries-v1'; - const showV2LibraryURL = librariesV2Enabled && !v1LibraryTab; - const { userIsActive, studioShortName, studioRequestEmail, - showNewLibraryButton, showNewLibraryV2Button, } = studioHomeData; @@ -103,13 +98,9 @@ const StudioHome = () => { ); } - if ((showNewLibraryButton && !showV2LibraryURL) || (showV2LibraryURL && showNewLibraryV2Button)) { + if (librariesV2Enabled && showNewLibraryV2Button) { const newLibraryClick = () => { - if (showV2LibraryURL) { - navigate('/library/create'); - } else { - navigate('/libraries-v1/create'); - } + navigate('/library/create'); }; headerButtons.push( @@ -167,7 +158,6 @@ const StudioHome = () => { showNewCourseContainer={showNewCourseContainer} onClickNewCourse={() => setShowNewCourseContainer(true)} isShowProcessing={Boolean(isShowProcessing) && !isFiltered} - librariesV1Enabled={librariesV1Enabled} librariesV2Enabled={librariesV2Enabled} /> diff --git a/src/studio-home/hooks.tsx b/src/studio-home/hooks.tsx index bc5dc249fe..150c714597 100644 --- a/src/studio-home/hooks.tsx +++ b/src/studio-home/hooks.tsx @@ -85,7 +85,6 @@ const useStudioHome = () => { studioRequestEmail, inProcessCourseActions, courseCreatorStatus, - librariesV1Enabled, librariesV2Enabled, } = studioHomeData; @@ -113,7 +112,6 @@ const useStudioHome = () => { hasAbilityToCreateNewCourse, isFiltered, setShowNewCourseContainer, - librariesV1Enabled, librariesV2Enabled, }; }; diff --git a/src/studio-home/tabs-section/TabsSection.test.tsx b/src/studio-home/tabs-section/TabsSection.test.tsx index 017aee9cf1..4caf385d5c 100644 --- a/src/studio-home/tabs-section/TabsSection.test.tsx +++ b/src/studio-home/tabs-section/TabsSection.test.tsx @@ -12,7 +12,6 @@ import { fireEvent, screen, act, - within, } from '@src/testUtils'; import messages from '../messages'; import tabMessages from './messages'; @@ -21,7 +20,6 @@ import { initialState, generateGetStudioHomeDataApiResponse, generateGetStudioCoursesApiResponseV2, - generateGetStudioHomeLibrariesApiResponse, } from '../factories/mockApiResponses'; import { getApiBaseUrl, getStudioHomeApiUrl } from '../data/api'; import { fetchStudioHomeData } from '../data/thunks'; @@ -31,14 +29,12 @@ const { studioShortName } = studioHomeMock; let axiosMock; let store; const courseApiLinkV2 = `${getApiBaseUrl()}/api/contentstore/v2/home/courses`; -const libraryApiLink = `${getStudioHomeApiUrl()}/libraries`; const tabSectionComponent = (overrideProps) => ( {}} isShowProcessing - librariesV1Enabled librariesV2Enabled {...overrideProps} /> @@ -62,10 +58,6 @@ const render = (overrideProps = {}) => path="/libraries" element={tabSectionComponent(overrideProps)} /> - , @@ -88,42 +80,19 @@ describe('', () => { await executeThunk(fetchStudioHomeData(), store.dispatch); expect(screen.getByRole('tab', { name: tabMessages.coursesTabTitle.defaultMessage })).toBeInTheDocument(); - expect(screen.getByRole('tab', { name: tabMessages.librariesTabTitle.defaultMessage })).toBeInTheDocument(); - - expect(screen.getByRole('tab', { name: tabMessages.legacyLibrariesTabTitle.defaultMessage })).toBeInTheDocument(); }); - it('should render only 1 library tab when libraries-v2 disabled', async () => { - const data = generateGetStudioHomeDataApiResponse(); - + it('should not render libraries tab and default to courses when librariesV2Enabled is false', async () => { render({ librariesV2Enabled: false }); - axiosMock.onGet(getStudioHomeApiUrl()).reply(200, data); + axiosMock.onGet(getStudioHomeApiUrl()).reply(200, generateGetStudioHomeDataApiResponse()); await executeThunk(fetchStudioHomeData(), store.dispatch); - expect(screen.getByText(tabMessages.librariesTabTitle.defaultMessage)).toBeInTheDocument(); - const librariesTab = screen.getByRole('tab', { name: tabMessages.librariesTabTitle.defaultMessage }); - expect(librariesTab).toBeInTheDocument(); - // Check Tab.eventKey - expect(librariesTab).toHaveAttribute('data-rb-event-key', 'legacyLibraries'); - - expect(screen.queryByText(tabMessages.legacyLibrariesTabTitle.defaultMessage)).not.toBeInTheDocument(); - }); - - it('should render only 1 library tab when libraries-v1 disabled', async () => { - const data = generateGetStudioHomeDataApiResponse(); - - render({ librariesV1Enabled: false }); - axiosMock.onGet(getStudioHomeApiUrl()).reply(200, data); - await executeThunk(fetchStudioHomeData(), store.dispatch); - - expect(screen.getByText(tabMessages.librariesTabTitle.defaultMessage)).toBeInTheDocument(); - const librariesTab = screen.getByRole('tab', { name: tabMessages.librariesTabTitle.defaultMessage }); - expect(librariesTab).toBeInTheDocument(); - // Check Tab.eventKey - expect(librariesTab).toHaveAttribute('data-rb-event-key', 'libraries'); + expect(screen.getByRole('tab', { name: tabMessages.coursesTabTitle.defaultMessage })).toBeInTheDocument(); + expect(screen.queryByRole('tab', { name: tabMessages.librariesTabTitle.defaultMessage })).not.toBeInTheDocument(); - expect(screen.queryByText(tabMessages.legacyLibrariesTabTitle.defaultMessage)).not.toBeInTheDocument(); + const locationDisplay = screen.getByTestId('location-display'); + expect(locationDisplay).toHaveTextContent('/home'); }); describe('course tab', () => { @@ -201,30 +170,24 @@ describe('', () => { it('should set the url path to home when switching away then back to courses tab', async () => { const data = generateGetStudioCoursesApiResponseV2(); data.results.courses = []; - await axiosMock.onGet(libraryApiLink).reply(200, generateGetStudioHomeLibrariesApiResponse()); await axiosMock.onGet(getStudioHomeApiUrl()).reply(200, generateGetStudioHomeDataApiResponse()); await axiosMock.onGet(courseApiLinkV2).reply(200, data); render(); await executeThunk(fetchStudioHomeData(), store.dispatch); - // confirm the url path is initially /home const firstLocationDisplay = await screen.findByTestId('location-display'); expect(firstLocationDisplay).toHaveTextContent('/home'); - // switch to libraries tab - const librariesTab = screen.getByText(tabMessages.legacyLibrariesTabTitle.defaultMessage); + const librariesTab = screen.getByRole('tab', { name: tabMessages.librariesTabTitle.defaultMessage }); fireEvent.click(librariesTab); - // confirm that the url path has changed expect(librariesTab).toHaveClass('active'); const secondLocationDisplay = await screen.findByTestId('location-display'); - expect(secondLocationDisplay).toHaveTextContent('/libraries-v1'); + expect(secondLocationDisplay).toHaveTextContent('/libraries'); - // switch back to courses tab - const coursesTab = screen.getByText(tabMessages.coursesTabTitle.defaultMessage); + const coursesTab = screen.getByRole('tab', { name: tabMessages.coursesTabTitle.defaultMessage }); fireEvent.click(coursesTab); - // confirm that the url path is /home expect(coursesTab).toHaveClass('active'); const thirdLocationDisplay = await screen.findByTestId('location-display'); expect(thirdLocationDisplay).toHaveTextContent('/home'); @@ -268,84 +231,6 @@ describe('', () => { beforeEach(async () => { await axiosMock.onGet(courseApiLinkV2).reply(200, generateGetStudioCoursesApiResponseV2()); }); - it('should switch to Legacy Libraries tab and render - search and filter should work as expected', async () => { - await axiosMock.onGet(getStudioHomeApiUrl()).reply(200, generateGetStudioHomeDataApiResponse()); - await axiosMock.onGet(libraryApiLink).reply(200, generateGetStudioHomeLibrariesApiResponse()); - render(); - const user = userEvent.setup(); - await act(async () => executeThunk(fetchStudioHomeData(), store.dispatch)); - - const librariesTab = await screen.findByText(tabMessages.legacyLibrariesTabTitle.defaultMessage); - await user.click(librariesTab); - - expect(librariesTab).toHaveClass('active'); - const panel = await screen.findByRole('tabpanel', { hidden: false }); - - expect(await screen.findByText(studioHomeMock.libraries[0].displayName)).toBeVisible(); - - expect( - await screen.findByText(`${studioHomeMock.libraries[0].org} / ${studioHomeMock.libraries[0].number}`), - ).toBeVisible(); - - // Migration info should be displayed - const migratedContent = generateGetStudioHomeLibrariesApiResponse().libraries[1]; - expect(await screen.findByText(migratedContent.displayName)).toBeVisible(); - const newTitleElement = await screen.findAllByText(migratedContent.migratedToTitle!); - expect(newTitleElement[0]).toBeVisible(); - expect(newTitleElement[0]).toHaveAttribute('href', `/library/${migratedContent.migratedToKey}`); - expect(newTitleElement[1]).toHaveAttribute( - 'href', - `/library/${migratedContent.migratedToKey}/collection/${migratedContent.migratedToCollectionKey}`, - ); - - // Check total count display - expect(await within(panel).findByText('Showing 3 of 3')).toBeInTheDocument(); - - // Test search functionality - const searchField = await within(panel).findByPlaceholderText('Search'); - - fireEvent.change(searchField, { target: { value: 'Legacy' } }); - // Should only show 1 result i.e. migratedContent.displayName - expect(await within(panel).findByText('Showing 1 of 3')).toBeInTheDocument(); - expect(await within(panel).findByText(migratedContent.displayName)).toBeVisible(); - // Should not show other items. - expect( - within(panel).queryByText( - generateGetStudioHomeLibrariesApiResponse().libraries[0].displayName, - ), - ).not.toBeInTheDocument(); - // reset search - fireEvent.change(searchField, { target: { value: '' } }); - - // Test migration filter - const filter = await within(panel).findByRole('button', { name: 'Any Migration Status' }); - await user.click(filter); - let migratedOption = await within(panel).findByRole('checkbox', { name: 'Migrated' }); - // This should uncheck Migrated option as all options are selected by default - await user.click(migratedOption); - // Should only show 2 result i.e. unmigrated libraries - expect(await within(panel).findByText('Showing 2 of 3')).toBeInTheDocument(); - // test clearing filter - const clearFilter = await within(panel).findByRole('button', { name: 'Clear Filter' }); - await user.click(clearFilter); - // Should show all 3 results - expect(await within(panel).findByText('Showing 3 of 3')).toBeInTheDocument(); - // Open the filter again - await user.click(filter); - // Reload migratedOption as clearing and opening the filter again creates a new modal - migratedOption = await within(panel).findByRole('checkbox', { name: 'Migrated' }); - const unmigratedOption = await within(panel).findByRole('checkbox', { name: 'Unmigrated' }); - // both options should be selected by default - even after clearing - expect(migratedOption).toBeChecked(); - expect(unmigratedOption).toBeChecked(); - // Un-checking both options should reset the state to both checked. - await user.click(unmigratedOption); - await user.click(migratedOption); - expect(migratedOption).toBeChecked(); - expect(unmigratedOption).toBeChecked(); - // Should show all 3 results - expect(await within(panel).findByText('Showing 3 of 3')).toBeInTheDocument(); - }); it('should switch to Libraries tab and render specific v2 library details', async () => { render(); @@ -370,102 +255,6 @@ describe('', () => { )).toBeVisible(); }); - it('should switch to Libraries tab and render specific v1 library details - v1 only mode', async () => { - await axiosMock.onGet(getStudioHomeApiUrl()).reply(200, generateGetStudioHomeDataApiResponse()); - await axiosMock.onGet(libraryApiLink).reply(200, generateGetStudioHomeLibrariesApiResponse()); - render({ librariesV2Enabled: false }); - const user = userEvent.setup(); - await act(async () => executeThunk(fetchStudioHomeData(), store.dispatch)); - - const librariesTab = await screen.findByRole('tab', { name: tabMessages.librariesTabTitle.defaultMessage }); - await user.click(librariesTab); - - expect(librariesTab).toHaveClass('active'); - - expect(await screen.findByText(studioHomeMock.libraries[0].displayName)).toBeVisible(); - - expect( - await screen.findByText(`${studioHomeMock.libraries[0].org} / ${studioHomeMock.libraries[0].number}`), - ).toBeVisible(); - }); - - it('should open migration library page from v1 libraries tab', async () => { - await axiosMock.onGet(getStudioHomeApiUrl()).reply(200, generateGetStudioHomeDataApiResponse()); - await axiosMock.onGet(libraryApiLink).reply(200, generateGetStudioHomeLibrariesApiResponse()); - render({ librariesV2Enabled: false }); - const user = userEvent.setup(); - await act(async () => executeThunk(fetchStudioHomeData(), store.dispatch)); - - const librariesTab = await screen.findByRole('tab', { name: tabMessages.librariesTabTitle.defaultMessage }); - await user.click(librariesTab); - - expect(librariesTab).toHaveClass('active'); - - expect(await screen.findByText(studioHomeMock.libraries[0].displayName)).toBeVisible(); - - const migratorButton = screen.getByRole('button', { name: /review legacy libraries/i }); - expect(migratorButton).toBeInTheDocument(); - await user.click(migratorButton); - - const locationDisplay = await screen.findByTestId('location-display'); - expect(locationDisplay).toHaveTextContent('/migrate'); - }); - - it('should open migration library page from v2 libraries tab', async () => { - const libraries = generateGetStudioHomeLibrariesApiResponse().libraries.map( - library => ({ - ...library, - isMigrated: false, - }), - ); - const user = userEvent.setup(); - await axiosMock.onGet(getStudioHomeApiUrl()).reply(200, generateGetStudioHomeLibrariesApiResponse()); - await axiosMock.onGet(libraryApiLink).reply(200, { libraries }); - render(); - await executeThunk(fetchStudioHomeData(), store.dispatch); - - const librariesTab = await screen.findByRole('tab', { name: tabMessages.librariesTabTitle.defaultMessage }); - await user.click(librariesTab); - - expect(librariesTab).toHaveClass('active'); - - expect(await screen.findByText(/welcome to the new content libraries/i)).toBeVisible(); - - const migratorButton = screen.getByRole('button', { name: /review legacy libraries/i }); - expect(migratorButton).toBeInTheDocument(); - await user.click(migratorButton); - - const locationDisplay = await screen.findByTestId('location-display'); - expect(locationDisplay).toHaveTextContent('/migrate'); - }); - - it('should switch to Libraries tab and render specific v2 library details ("v2 only" mode)', async () => { - render({ librariesV1Enabled: false }); - await axiosMock.onGet(getStudioHomeApiUrl()).reply(200, generateGetStudioHomeDataApiResponse()); - await executeThunk(fetchStudioHomeData(), store.dispatch); - - // Libraries v1 tab should not be shown - expect(screen.queryByText(tabMessages.legacyLibrariesTabTitle.defaultMessage)).toBeNull(); - - const librariesTab = await screen.findByRole('tab', { name: tabMessages.librariesTabTitle.defaultMessage }); - fireEvent.click(librariesTab); - - expect(librariesTab).toHaveClass('active'); - - await screen.findByText('Showing 2 of 2'); - expect(screen.getAllByText('Page 1, Current Page, of 2')[0]).toBeVisible(); - - expect(screen.getByText(contentLibrariesListV2.results[0].title)).toBeVisible(); - expect(screen.getByText( - `${contentLibrariesListV2.results[0].org} / ${contentLibrariesListV2.results[0].slug}`, - )).toBeVisible(); - - expect(screen.getByText(contentLibrariesListV2.results[1].title)).toBeVisible(); - expect(screen.getByText( - `${contentLibrariesListV2.results[1].org} / ${contentLibrariesListV2.results[1].slug}`, - )).toBeVisible(); - }); - it('should show a "not found" message if no v2 libraries were loaded', async () => { mockGetContentLibraryV2List.applyMockEmpty(); render(); @@ -484,35 +273,8 @@ describe('', () => { ).toBeVisible(); }); - it('should hide Libraries tab when libraries are disabled', async () => { - const data = generateGetStudioHomeDataApiResponse(); - - render({ librariesV1Enabled: false }); - await axiosMock.onGet(getStudioHomeApiUrl()).reply(200, data); - await executeThunk(fetchStudioHomeData(), store.dispatch); - - await screen.findByText(tabMessages.coursesTabTitle.defaultMessage); - expect(screen.queryByText(tabMessages.legacyLibrariesTabTitle.defaultMessage)).toBeNull(); - }); - - it('should render legacy libraries fetch failure alert', async () => { - await axiosMock.onGet(getStudioHomeApiUrl()).reply(200, generateGetStudioHomeDataApiResponse()); - await axiosMock.onGet(libraryApiLink).reply(404); - render(); - const user = userEvent.setup(); - await executeThunk(fetchStudioHomeData(), store.dispatch); - - const librariesTab = await screen.findByText(tabMessages.legacyLibrariesTabTitle.defaultMessage); - await user.click(librariesTab); - - expect(librariesTab).toHaveClass('active'); - - expect(await screen.findByText(tabMessages.librariesTabErrorMessage.defaultMessage)).toBeVisible(); - }); - it('should render v2 libraries fetch failure alert', async () => { mockGetContentLibraryV2List.applyMockError(); - await axiosMock.onGet(libraryApiLink).reply(200, generateGetStudioHomeLibrariesApiResponse()); await axiosMock.onGet(getStudioHomeApiUrl()).reply(200, generateGetStudioHomeDataApiResponse()); render(); const user = userEvent.setup(); @@ -529,38 +291,5 @@ describe('', () => { ), ).toBeVisible(); }); - - [true, false].forEach((isMigrated) => { - it(`should render v2 libraries migration alert when the libraries have isMigrated=${isMigrated}`, async () => { - const libraries = generateGetStudioHomeLibrariesApiResponse().libraries.map( - library => ({ - ...library, - isMigrated, - }), - ); - const user = userEvent.setup(); - await axiosMock.onGet(getStudioHomeApiUrl()).reply(200, generateGetStudioHomeLibrariesApiResponse()); - await axiosMock.onGet(libraryApiLink).reply(200, { libraries }); - render(); - await executeThunk(fetchStudioHomeData(), store.dispatch); - - const librariesTab = await screen.findByRole('tab', { name: tabMessages.librariesTabTitle.defaultMessage }); - await user.click(librariesTab); - - expect(librariesTab).toHaveClass('active'); - - expect(await screen.findByText(/welcome to the new content libraries/i)).toBeVisible(); - - const migrationPendingText = /legacy libraries can be migrated using the migration tool/i; - - if (isMigrated) { - expect(screen.queryByText(migrationPendingText)).not.toBeInTheDocument(); - expect(screen.queryByRole('button', { name: 'Review Legacy Libraries' })).not.toBeInTheDocument(); - } else { - expect(screen.getByText(migrationPendingText)).toBeVisible(); - expect(screen.getByRole('button', { name: 'Review Legacy Libraries' })).toBeVisible(); - } - }); - }); }); }); diff --git a/src/studio-home/tabs-section/index.tsx b/src/studio-home/tabs-section/index.tsx index a130f12f25..497d5829d9 100644 --- a/src/studio-home/tabs-section/index.tsx +++ b/src/studio-home/tabs-section/index.tsx @@ -9,7 +9,6 @@ import { getConfig } from '@edx/frontend-platform'; import { useIntl } from '@edx/frontend-platform/i18n'; import messages from './messages'; -import { BaseFilterState, Filter, LibrariesList } from './libraries-tab'; import LibrariesV2List from './libraries-v2-tab/index'; import { CoursesList } from './courses-tab'; import { WelcomeLibrariesV2Alert } from './libraries-v2-tab/WelcomeLibrariesV2Alert'; @@ -18,7 +17,6 @@ interface Props { showNewCourseContainer: boolean; onClickNewCourse: () => void; isShowProcessing: boolean; - librariesV1Enabled?: boolean; librariesV2Enabled?: boolean; } @@ -26,31 +24,22 @@ const TabsSection = ({ showNewCourseContainer, onClickNewCourse, isShowProcessing, - librariesV1Enabled, librariesV2Enabled, }: Props) => { const intl = useIntl(); const navigate = useNavigate(); const { pathname } = useLocation(); - const [migrationFilter, setMigrationFilter] = useState(BaseFilterState); const TABS_LIST = { courses: 'courses', libraries: 'libraries', - legacyLibraries: 'legacyLibraries', archived: 'archived', taxonomies: 'taxonomies', } as const; type TabKeyType = keyof typeof TABS_LIST; const initTabKeyState = (pname: string) => { - if (pname.includes('/libraries-v1')) { - return TABS_LIST.legacyLibraries; - } - - if (pname.includes('/libraries')) { - return librariesV2Enabled - ? TABS_LIST.libraries - : TABS_LIST.legacyLibraries; + if (pname.includes('/libraries') && librariesV2Enabled) { + return TABS_LIST.libraries; } // Default to courses tab @@ -101,25 +90,6 @@ const TabsSection = ({ ); } - if (librariesV1Enabled) { - tabs.push( - - - , - ); - } - if (getConfig().ENABLE_TAGGING_TAXONOMY_PAGES === 'true') { tabs.push( { if (tab === TABS_LIST.courses) { navigate('/home'); - } else if (tab === TABS_LIST.legacyLibraries) { - navigate('/libraries-v1'); } else if (tab === TABS_LIST.libraries) { navigate('/libraries'); } else if (tab === TABS_LIST.taxonomies) {