From ba9fb375d944b3a9790d303814f9869b90a541de Mon Sep 17 00:00:00 2001 From: "Adolfo R. Brandes" Date: Fri, 8 Dec 2023 16:27:28 -0300 Subject: [PATCH] fix: Route with PUBLIC_PATH Prior to this change, the MFE would fail to render with any PUBLIC_PATH set. Because that is now handled entirely by `frontend-platform`, we can avoid referring to PUBLIC_PATH entirely, here. --- src/App.jsx | 3 +-- src/App.test.jsx | 6 +----- src/data/constants/app.js | 3 --- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index 01d1b0b7..2439e468 100755 --- a/src/App.jsx +++ b/src/App.jsx @@ -6,7 +6,6 @@ import { AppProvider } from '@edx/frontend-platform/react'; import Footer from '@edx/frontend-component-footer'; import Header from '@edx/frontend-component-header'; -import { routePath } from 'data/constants/app'; import store from 'data/store'; import GradebookPage from 'containers/GradebookPage'; import './App.scss'; @@ -20,7 +19,7 @@ const App = () => (
} /> diff --git a/src/App.test.jsx b/src/App.test.jsx index 4ed87af1..79fbff88 100644 --- a/src/App.test.jsx +++ b/src/App.test.jsx @@ -7,7 +7,6 @@ import { AppProvider } from '@edx/frontend-platform/react'; import Footer from '@edx/frontend-component-footer'; import Header from '@edx/frontend-component-header'; -import { routePath } from 'data/constants/app'; import store from 'data/store'; import GradebookPage from 'containers/GradebookPage'; @@ -21,9 +20,6 @@ jest.mock('react-router-dom', () => ({ jest.mock('@edx/frontend-platform/react', () => ({ AppProvider: () => 'AppProvider', })); -jest.mock('data/constants/app', () => ({ - routePath: '/:courseId', -})); jest.mock('@edx/frontend-component-footer', () => 'Footer'); jest.mock('data/store', () => 'testStore'); jest.mock('containers/GradebookPage', () => 'GradebookPage'); @@ -66,7 +62,7 @@ describe('App router component', () => { expect(secondChild.find('main')).toEqual(shallow(
- } /> + } />
, )); diff --git a/src/data/constants/app.js b/src/data/constants/app.js index fad26bcd..c5d3d89d 100644 --- a/src/data/constants/app.js +++ b/src/data/constants/app.js @@ -1,7 +1,4 @@ import { StrictDict } from 'utils'; -import { getConfig } from '@edx/frontend-platform'; - -export const routePath = `${getConfig().PUBLIC_PATH}:courseId`; export const views = StrictDict({ grades: 'grades',