fix: routerBasename setting (#4891)
This commit is contained in:
1 parent
c368d763b0
commit
459b0d223a
40 files changed
+299
-229
No files matched your search
@@ -11,7 +11,7 @@ import NotFound from './NotFound';
|
||||
import buildModeRoutes from './buildModeRoutes';
|
||||
import PrivateRoute from './PrivateRoute';
|
||||
import PropTypes from 'prop-types';
|
||||
import publicUrl from '../utils/publicUrl';
|
||||
import { routerBase, routerBasename } from '../utils/publicUrl';
|
||||
|
||||
const NotFoundServer = ({
|
||||
message = 'Unable to query for studies at this time. Check your data source configuration or network connection',
|
||||
@@ -55,23 +55,23 @@ NotFoundStudy.propTypes = {
|
||||
// TODO: Include "routes" debug route if dev build
|
||||
const bakedInRoutes = [
|
||||
{
|
||||
path: `${publicUrl}notfoundserver`,
|
||||
path: `/notfoundserver`,
|
||||
children: NotFoundServer,
|
||||
},
|
||||
{
|
||||
path: `${publicUrl}notfoundstudy`,
|
||||
path: `/notfoundstudy`,
|
||||
children: NotFoundStudy,
|
||||
},
|
||||
{
|
||||
path: `${publicUrl}debug`,
|
||||
path: `/debug`,
|
||||
children: Debug,
|
||||
},
|
||||
{
|
||||
path: `${publicUrl}local`,
|
||||
path: `/local`,
|
||||
children: Local.bind(null, { modePath: '' }), // navigate to the worklist
|
||||
},
|
||||
{
|
||||
path: `${publicUrl}localbasic`,
|
||||
path: `/localbasic`,
|
||||
children: Local.bind(null, { modePath: 'viewer/dicomlocal' }),
|
||||
},
|
||||
];
|
||||
@@ -86,7 +86,6 @@ const createRoutes = ({
|
||||
servicesManager,
|
||||
commandsManager,
|
||||
hotkeysManager,
|
||||
routerBasename,
|
||||
showStudyList,
|
||||
}: withAppTypes) => {
|
||||
const routes =
|
||||
@@ -101,8 +100,15 @@ const createRoutes = ({
|
||||
|
||||
const { customizationService } = servicesManager.services;
|
||||
|
||||
const path =
|
||||
routerBasename.length > 1 && routerBasename.endsWith('/')
|
||||
? routerBasename.substring(0, routerBasename.length - 1)
|
||||
: routerBasename;
|
||||
|
||||
console.log('Registering worklist route', routerBasename, path);
|
||||
|
||||
const WorkListRoute = {
|
||||
path: publicUrl,
|
||||
path: '/',
|
||||
children: DataSourceWrapper,
|
||||
private: true,
|
||||
props: { children: WorkList, servicesManager, extensionManager },
|
||||
@@ -113,7 +119,6 @@ const createRoutes = ({
|
||||
const allRoutes = [
|
||||
...routes,
|
||||
...(showStudyList ? [WorkListRoute] : []),
|
||||
...(publicUrl !== '/' && showStudyList ? [{ ...WorkListRoute, path: publicUrl }] : []),
|
||||
...(customRoutes?.routes || []),
|
||||
...bakedInRoutes,
|
||||
customRoutes?.notFoundRoute || notFoundRoute,
|
||||
|
||||
Reference in new issue
Block a user