From c29ab8b0556328a5302236c8819373a1954bda98 Mon Sep 17 00:00:00 2001 From: Peter Kulko Date: Sun, 13 Oct 2024 23:55:32 +0300 Subject: [PATCH] refactor: some refactoring --- src/CourseAuthoringPage.jsx | 5 ++- .../ChecklistSection/ChecklistItemBody.jsx | 5 ++- src/course-outline/hooks.jsx | 7 ++--- src/course-outline/status-bar/StatusBar.jsx | 5 ++- src/course-unit/breadcrumbs/Breadcrumbs.jsx | 5 ++- src/data/api.js | 26 ++++++++++++++++ src/data/slice.js | 4 +++ src/data/thunks.js | 23 ++++++++++++-- src/generic/help-sidebar/HelpSidebar.jsx | 22 ++++++------- src/header/Header.tsx | 6 ++-- src/header/hooks.js | 31 ++++++++++--------- .../pages/PageSettingButton.jsx | 9 +++--- src/studio-home/card-item/index.tsx | 5 +-- src/studio-home/data/api.js | 9 +----- src/studio-home/data/selectors.js | 2 +- src/studio-home/data/utils.js | 27 ---------------- .../factories/mockApiResponses.jsx | 19 ------------ 17 files changed, 103 insertions(+), 107 deletions(-) delete mode 100644 src/studio-home/data/utils.js diff --git a/src/CourseAuthoringPage.jsx b/src/CourseAuthoringPage.jsx index 41da0bc232..84662e2ac3 100644 --- a/src/CourseAuthoringPage.jsx +++ b/src/CourseAuthoringPage.jsx @@ -7,7 +7,7 @@ import { } from 'react-router-dom'; import { StudioFooter } from '@edx/frontend-component-footer'; import Header from './header'; -import { fetchCourseDetail } from './data/thunks'; +import { fetchCourseDetail, fetchWaffleFlags } from './data/thunks'; import { useModel } from './generic/model-store'; import NotFoundAlert from './generic/NotFoundAlert'; import PermissionDeniedAlert from './generic/PermissionDeniedAlert'; @@ -18,9 +18,12 @@ import Loading from './generic/Loading'; const CourseAuthoringPage = ({ courseId, children }) => { const dispatch = useDispatch(); + const STORE = useSelector(state => state); + console.log('STORE', STORE); useEffect(() => { dispatch(fetchCourseDetail(courseId)); + dispatch(fetchWaffleFlags(courseId)); }, [courseId]); useEffect(() => { diff --git a/src/course-checklist/ChecklistSection/ChecklistItemBody.jsx b/src/course-checklist/ChecklistSection/ChecklistItemBody.jsx index 96a143e80c..6625333919 100644 --- a/src/course-checklist/ChecklistSection/ChecklistItemBody.jsx +++ b/src/course-checklist/ChecklistSection/ChecklistItemBody.jsx @@ -10,7 +10,6 @@ import { import { useSelector } from 'react-redux'; import { CheckCircle, RadioButtonUnchecked } from '@openedx/paragon/icons'; -import { getStudioHomeData } from '../../studio-home/data/selectors'; import messages from './messages'; const ChecklistItemBody = ({ @@ -21,13 +20,13 @@ const ChecklistItemBody = ({ // injected intl, }) => { - const studioHomeData = useSelector(getStudioHomeData); + const waffleFlags = useSelector(state => state.courseDetail.waffleFlags); const navigate = useNavigate(); const handleClick = (e, url) => { e.preventDefault(); - if (studioHomeData?.waffleFlags?.ENABLE_NEW_COURSE_UPDATES_PAGE) { + if (waffleFlags?.useNewUpdatesPage) { navigate(`/course/${courseId}/course_info`); } else { window.location.href = url; diff --git a/src/course-outline/hooks.jsx b/src/course-outline/hooks.jsx index 768939baf7..0f1254d2cf 100644 --- a/src/course-outline/hooks.jsx +++ b/src/course-outline/hooks.jsx @@ -8,7 +8,6 @@ import { copyToClipboard } from '../generic/data/thunks'; import { getSavingStatus as getGenericSavingStatus } from '../generic/data/selectors'; import { RequestStatus } from '../data/constants'; import { COURSE_BLOCK_NAMES } from './constants'; -import { getStudioHomeData } from '../studio-home/data/selectors'; import { setCurrentItem, setCurrentSection, @@ -59,7 +58,7 @@ import { const useCourseOutline = ({ courseId }) => { const dispatch = useDispatch(); const navigate = useNavigate(); - const { waffleFlags } = useSelector(getStudioHomeData); + const waffleFlags = useSelector(state => state.courseDetail.waffleFlags); const { reindexLink, @@ -114,7 +113,7 @@ const useCourseOutline = ({ courseId }) => { }; const getUnitUrl = (locator) => { - if (getConfig().ENABLE_UNIT_PAGE === 'true' || waffleFlags?.ENABLE_NEW_UNIT_PAGE) { + if (getConfig().ENABLE_UNIT_PAGE === 'true' || waffleFlags?.useNewUnitPage) { return `/course/${courseId}/container/${locator}`; } return `${getConfig().STUDIO_BASE_URL}/container/${locator}`; @@ -122,7 +121,7 @@ const useCourseOutline = ({ courseId }) => { const openUnitPage = (locator) => { const url = getUnitUrl(locator); - if (getConfig().ENABLE_UNIT_PAGE === 'true' || waffleFlags?.ENABLE_NEW_UNIT_PAGE) { + if (getConfig().ENABLE_UNIT_PAGE === 'true' || waffleFlags?.useNewUnitPage) { navigate(url); } else { window.location.assign(url); diff --git a/src/course-outline/status-bar/StatusBar.jsx b/src/course-outline/status-bar/StatusBar.jsx index 9d671530e1..a2ad214b2c 100644 --- a/src/course-outline/status-bar/StatusBar.jsx +++ b/src/course-outline/status-bar/StatusBar.jsx @@ -15,7 +15,6 @@ import TagCount from '../../generic/tag-count'; import { useHelpUrls } from '../../help-urls/hooks'; import { VIDEO_SHARING_OPTIONS } from '../constants'; import { useContentTagsCount } from '../../generic/data/apiHooks'; -import { getStudioHomeData } from '../../studio-home/data/selectors'; import messages from './messages'; import { getVideoSharingOptionText } from '../utils'; @@ -46,7 +45,7 @@ const StatusBar = ({ }) => { const intl = useIntl(); const { config } = useContext(AppContext); - const { waffleFlags } = useSelector(getStudioHomeData); + const waffleFlags = useSelector(state => state.courseDetail.waffleFlags); const { courseReleaseDate, @@ -87,7 +86,7 @@ const StatusBar = ({ {courseReleaseDateObj.isValid() ? ( { @@ -18,11 +17,11 @@ const Breadcrumbs = () => { const { ancestorXblocks } = useSelector(getCourseSectionVertical); const [section, subsection] = ancestorXblocks ?? []; const navigate = useNavigate(); - const { waffleFlags } = useSelector(getStudioHomeData); + const waffleFlags = useSelector(state => state.courseDetail.waffleFlags); const handleClick = (e, url) => { e.preventDefault(); - if (waffleFlags?.ENABLE_NEW_COURSE_OUTLINE_PAGE) { + if (waffleFlags?.useNewCourseOutlinePage) { navigate(url); } else { window.location.href = `${getConfig().STUDIO_BASE_URL}/${url}`; diff --git a/src/data/api.js b/src/data/api.js index e338ee54be..22072ae160 100644 --- a/src/data/api.js +++ b/src/data/api.js @@ -15,3 +15,29 @@ export async function getCourseDetail(courseId, username) { return normalizeCourseDetail(data); } + +export async function getWaffleFlags(courseId) { + // const { data } = await getAuthenticatedHttpClient() + // .get(`${getConfig().STUDIO_BASE_URL}/api/contentstore/v1/course_waffle_flags`); + + const data = { + use_new_home_page: true, + use_new_custom_pages: true, + use_new_schedule_details_page: true, + use_new_advanced_settings_page: true, + use_new_grading_page: true, + use_new_updates_page: true, + use_new_import_page: true, + use_new_export_page: true, + use_new_files_uploads_page: true, + use_new_video_uploads_page: true, + use_new_course_outline_page: true, + use_new_unit_page: true, + use_new_course_team_page: true, + use_new_certificates_page: true, + use_new_textbooks_page: true, + use_new_group_configurations_page: true, + }; + + return normalizeCourseDetail(data); +} diff --git a/src/data/slice.js b/src/data/slice.js index 749e53f2be..bdc91917ca 100644 --- a/src/data/slice.js +++ b/src/data/slice.js @@ -18,12 +18,16 @@ const slice = createSlice({ updateCanChangeProviders: (state, { payload }) => { state.canChangeProviders = payload.canChangeProviders; }, + fetchWaffleFlagsSuccess: (state, { payload }) => { + state.waffleFlags = payload.waffleFlags; + }, }, }); export const { updateStatus, updateCanChangeProviders, + fetchWaffleFlagsSuccess, } = slice.actions; export const { diff --git a/src/data/thunks.js b/src/data/thunks.js index 9c797dc6a5..2ae6f426f2 100644 --- a/src/data/thunks.js +++ b/src/data/thunks.js @@ -1,13 +1,13 @@ import { getAuthenticatedUser } from '@edx/frontend-platform/auth'; import { addModel } from '../generic/model-store'; -import { getCourseDetail } from './api'; +import { getCourseDetail, getWaffleFlags } from './api'; import { updateStatus, updateCanChangeProviders, + fetchWaffleFlagsSuccess, } from './slice'; import { RequestStatus } from './constants'; -/* eslint-disable import/prefer-default-export */ export function fetchCourseDetail(courseId) { return async (dispatch) => { dispatch(updateStatus({ courseId, status: RequestStatus.IN_PROGRESS })); @@ -29,3 +29,22 @@ export function fetchCourseDetail(courseId) { } }; } + +export function fetchWaffleFlags(courseId) { + return async (dispatch) => { + dispatch(updateStatus({ courseId, status: RequestStatus.IN_PROGRESS })); + + try { + const waffleFlags = await getWaffleFlags(courseId); + dispatch(updateStatus({ courseId, status: RequestStatus.SUCCESSFUL })); + console.log('fetchWaffleFlags thunk', waffleFlags); + dispatch(fetchWaffleFlagsSuccess({ waffleFlags })); + } catch (error) { + if (error.response && error.response.status === 404) { + dispatch(updateStatus({ courseId, status: RequestStatus.NOT_FOUND })); + } else { + dispatch(updateStatus({ courseId, status: RequestStatus.FAILED })); + } + } + }; +} diff --git a/src/generic/help-sidebar/HelpSidebar.jsx b/src/generic/help-sidebar/HelpSidebar.jsx index 9458e6519f..0017d0512d 100644 --- a/src/generic/help-sidebar/HelpSidebar.jsx +++ b/src/generic/help-sidebar/HelpSidebar.jsx @@ -26,7 +26,7 @@ const HelpSidebar = ({ scheduleAndDetails, groupConfigurations, } = otherLinkURLParams; - const { waffleFlags } = useSelector(getStudioHomeData); + const waffleFlags = useSelector(state => state.courseDetail.waffleFlags); const showOtherLink = (params) => !pathname.includes(params); const generateLegacyURL = (urlParameter) => { @@ -57,46 +57,46 @@ const HelpSidebar = ({
    {showOtherLink(scheduleAndDetails) && ( )} {showOtherLink(grading) && ( )} {showOtherLink(courseTeam) && ( )} {showOtherLink(groupConfigurations) && ( )} {showOtherLink(advancedSettings) && ( )} {proctoredExamSettingsUrl && ( diff --git a/src/header/Header.tsx b/src/header/Header.tsx index eeae921704..a1fe9b3df7 100644 --- a/src/header/Header.tsx +++ b/src/header/Header.tsx @@ -34,7 +34,7 @@ const Header = ({ const intl = useIntl(); const libraryHref = useHref('/library/:libraryId'); const navigate = useNavigate(); - const { waffleFlags } = useSelector(getStudioHomeData); + const waffleFlags = useSelector(state => state.courseDetail.waffleFlags); const [isShowSearchModalOpen, openSearchModal, closeSearchModal] = useToggle(false); @@ -66,7 +66,7 @@ const Header = ({ if (isLibrary) { return generatePath(libraryHref, { libraryId: contextId }); } - return waffleFlags?.ENABLE_NEW_COURSE_OUTLINE_PAGE ? `/course/${contextId}` : `${studioBaseUrl}/course/${contextId}`; + return waffleFlags?.useNewCourseOutlinePage ? `/course/${contextId}` : `${studioBaseUrl}/course/${contextId}`; }; return ( @@ -81,7 +81,7 @@ const Header = ({ searchButtonAction={meiliSearchEnabled ? openSearchModal : undefined} containerProps={containerProps} onNavigate={(url) => navigate(url)} - isNewHomePage={waffleFlags?.ENABLE_NEW_HOME_PAGE} + isNewHomePage={waffleFlags?.useNewHomePage} /> {meiliSearchEnabled && ( { const intl = useIntl(); const studioBaseUrl = getConfig().STUDIO_BASE_URL; - const { waffleFlags } = useSelector(getStudioHomeData); + const waffleFlags = useSelector(state => state.courseDetail.waffleFlags); const items = [ { - href: waffleFlags?.ENABLE_NEW_COURSE_OUTLINE_PAGE ? `/course/${courseId}` : `${studioBaseUrl}/course/${courseId}`, + href: waffleFlags?.useNewCourseOutlinePage ? `/course/${courseId}` : `${studioBaseUrl}/course/${courseId}`, title: intl.formatMessage(messages['header.links.outline']), }, { - href: waffleFlags?.ENABLE_NEW_COURSE_UPDATES_PAGE ? `/course/${courseId}/course_info` : `${studioBaseUrl}/course_info/${courseId}`, + href: waffleFlags?.useNewUpdatesPage ? `/course/${courseId}/course_info` : `${studioBaseUrl}/course_info/${courseId}`, title: intl.formatMessage(messages['header.links.updates']), }, { @@ -24,11 +24,11 @@ export const useContentMenuItems = courseId => { title: intl.formatMessage(messages['header.links.pages']), }, { - href: waffleFlags?.ENABLE_NEW_FILE_UPLOAD_PAGE ? `/course/${courseId}/assets` : `${studioBaseUrl}/assets/${courseId}`, + href: waffleFlags?.useNewFilesUploadsPage ? `/course/${courseId}/assets` : `${studioBaseUrl}/assets/${courseId}`, title: intl.formatMessage(messages['header.links.filesAndUploads']), }, ]; - if (getConfig().ENABLE_VIDEO_UPLOAD_PAGE_LINK_IN_CONTENT_DROPDOWN === 'true' || waffleFlags?.ENABLE_NEW_VIDEO_UPLOAD_PAGE) { + if (getConfig().ENABLE_VIDEO_UPLOAD_PAGE_LINK_IN_CONTENT_DROPDOWN === 'true' || waffleFlags?.useNewVideoUploadsPage) { items.push({ href: `/course/${courseId}/videos`, title: intl.formatMessage(messages['header.links.videoUploads']), @@ -41,33 +41,34 @@ export const useContentMenuItems = courseId => { export const useSettingMenuItems = courseId => { const intl = useIntl(); const studioBaseUrl = getConfig().STUDIO_BASE_URL; - const { canAccessAdvancedSettings, waffleFlags } = useSelector(getStudioHomeData); + const { canAccessAdvancedSettings } = useSelector(getStudioHomeData); + const waffleFlags = useSelector(state => state.courseDetail.waffleFlags); const items = [ { - href: waffleFlags?.ENABLE_NEW_SCHEDULE_AND_DETAILS_PAGE ? `/course/${courseId}/settings/details` : `${studioBaseUrl}/settings/details/${courseId}`, + href: waffleFlags?.useNewScheduleDetailsPage ? `/course/${courseId}/settings/details` : `${studioBaseUrl}/settings/details/${courseId}`, title: intl.formatMessage(messages['header.links.scheduleAndDetails']), }, { - href: waffleFlags?.ENABLE_NEW_GRADING_PAGE ? `/course/${courseId}/settings/grading` : `${studioBaseUrl}/settings/grading/${courseId}`, + href: waffleFlags?.useNewGradingPage ? `/course/${courseId}/settings/grading` : `${studioBaseUrl}/settings/grading/${courseId}`, title: intl.formatMessage(messages['header.links.grading']), }, { - href: waffleFlags?.ENABLE_NEW_COURSE_TEAM_PAGE ? `/course/${courseId}/course_team` : `${studioBaseUrl}/course_team/${courseId}`, + href: waffleFlags?.useNewCourseTeamPage ? `/course/${courseId}/course_team` : `${studioBaseUrl}/course_team/${courseId}`, title: intl.formatMessage(messages['header.links.courseTeam']), }, { - href: waffleFlags?.ENABLE_NEW_GROUP_CONFIGURATIONS_PAGE ? `/course/${courseId}/group_configurations` : `${studioBaseUrl}/group_configurations/${courseId}`, + href: waffleFlags?.useNewGroupConfigurationsPage ? `/course/${courseId}/group_configurations` : `${studioBaseUrl}/group_configurations/${courseId}`, title: intl.formatMessage(messages['header.links.groupConfigurations']), }, ...(canAccessAdvancedSettings === true ? [{ - href: waffleFlags?.ENABLE_NEW_ADVANCED_SETTINGS_PAGE ? `/course/${courseId}/settings/advanced` : `${studioBaseUrl}/settings/advanced/${courseId}`, + href: waffleFlags?.useNewAdvancedSettingsPage ? `/course/${courseId}/settings/advanced` : `${studioBaseUrl}/settings/advanced/${courseId}`, title: intl.formatMessage(messages['header.links.advancedSettings']), }] : [] ), ]; - if (getConfig().ENABLE_CERTIFICATE_PAGE === 'true' || waffleFlags?.ENABLE_NEW_CERTIFICATES_PAGE) { + if (getConfig().ENABLE_CERTIFICATE_PAGE === 'true' || waffleFlags?.useNewCertificatesPage) { items.push({ href: `/course/${courseId}/certificates`, title: intl.formatMessage(messages['header.links.certificates']), @@ -79,15 +80,15 @@ export const useSettingMenuItems = courseId => { export const useToolsMenuItems = courseId => { const intl = useIntl(); const studioBaseUrl = getConfig().STUDIO_BASE_URL; - const { waffleFlags } = useSelector(getStudioHomeData); + const waffleFlags = useSelector(state => state.courseDetail.waffleFlags); const items = [ { - href: waffleFlags?.ENABLE_NEW_IMPORT_PAGE ? `/course/${courseId}/import` : `${studioBaseUrl}/import/${courseId}`, + href: waffleFlags?.useNewImportPage ? `/course/${courseId}/import` : `${studioBaseUrl}/import/${courseId}`, title: intl.formatMessage(messages['header.links.import']), }, { - href: waffleFlags?.ENABLE_NEW_EXPORT_PAGE ? `/course/${courseId}/export` : `${studioBaseUrl}/export/${courseId}`, + href: waffleFlags?.useNewExportPage ? `/course/${courseId}/export` : `${studioBaseUrl}/export/${courseId}`, title: intl.formatMessage(messages['header.links.exportCourse']), }, ...(getConfig().ENABLE_TAGGING_TAXONOMY_PAGES === 'true' diff --git a/src/pages-and-resources/pages/PageSettingButton.jsx b/src/pages-and-resources/pages/PageSettingButton.jsx index 4e3b6ba2eb..0f20fc0c2d 100644 --- a/src/pages-and-resources/pages/PageSettingButton.jsx +++ b/src/pages-and-resources/pages/PageSettingButton.jsx @@ -9,7 +9,6 @@ import { useNavigate, Link } from 'react-router-dom'; import messages from '../messages'; import { PagesAndResourcesContext } from '../PagesAndResourcesProvider'; -import { getStudioHomeData } from '../../studio-home/data/selectors'; const PageSettingButton = ({ id, @@ -20,25 +19,25 @@ const PageSettingButton = ({ const { formatMessage } = useIntl(); const { path: pagesAndResourcesPath } = useContext(PagesAndResourcesContext); const navigate = useNavigate(); - const studioHomeData = useSelector(getStudioHomeData); + const waffleFlags = useSelector(state => state.courseDetail.waffleFlags); const determineLinkDestination = useMemo(() => { if (!legacyLink) { return null; } if (legacyLink.includes('textbooks')) { - return studioHomeData?.waffleFlags?.ENABLE_NEW_TEXTBOOKS_PAGE + return waffleFlags?.useNewTextbooksPage ? `/course/${courseId}/${id.replace('_', '-')}` : legacyLink; } if (legacyLink.includes('tabs')) { - return studioHomeData?.waffleFlags?.ENABLE_NEW_CUSTOM_PAGES + return waffleFlags?.useNewCustomPages ? `/course/${courseId}/${id.replace('_', '-')}` : legacyLink; } return null; - }, [legacyLink, studioHomeData?.waffleFlags, id]); + }, [legacyLink, waffleFlags, id]); const canConfigureOrEnable = allowedOperations?.configure || allowedOperations?.enable; diff --git a/src/studio-home/card-item/index.tsx b/src/studio-home/card-item/index.tsx index 639c2e8594..4c26ebb8b8 100644 --- a/src/studio-home/card-item/index.tsx +++ b/src/studio-home/card-item/index.tsx @@ -59,9 +59,10 @@ const CardItem: React.FC = ({ allowCourseReruns, courseCreatorStatus, rerunCreatorStatus, - waffleFlags, } = useSelector(getStudioHomeData); - const destinationUrl: string = waffleFlags?.ENABLE_NEW_COURSE_OUTLINE_PAGE + const waffleFlags = useSelector(state => state.courseDetail.waffleFlags); + + const destinationUrl: string = waffleFlags?.useNewCourseOutlinePage ? path ?? url : path ?? new URL(url, getConfig().STUDIO_BASE_URL).toString(); const subtitle = isLibraries ? `${org} / ${number}` : `${org} / ${number} / ${run}`; diff --git a/src/studio-home/data/api.js b/src/studio-home/data/api.js index 5e80bc6182..fcc6603979 100644 --- a/src/studio-home/data/api.js +++ b/src/studio-home/data/api.js @@ -2,8 +2,6 @@ import { camelCaseObject, snakeCaseObject, getConfig } from '@edx/frontend-platform'; import { getAuthenticatedHttpClient } from '@edx/frontend-platform/auth'; -import { getWaffleFlagsConfig } from './utils'; - export const getApiBaseUrl = () => getConfig().STUDIO_BASE_URL; export const getStudioHomeApiUrl = () => new URL('api/contentstore/v1/home', getApiBaseUrl()).href; export const getRequestCourseCreatorUrl = () => new URL('request_course_creator', getApiBaseUrl()).href; @@ -16,12 +14,7 @@ export const getCourseNotificationUrl = (url) => new URL(url, getApiBaseUrl()).h export async function getStudioHomeData() { const { data } = await getAuthenticatedHttpClient().get(getStudioHomeApiUrl()); - const result = { - ...camelCaseObject(data), - waffleFlags: getWaffleFlagsConfig(camelCaseObject(data)), - }; - - return result; + return camelCaseObject(data); } /** Get list of courses from the deprecated non-paginated API */ diff --git a/src/studio-home/data/selectors.js b/src/studio-home/data/selectors.js index 97e525fb5b..186673edae 100644 --- a/src/studio-home/data/selectors.js +++ b/src/studio-home/data/selectors.js @@ -1,4 +1,4 @@ -export const getStudioHomeData = (state) => state.studioHome?.studioHomeData; +export const getStudioHomeData = state => state.studioHome.studioHomeData; export const getLoadingStatuses = (state) => state.studioHome.loadingStatuses; export const getSavingStatuses = (state) => state.studioHome.savingStatuses; export const getStudioHomeCoursesParams = (state) => state.studioHome.studioHomeCoursesRequestParams; diff --git a/src/studio-home/data/utils.js b/src/studio-home/data/utils.js deleted file mode 100644 index 81d6d885f5..0000000000 --- a/src/studio-home/data/utils.js +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Retrieves the waffle flag configuration based on the provided result object. - * - * @param {Object} result - The result object containing waffle flags. - * @param {Object} result.waffleFlags - The waffle flags for feature toggling. - * @returns {Object} The configuration object with feature toggles. - */ -// eslint-disable-next-line import/prefer-default-export -export const getWaffleFlagsConfig = ({ waffleFlags = {} }) => ({ - ENABLE_NEW_SCHEDULE_AND_DETAILS_PAGE: waffleFlags.contentstoreNewStudioMfeUseNewScheduleDetailsPage ?? false, - ENABLE_NEW_GRADING_PAGE: waffleFlags.contentstoreNewStudioMfeUseNewGradingPage ?? false, - ENABLE_NEW_COURSE_TEAM_PAGE: waffleFlags.contentstoreNewStudioMfeUseNewCourseTeamPage ?? false, - ENABLE_NEW_GROUP_CONFIGURATIONS_PAGE: waffleFlags.contentstoreNewStudioMfeUseNewGroupConfigurationsPage ?? false, - ENABLE_NEW_ADVANCED_SETTINGS_PAGE: waffleFlags.contentstoreNewStudioMfeUseNewAdvancedSettingsPage ?? false, - ENABLE_NEW_COURSE_OUTLINE_PAGE: waffleFlags.contentstoreNewStudioMfeUseNewCourseOutlinePage ?? false, - ENABLE_NEW_COURSE_UPDATES_PAGE: waffleFlags.contentstoreNewStudioMfeUseNewUpdatesPage ?? false, - ENABLE_NEW_FILE_UPLOAD_PAGE: waffleFlags.contentstoreNewStudioMfeUseNewFilesUploadsPage ?? false, - ENABLE_NEW_PAGES_AND_RESOURCES_PAGE: waffleFlags.contentstoreNewStudioMfeUseNewCustomPages ?? false, - ENABLE_NEW_IMPORT_PAGE: waffleFlags.contentstoreNewStudioMfeUseNewImportPage ?? false, - ENABLE_NEW_EXPORT_PAGE: waffleFlags.contentstoreNewStudioMfeUseNewExportPage ?? false, - ENABLE_NEW_HOME_PAGE: waffleFlags.newStudioMfeUseNewHomePage ?? false, - ENABLE_NEW_TEXTBOOKS_PAGE: waffleFlags.contentstoreNewStudioMfeUseNewTextbooksPage ?? false, - ENABLE_NEW_CUSTOM_PAGES: waffleFlags.contentstoreNewStudioMfeUseNewCustomPages ?? false, - ENABLE_NEW_VIDEO_UPLOAD_PAGE: waffleFlags.contentstoreNewStudioMfeUseNewVideoUploadsPage ?? false, - ENABLE_NEW_CERTIFICATES_PAGE: waffleFlags.contentstoreNewStudioMfeUseNewCertificatesPage ?? false, - ENABLE_NEW_UNIT_PAGE: waffleFlags.contentstoreNewStudioMfeUseNewUnitPage ?? false, -}); diff --git a/src/studio-home/factories/mockApiResponses.jsx b/src/studio-home/factories/mockApiResponses.jsx index ce5fdf90e2..8d86e22d4a 100644 --- a/src/studio-home/factories/mockApiResponses.jsx +++ b/src/studio-home/factories/mockApiResponses.jsx @@ -45,25 +45,6 @@ export const generateGetStudioHomeDataApiResponse = () => ({ platformName: 'Your Platform Name Here', userIsActive: true, allowToCreateNewOrg: false, - waffleFlags: { - ENABLE_NEW_ADVANCED_SETTINGS_PAGE: false, - ENABLE_NEW_CERTIFICATES_PAGE: false, - ENABLE_NEW_COURSE_OUTLINE_PAGE: false, - ENABLE_NEW_COURSE_TEAM_PAGE: false, - ENABLE_NEW_COURSE_UPDATES_PAGE: false, - ENABLE_NEW_CUSTOM_PAGES: false, - ENABLE_NEW_EXPORT_PAGE: false, - ENABLE_NEW_FILE_UPLOAD_PAGE: false, - ENABLE_NEW_GRADING_PAGE: false, - ENABLE_NEW_GROUP_CONFIGURATIONS_PAGE: false, - ENABLE_NEW_HOME_PAGE: false, - ENABLE_NEW_IMPORT_PAGE: false, - ENABLE_NEW_PAGES_AND_RESOURCES_PAGE: false, - ENABLE_NEW_SCHEDULE_AND_DETAILS_PAGE: false, - ENABLE_NEW_TEXTBOOKS_PAGE: false, - ENABLE_NEW_UNIT_PAGE: false, - ENABLE_NEW_VIDEO_UPLOAD_PAGE: false, - }, }); /** Mock for the deprecated /api/contentstore/v1/home/courses endpoint. Note this endpoint is NOT paginated. */