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:
4 files changed
+23
-8
No files matched your search
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user