fix: Docker build time was very slow on a tiny change (#4559)
Co-authored-by: sedghi <ar.sedghi@gmail.com>
This commit is contained in:
1 parent
ae48f50037
commit
7e43b2f768
19 files changed
+390
-183
No files matched your search
@@ -1,6 +1,7 @@
|
||||
/** @type {AppTypes.Config} */
|
||||
|
||||
window.config = {
|
||||
name: 'config/default.js',
|
||||
routerBasename: '/',
|
||||
// whiteLabeling: {},
|
||||
extensions: [],
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/** @type {AppTypes.Config} */
|
||||
|
||||
window.config = {
|
||||
name: 'config/kheops.js',
|
||||
routerBasename: '/',
|
||||
// whiteLabeling: {},
|
||||
extensions: [],
|
||||
modes: [],
|
||||
customizationService: {},
|
||||
@@ -24,8 +24,9 @@ window.config = {
|
||||
prefetch: 25,
|
||||
},
|
||||
// filterQueryParam: false,
|
||||
// Uses the dicomweb proxy as the default URL
|
||||
defaultDataSourceName: 'dicomwebproxy',
|
||||
// Uses the ohif datasource as the default - this requires that KHEOPS be
|
||||
// configured with an OHIF path to .../viewer/dicomwebproxy
|
||||
defaultDataSourceName: 'ohif3',
|
||||
/* Dynamic config allows user to pass "configUrl" query string this allows to load config without recompiling application. The regex will ensure valid configuration source */
|
||||
// dangerouslyUseDynamicConfig: {
|
||||
// enabled: true,
|
||||
|
||||
@@ -29,7 +29,6 @@ window.config = {
|
||||
enableStudyLazyLoad: true,
|
||||
supportsFuzzyMatching: true,
|
||||
supportsWildcard: true,
|
||||
dicomUploadEnabled: true,
|
||||
omitQuotationForMultipartRequest: true,
|
||||
bulkDataURI: {
|
||||
enabled: true,
|
||||
|
||||
@@ -214,8 +214,9 @@
|
||||
function browserImportFunction(moduleId) {
|
||||
return import(moduleId);
|
||||
}
|
||||
</script>
|
||||
|
||||
window.PUBLIC_URL = '<%= PUBLIC_URL %>';
|
||||
</script>
|
||||
|
||||
<!-- EXTENSIONS -->
|
||||
<!-- <script type="text/javascript" src="path/to/some-extension.js"></script>
|
||||
@@ -236,7 +237,6 @@
|
||||
<body>
|
||||
<noscript> You need to enable JavaScript to run this app. </noscript>
|
||||
<div id="react-portal"></div>
|
||||
<div id="root">
|
||||
</div>
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -6,6 +6,7 @@ import { createRoot } from 'react-dom/client';
|
||||
import App from './App';
|
||||
import React from 'react';
|
||||
import { history } from './utils/history';
|
||||
export { publicUrl } from './utils/publicUrl';
|
||||
|
||||
/**
|
||||
* EXTENSIONS AND MODES
|
||||
|
||||
@@ -11,6 +11,7 @@ import filtersMeta from './filtersMeta.js';
|
||||
import { useAppConfig } from '@state';
|
||||
import { useDebounce, useSearchParams } from '@hooks';
|
||||
import { utils, hotkeys } from '@ohif/core';
|
||||
import publicUrl from '../../utils/publicUrl';
|
||||
|
||||
import {
|
||||
Icon,
|
||||
@@ -205,7 +206,7 @@ function WorkList({
|
||||
});
|
||||
|
||||
navigate({
|
||||
pathname: '/',
|
||||
pathname: publicUrl,
|
||||
search: search ? `?${search}` : undefined,
|
||||
});
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
@@ -396,9 +397,7 @@ function WorkList({
|
||||
<Link
|
||||
className={isValidMode ? '' : 'cursor-not-allowed'}
|
||||
key={i}
|
||||
to={`${dataPath ? '../../' : ''}${mode.routeName}${
|
||||
dataPath || ''
|
||||
}?${query.toString()}`}
|
||||
to={`${publicUrl}${mode.routeName}${dataPath || ''}?${query.toString()}`}
|
||||
onClick={event => {
|
||||
// In case any event bubbles up for an invalid mode, prevent the navigation.
|
||||
// For example, the event bubbles up when the icon embedded in the disabled button is clicked.
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import React from 'react';
|
||||
import ModeRoute from '@routes/Mode';
|
||||
import publicUrl from '../utils/publicUrl';
|
||||
|
||||
/*
|
||||
Routes uniquely define an entry point to:
|
||||
@@ -42,7 +43,7 @@ export default function buildModeRoutes({
|
||||
modes.forEach(mode => {
|
||||
// todo: for each route. add route to path.
|
||||
dataSourceNames.forEach(dataSourceName => {
|
||||
const path = `/${mode.routeName}/${dataSourceName}`;
|
||||
const path = `${publicUrl}${mode.routeName}/${dataSourceName}`;
|
||||
|
||||
// TODO move up.
|
||||
const children = () => (
|
||||
@@ -65,7 +66,7 @@ export default function buildModeRoutes({
|
||||
|
||||
// Add active DataSource route.
|
||||
// This is the DataSource route for the active data source defined in ExtensionManager.getActiveDataSource
|
||||
const path = `/${mode.routeName}`;
|
||||
const path = `${publicUrl}${mode.routeName}`;
|
||||
|
||||
// TODO move up.
|
||||
const children = () => (
|
||||
|
||||
@@ -12,6 +12,7 @@ import buildModeRoutes from './buildModeRoutes';
|
||||
import PrivateRoute from './PrivateRoute';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Link } from 'react-router-dom';
|
||||
import publicUrl from '../utils/publicUrl';
|
||||
|
||||
const NotFoundServer = ({
|
||||
message = 'Unable to query for studies at this time. Check your data source configuration or network connection',
|
||||
@@ -55,23 +56,23 @@ NotFoundStudy.propTypes = {
|
||||
// TODO: Include "routes" debug route if dev build
|
||||
const bakedInRoutes = [
|
||||
{
|
||||
path: '/notfoundserver',
|
||||
path: `${publicUrl}notfoundserver`,
|
||||
children: NotFoundServer,
|
||||
},
|
||||
{
|
||||
path: '/notfoundstudy',
|
||||
path: `${publicUrl}notfoundstudy`,
|
||||
children: NotFoundStudy,
|
||||
},
|
||||
{
|
||||
path: '/debug',
|
||||
path: `${publicUrl}debug`,
|
||||
children: Debug,
|
||||
},
|
||||
{
|
||||
path: '/local',
|
||||
path: `${publicUrl}local`,
|
||||
children: Local.bind(null, { modePath: '' }), // navigate to the worklist
|
||||
},
|
||||
{
|
||||
path: '/localbasic',
|
||||
path: `${publicUrl}localbasic`,
|
||||
children: Local.bind(null, { modePath: 'viewer/dicomlocal' }),
|
||||
},
|
||||
];
|
||||
@@ -102,7 +103,7 @@ const createRoutes = ({
|
||||
const { customizationService } = servicesManager.services;
|
||||
|
||||
const WorkListRoute = {
|
||||
path: '/',
|
||||
path: publicUrl,
|
||||
children: DataSourceWrapper,
|
||||
private: true,
|
||||
props: { children: WorkList, servicesManager, extensionManager },
|
||||
@@ -112,6 +113,8 @@ const createRoutes = ({
|
||||
const allRoutes = [
|
||||
...routes,
|
||||
...(showStudyList ? [WorkListRoute] : []),
|
||||
// This next line adds a route on / to allow loading from the route and redirecting to the public url
|
||||
...(publicUrl !== '/' && showStudyList ? [{ ...WorkListRoute, path: '/' }] : []),
|
||||
...(customRoutes?.routes || []),
|
||||
...bakedInRoutes,
|
||||
customRoutes?.notFoundRoute || notFoundRoute,
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
const publicUrl = (window as any).PUBLIC_URL || '/';
|
||||
|
||||
export default publicUrl;
|
||||
export { publicUrl };
|
||||
Reference in new issue
Block a user