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.
This commit is contained in:
committed by
Adolfo R. Brandes
parent
b536180a3e
commit
ba9fb375d9
@@ -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 = () => (
|
||||
<main>
|
||||
<Routes>
|
||||
<Route
|
||||
path={routePath}
|
||||
path="/:courseId"
|
||||
element={<GradebookPage />}
|
||||
/>
|
||||
</Routes>
|
||||
|
||||
@@ -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(
|
||||
<main>
|
||||
<Routes>
|
||||
<Route path={routePath} element={<GradebookPage />} />
|
||||
<Route path="/:courseId" element={<GradebookPage />} />
|
||||
</Routes>
|
||||
</main>,
|
||||
));
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user