fix: Add support for showStudyList configuration setting (#3009)

I followed suit with how it was implemented in the v2 branch, on the 404
page I just hit the link back to the study list if we're not configured
to display it. See PR #2131
This commit is contained in:
Tim authored and GitHub committed 2022-12-02 09:23:44 -05:00
1 parent 2a9e1e65a2
commit 4c5d14c624
4 files changed
+23 -8

No files matched your search

+8 -6
View File
@@ -13,12 +13,6 @@ import PrivateRoute from './PrivateRoute';
// TODO: Include "routes" debug route if dev build
const bakedInRoutes = [
// WORK LIST
{
path: '/',
children: DataSourceWrapper,
private: true,
props: { children: WorkList },
},
{
path: '/local',
children: Local,
@@ -27,6 +21,12 @@ const bakedInRoutes = [
// NOT FOUND (404)
const notFoundRoute = { component: NotFound };
const WorkListRoute = {
path: '/',
children: DataSourceWrapper,
private: true,
props: { children: WorkList },
};
const createRoutes = ({
modes,
@@ -36,6 +36,7 @@ const createRoutes = ({
commandsManager,
hotkeysManager,
routerBasename,
showStudyList,
}) => {
const routes =
buildModeRoutes({
@@ -54,6 +55,7 @@ const createRoutes = ({
);
const allRoutes = [
...routes,
...(showStudyList ? [WorkListRoute] : []),
...(customRoutes?.routes || []),
...bakedInRoutes,
customRoutes?.notFoundRoute || notFoundRoute,