chore(prettier): full repo linting and code reformatting once and for all (#3627)
This commit is contained in:
1 parent
01500a2d4c
commit
9045ddaedc
656 files changed
+21737
-20628
No files matched your search
@@ -5,12 +5,7 @@ import i18n from '@ohif/i18n';
|
||||
import { I18nextProvider } from 'react-i18next';
|
||||
import { BrowserRouter } from 'react-router-dom';
|
||||
import Compose from './routes/Mode/Compose';
|
||||
import {
|
||||
ServicesManager,
|
||||
ExtensionManager,
|
||||
CommandsManager,
|
||||
HotkeysManager,
|
||||
} from '@ohif/core';
|
||||
import { ServicesManager, ExtensionManager, CommandsManager, HotkeysManager } from '@ohif/core';
|
||||
import {
|
||||
DialogProvider,
|
||||
Modal,
|
||||
@@ -38,9 +33,7 @@ function App({ config, defaultExtensions, defaultModes }) {
|
||||
const [init, setInit] = useState(null);
|
||||
useEffect(() => {
|
||||
const run = async () => {
|
||||
appInit(config, defaultExtensions, defaultModes)
|
||||
.then(setInit)
|
||||
.catch(console.error);
|
||||
appInit(config, defaultExtensions, defaultModes).then(setInit).catch(console.error);
|
||||
};
|
||||
|
||||
run();
|
||||
@@ -58,13 +51,7 @@ function App({ config, defaultExtensions, defaultModes }) {
|
||||
|
||||
// Set appConfig
|
||||
const appConfigState = init.appConfig;
|
||||
const {
|
||||
routerBasename,
|
||||
modes,
|
||||
dataSources,
|
||||
oidc,
|
||||
showStudyList,
|
||||
} = appConfigState;
|
||||
const { routerBasename, modes, dataSources, oidc, showStudyList } = appConfigState;
|
||||
|
||||
const {
|
||||
uiDialogService,
|
||||
@@ -89,8 +76,7 @@ function App({ config, defaultExtensions, defaultModes }) {
|
||||
[DialogProvider, { service: uiDialogService }],
|
||||
[ModalProvider, { service: uiModalService, modal: Modal }],
|
||||
];
|
||||
const CombinedProviders = ({ children }) =>
|
||||
Compose({ components: providers, children });
|
||||
const CombinedProviders = ({ children }) => Compose({ components: providers, children });
|
||||
|
||||
let authRoutes = null;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ const originalConsoleError = console.error;
|
||||
|
||||
// JSDom's CSS Parser has limited support for certain features
|
||||
// This supresses error warnings caused by it
|
||||
console.error = function(msg) {
|
||||
console.error = function (msg) {
|
||||
if (_.startsWith(msg, 'Error: Could not parse CSS stylesheet')) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -76,14 +76,8 @@ async function appInit(appConfigOrFunc, defaultExtensions, defaultModes) {
|
||||
* Example: [ext1, ext2, ext3]
|
||||
* Example2: [[ext1, config], ext2, [ext3, config]]
|
||||
*/
|
||||
const loadedExtensions = await loadModules([
|
||||
...defaultExtensions,
|
||||
...appConfig.extensions,
|
||||
]);
|
||||
await extensionManager.registerExtensions(
|
||||
loadedExtensions,
|
||||
appConfig.dataSources
|
||||
);
|
||||
const loadedExtensions = await loadModules([...defaultExtensions, ...appConfig.extensions]);
|
||||
await extensionManager.registerExtensions(loadedExtensions, appConfig.dataSources);
|
||||
|
||||
// TODO: We no longer use `utils.addServer`
|
||||
// TODO: We no longer init webWorkers at app level
|
||||
@@ -93,10 +87,7 @@ async function appInit(appConfigOrFunc, defaultExtensions, defaultModes) {
|
||||
throw new Error('No modes are defined! Check your app-config.js');
|
||||
}
|
||||
|
||||
const loadedModes = await loadModules([
|
||||
...(appConfig.modes || []),
|
||||
...defaultModes,
|
||||
]);
|
||||
const loadedModes = await loadModules([...(appConfig.modes || []), ...defaultModes]);
|
||||
|
||||
// This is the name for the loaded istance object
|
||||
appConfig.loadedModes = [];
|
||||
|
||||
@@ -5,7 +5,6 @@ import { ViewportGrid, ViewportPane, useViewportGrid } from '@ohif/ui';
|
||||
import EmptyViewport from './EmptyViewport';
|
||||
import classNames from 'classnames';
|
||||
|
||||
|
||||
function ViewerViewportGrid(props) {
|
||||
const { servicesManager, viewportComponents, dataSource } = props;
|
||||
const [viewportGrid, viewportGridService] = useViewportGrid();
|
||||
@@ -14,12 +13,9 @@ function ViewerViewportGrid(props) {
|
||||
const { numCols, numRows } = layout;
|
||||
|
||||
// TODO -> Need some way of selecting which displaySets hit the viewports.
|
||||
const {
|
||||
displaySetService,
|
||||
measurementService,
|
||||
hangingProtocolService,
|
||||
uiNotificationService,
|
||||
} = (servicesManager as ServicesManager).services;
|
||||
const { displaySetService, measurementService, hangingProtocolService, uiNotificationService } = (
|
||||
servicesManager as ServicesManager
|
||||
).services;
|
||||
|
||||
/**
|
||||
* This callback runs after the viewports structure has changed in any way.
|
||||
@@ -63,15 +59,13 @@ function ViewerViewportGrid(props) {
|
||||
const displaySetUIDsToHang = [];
|
||||
const displaySetUIDsToHangOptions = [];
|
||||
|
||||
displaySetsInfo.forEach(
|
||||
({ displaySetInstanceUID, displaySetOptions }) => {
|
||||
if (displaySetInstanceUID) {
|
||||
displaySetUIDsToHang.push(displaySetInstanceUID);
|
||||
}
|
||||
|
||||
displaySetUIDsToHangOptions.push(displaySetOptions);
|
||||
displaySetsInfo.forEach(({ displaySetInstanceUID, displaySetOptions }) => {
|
||||
if (displaySetInstanceUID) {
|
||||
displaySetUIDsToHang.push(displaySetInstanceUID);
|
||||
}
|
||||
);
|
||||
|
||||
displaySetUIDsToHangOptions.push(displaySetOptions);
|
||||
});
|
||||
|
||||
const computedViewportOptions = hangingProtocolService.getComputedOptions(
|
||||
viewportOptions,
|
||||
@@ -128,12 +122,7 @@ function ViewerViewportGrid(props) {
|
||||
const { unsubscribe } = hangingProtocolService.subscribe(
|
||||
hangingProtocolService.EVENTS.PROTOCOL_CHANGED,
|
||||
({ protocol, stage, activeStudyUID, viewportMatchDetails }) => {
|
||||
updateDisplaySetsFromProtocol(
|
||||
protocol,
|
||||
stage,
|
||||
activeStudyUID,
|
||||
viewportMatchDetails
|
||||
);
|
||||
updateDisplaySetsFromProtocol(protocol, stage, activeStudyUID, viewportMatchDetails);
|
||||
}
|
||||
);
|
||||
|
||||
@@ -152,13 +141,9 @@ function ViewerViewportGrid(props) {
|
||||
// This occurs when no viewport has elected to consume the event
|
||||
// so we need to change layouts into a layout which can consume
|
||||
// the event.
|
||||
const { displaySetInstanceUID: referencedDisplaySetInstanceUID } =
|
||||
measurement;
|
||||
const { displaySetInstanceUID: referencedDisplaySetInstanceUID } = measurement;
|
||||
|
||||
const updatedViewports = _getUpdatedViewports(
|
||||
viewportId,
|
||||
referencedDisplaySetInstanceUID
|
||||
);
|
||||
const updatedViewports = _getUpdatedViewports(viewportId, referencedDisplaySetInstanceUID);
|
||||
// Arbitrarily assign the viewport to element 0
|
||||
const viewport = updatedViewports?.[0];
|
||||
|
||||
@@ -173,9 +158,7 @@ function ViewerViewportGrid(props) {
|
||||
viewport.viewportOptions ||= {};
|
||||
viewport.viewportOptions.orientation = 'acquisition';
|
||||
|
||||
const displaySet = displaySetService.getDisplaySetByUID(
|
||||
referencedDisplaySetInstanceUID
|
||||
);
|
||||
const displaySet = displaySetService.getDisplaySetByUID(referencedDisplaySetInstanceUID);
|
||||
// jump straight to the initial image index if we can
|
||||
if (displaySet.images && measurement.SOPInstanceUID) {
|
||||
for (let index = 0; index < displaySet.images.length; index++) {
|
||||
@@ -242,10 +225,7 @@ function ViewerViewportGrid(props) {
|
||||
*/
|
||||
|
||||
const onDropHandler = (viewportId, { displaySetInstanceUID }) => {
|
||||
const updatedViewports = _getUpdatedViewports(
|
||||
viewportId,
|
||||
displaySetInstanceUID
|
||||
);
|
||||
const updatedViewports = _getUpdatedViewports(viewportId, displaySetInstanceUID);
|
||||
viewportGridService.setDisplaySetsForViewports(updatedViewports);
|
||||
};
|
||||
|
||||
@@ -266,24 +246,19 @@ function ViewerViewportGrid(props) {
|
||||
viewportLabel,
|
||||
} = paneMetadata;
|
||||
|
||||
const viewportId = viewportOptions.viewportId
|
||||
const viewportId = viewportOptions.viewportId;
|
||||
const isActive = activeViewportId === viewportId;
|
||||
|
||||
|
||||
const displaySetInstanceUIDsToUse = displaySetInstanceUIDs || [];
|
||||
|
||||
// This is causing the viewport components re-render when the activeViewportId changes
|
||||
const displaySets = displaySetInstanceUIDsToUse.map(
|
||||
displaySetInstanceUID => {
|
||||
return (
|
||||
displaySetService.getDisplaySetByUID(displaySetInstanceUID) || {}
|
||||
);
|
||||
}
|
||||
).filter(
|
||||
(displaySet) => {
|
||||
const displaySets = displaySetInstanceUIDsToUse
|
||||
.map(displaySetInstanceUID => {
|
||||
return displaySetService.getDisplaySetByUID(displaySetInstanceUID) || {};
|
||||
})
|
||||
.filter(displaySet => {
|
||||
return !displaySet?.unsupported;
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
const ViewportComponent = _getViewportComponent(
|
||||
displaySets,
|
||||
@@ -335,7 +310,7 @@ function ViewerViewportGrid(props) {
|
||||
>
|
||||
<div
|
||||
data-cy="viewport-pane"
|
||||
className={classNames('h-full w-full flex flex-col', {
|
||||
className={classNames('flex h-full w-full flex-col', {
|
||||
'pointer-events-none': !isActive,
|
||||
})}
|
||||
>
|
||||
@@ -364,7 +339,10 @@ function ViewerViewportGrid(props) {
|
||||
}
|
||||
|
||||
return (
|
||||
<ViewportGrid numRows={numRows} numCols={numCols}>
|
||||
<ViewportGrid
|
||||
numRows={numRows}
|
||||
numCols={numCols}
|
||||
>
|
||||
{/* {ViewportPanes} */}
|
||||
{getViewportPanes()}
|
||||
</ViewportGrid>
|
||||
@@ -380,11 +358,7 @@ ViewerViewportGrid.defaultProps = {
|
||||
viewportComponents: [],
|
||||
};
|
||||
|
||||
function _getViewportComponent(
|
||||
displaySets,
|
||||
viewportComponents,
|
||||
uiNotificationService
|
||||
) {
|
||||
function _getViewportComponent(displaySets, viewportComponents, uiNotificationService) {
|
||||
if (!displaySets || !displaySets.length) {
|
||||
return EmptyViewport;
|
||||
}
|
||||
@@ -399,9 +373,7 @@ function _getViewportComponent(
|
||||
if (!viewportComponents[i].displaySetsToDisplay) {
|
||||
throw new Error('displaySetsToDisplay is null');
|
||||
}
|
||||
if (
|
||||
viewportComponents[i].displaySetsToDisplay.includes(SOPClassHandlerId)
|
||||
) {
|
||||
if (viewportComponents[i].displaySetsToDisplay.includes(SOPClassHandlerId)) {
|
||||
const { component } = viewportComponents[i];
|
||||
return component;
|
||||
}
|
||||
|
||||
@@ -16,10 +16,7 @@ import { history } from './utils/history';
|
||||
* pluginImports.js imports all of the modes and extensions and adds them
|
||||
* to the window for processing.
|
||||
*/
|
||||
import {
|
||||
modes as defaultModes,
|
||||
extensions as defaultExtensions,
|
||||
} from './pluginImports';
|
||||
import { modes as defaultModes, extensions as defaultExtensions } from './pluginImports';
|
||||
import loadDynamicConfig from './loadDynamicConfig';
|
||||
|
||||
loadDynamicConfig(window.config).then(config_json => {
|
||||
|
||||
@@ -60,8 +60,7 @@ function DataSourceWrapper(props) {
|
||||
if (!dataSourceName) {
|
||||
// Gets the first defined datasource with the right name
|
||||
// Mostly for historical reasons - new configs should use the defaultDataSourceName
|
||||
const dataSourceModules =
|
||||
extensionManager.modules[MODULE_TYPES.DATA_SOURCE];
|
||||
const dataSourceModules = extensionManager.modules[MODULE_TYPES.DATA_SOURCE];
|
||||
// TODO: Good usecase for flatmap?
|
||||
const webApiDataSources = dataSourceModules.reduce((acc, curr) => {
|
||||
const mods = [];
|
||||
@@ -145,10 +144,7 @@ function DataSourceWrapper(props) {
|
||||
return;
|
||||
}
|
||||
|
||||
const queryFilterValues = _getQueryFilterValues(
|
||||
location.search,
|
||||
STUDIES_LIMIT
|
||||
);
|
||||
const queryFilterValues = _getQueryFilterValues(location.search, STUDIES_LIMIT);
|
||||
|
||||
// 204: no content
|
||||
async function getData() {
|
||||
@@ -173,23 +169,19 @@ function DataSourceWrapper(props) {
|
||||
// - And we didn't cross a result offset range
|
||||
const isSamePage = data.pageNumber === queryFilterValues.pageNumber;
|
||||
const previousOffset =
|
||||
Math.floor((data.pageNumber * data.resultsPerPage) / STUDIES_LIMIT) *
|
||||
(STUDIES_LIMIT - 1);
|
||||
Math.floor((data.pageNumber * data.resultsPerPage) / STUDIES_LIMIT) * (STUDIES_LIMIT - 1);
|
||||
const newOffset =
|
||||
Math.floor(
|
||||
(queryFilterValues.pageNumber * queryFilterValues.resultsPerPage) /
|
||||
STUDIES_LIMIT
|
||||
(queryFilterValues.pageNumber * queryFilterValues.resultsPerPage) / STUDIES_LIMIT
|
||||
) *
|
||||
(STUDIES_LIMIT - 1);
|
||||
// Simply checking data.location !== location is not sufficient because even though the location href (i.e. entire URL)
|
||||
// has not changed, the React Router still provides a new location reference and would result in two study queries
|
||||
// on initial load. Alternatively, window.location.href could be used.
|
||||
const isLocationUpdated =
|
||||
typeof data.location === 'string' ||
|
||||
!areLocationsTheSame(data.location, location);
|
||||
typeof data.location === 'string' || !areLocationsTheSame(data.location, location);
|
||||
const isDataInvalid =
|
||||
!isSamePage ||
|
||||
(!isLoading && (newOffset !== previousOffset || isLocationUpdated));
|
||||
!isSamePage || (!isLoading && (newOffset !== previousOffset || isLocationUpdated));
|
||||
|
||||
if (isDataInvalid) {
|
||||
getData().catch(() => {
|
||||
@@ -207,15 +199,7 @@ function DataSourceWrapper(props) {
|
||||
console.warn(ex);
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [
|
||||
data,
|
||||
location,
|
||||
params,
|
||||
isLoading,
|
||||
setIsLoading,
|
||||
dataSource,
|
||||
isDataSourceInitialized,
|
||||
]);
|
||||
}, [data, location, params, isLoading, setIsLoading, dataSource, isDataSourceInitialized]);
|
||||
// queryFilterValues
|
||||
|
||||
// TODO: Better way to pass DataSource?
|
||||
@@ -256,8 +240,7 @@ function _getQueryFilterValues(query, queryLimit) {
|
||||
patientId: query.get('mrn'),
|
||||
patientName: query.get('patientName'),
|
||||
studyDescription: query.get('description'),
|
||||
modalitiesInStudy:
|
||||
query.get('modalities') && query.get('modalities').split(','),
|
||||
modalitiesInStudy: query.get('modalities') && query.get('modalities').split(','),
|
||||
accessionNumber: query.get('accession'),
|
||||
//
|
||||
startDate: query.get('startDate'),
|
||||
@@ -269,8 +252,7 @@ function _getQueryFilterValues(query, queryLimit) {
|
||||
sortBy: query.get('sortBy'),
|
||||
sortDirection: query.get('sortDirection'),
|
||||
// Offset...
|
||||
offset:
|
||||
Math.floor((pageNumber * resultsPerPage) / queryLimit) * (queryLimit - 1),
|
||||
offset: Math.floor((pageNumber * resultsPerPage) / queryLimit) * (queryLimit - 1),
|
||||
config: query.get('configUrl'),
|
||||
};
|
||||
|
||||
|
||||
@@ -6,36 +6,29 @@ import { Icon } from '@ohif/ui';
|
||||
function Debug() {
|
||||
return (
|
||||
<div style={{ width: '100%', height: '100%' }}>
|
||||
<div className="h-screen w-screen flex justify-center items-center ">
|
||||
<div className="py-8 px-8 mx-auto bg-secondary-dark drop-shadow-md space-y-2 rounded-lg">
|
||||
<div className="flex h-screen w-screen items-center justify-center ">
|
||||
<div className="bg-secondary-dark mx-auto space-y-2 rounded-lg py-8 px-8 drop-shadow-md">
|
||||
<img
|
||||
className="block mx-auto h-14"
|
||||
className="mx-auto block h-14"
|
||||
src="./ohif-logo.svg"
|
||||
alt="OHIF"
|
||||
/>
|
||||
<div className="text-center space-y-2 pt-4">
|
||||
<div className="flex flex-col justify-center items-center">
|
||||
<p className="text-xl text-primary-active font-semibold mt-4">
|
||||
Debug Information
|
||||
</p>
|
||||
<div className="flex space-x-2 mt-4 items-center">
|
||||
<p className="text-md text-white">
|
||||
Cross Origin Isolated (COOP/COEP)
|
||||
</p>
|
||||
<div className="space-y-2 pt-4 text-center">
|
||||
<div className="flex flex-col items-center justify-center">
|
||||
<p className="text-primary-active mt-4 text-xl font-semibold">Debug Information</p>
|
||||
<div className="mt-4 flex items-center space-x-2">
|
||||
<p className="text-md text-white">Cross Origin Isolated (COOP/COEP)</p>
|
||||
<Icon
|
||||
name={
|
||||
window.crossOriginIsolated
|
||||
? 'notifications-success'
|
||||
: 'notifications-error'
|
||||
window.crossOriginIsolated ? 'notifications-success' : 'notifications-error'
|
||||
}
|
||||
className="w-5 h-5"
|
||||
className="h-5 w-5"
|
||||
/>
|
||||
{!window.crossOriginIsolated && (
|
||||
<div className="text-md text-white flex-1">
|
||||
We use SharedArrayBuffer to render volume data (e.g., MPR).
|
||||
If you are seeing this message, it means that your browser
|
||||
has not enabled COOP/COEP. Please see the following link for
|
||||
more information:{' '}
|
||||
<div className="text-md flex-1 text-white">
|
||||
We use SharedArrayBuffer to render volume data (e.g., MPR). If you are seeing
|
||||
this message, it means that your browser has not enabled COOP/COEP. Please see
|
||||
the following link for more information:{' '}
|
||||
<a
|
||||
href="https://web.dev/coop-coep/"
|
||||
target="_blank"
|
||||
|
||||
@@ -12,7 +12,10 @@ import { Icon, Button, LoadingIndicatorProgress } from '@ohif/ui';
|
||||
|
||||
const getLoadButton = (onDrop, text, isDir) => {
|
||||
return (
|
||||
<Dropzone onDrop={onDrop} noDrag>
|
||||
<Dropzone
|
||||
onDrop={onDrop}
|
||||
noDrag
|
||||
>
|
||||
{({ getRootProps, getInputProps }) => (
|
||||
<div {...getRootProps()}>
|
||||
<Button
|
||||
@@ -80,9 +83,7 @@ function Local({ modePath }: LocalProps) {
|
||||
const smStudies = studies.filter(id => {
|
||||
const study = DicomMetadataStore.getStudy(id);
|
||||
return (
|
||||
study.series.findIndex(
|
||||
s => s.Modality === 'SM' || s.instances[0].Modality === 'SM'
|
||||
) >= 0
|
||||
study.series.findIndex(s => s.Modality === 'SM' || s.instances[0].Modality === 'SM') >= 0
|
||||
);
|
||||
});
|
||||
|
||||
@@ -118,31 +119,32 @@ function Local({ modePath }: LocalProps) {
|
||||
noClick
|
||||
>
|
||||
{({ getRootProps }) => (
|
||||
<div {...getRootProps()} style={{ width: '100%', height: '100%' }}>
|
||||
<div className="h-screen w-screen flex justify-center items-center ">
|
||||
<div className="py-8 px-8 mx-auto bg-secondary-dark drop-shadow-md space-y-2 rounded-lg">
|
||||
<div
|
||||
{...getRootProps()}
|
||||
style={{ width: '100%', height: '100%' }}
|
||||
>
|
||||
<div className="flex h-screen w-screen items-center justify-center ">
|
||||
<div className="bg-secondary-dark mx-auto space-y-2 rounded-lg py-8 px-8 drop-shadow-md">
|
||||
<img
|
||||
className="block mx-auto h-14"
|
||||
className="mx-auto block h-14"
|
||||
src="./ohif-logo.svg"
|
||||
alt="OHIF"
|
||||
/>
|
||||
<div className="text-center space-y-2 pt-4">
|
||||
<div className="space-y-2 pt-4 text-center">
|
||||
{dropInitiated ? (
|
||||
<div className="flex flex-col items-center justify-center pt-48">
|
||||
<LoadingIndicatorProgress
|
||||
className={'w-full h-full bg-black'}
|
||||
/>
|
||||
<LoadingIndicatorProgress className={'h-full w-full bg-black'} />
|
||||
</div>
|
||||
) : (
|
||||
<div className="space-y-2">
|
||||
<p className="text-blue-300 text-base">
|
||||
Note: You data is not uploaded to any server, it will stay
|
||||
in your local browser application
|
||||
<p className="text-base text-blue-300">
|
||||
Note: You data is not uploaded to any server, it will stay in your local
|
||||
browser application
|
||||
</p>
|
||||
<p className="text-xg text-primary-active font-semibold pt-6">
|
||||
<p className="text-xg text-primary-active pt-6 font-semibold">
|
||||
Drag and Drop DICOM files here to load them in the Viewer
|
||||
</p>
|
||||
<p className="text-blue-300 text-lg">Or click to </p>
|
||||
<p className="text-lg text-blue-300">Or click to </p>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -11,19 +11,14 @@ const DICOMFileLoader = new (class extends FileLoader {
|
||||
getDataset(image, imageId) {
|
||||
const dicomData = dcmjs.data.DicomMessage.readFile(image);
|
||||
|
||||
const dataset = dcmjs.data.DicomMetaDictionary.naturalizeDataset(
|
||||
dicomData.dict
|
||||
);
|
||||
const dataset = dcmjs.data.DicomMetaDictionary.naturalizeDataset(dicomData.dict);
|
||||
|
||||
dataset.url = imageId;
|
||||
|
||||
dataset._meta = dcmjs.data.DicomMetaDictionary.namifyDataset(
|
||||
dicomData.meta
|
||||
);
|
||||
dataset._meta = dcmjs.data.DicomMetaDictionary.namifyDataset(dicomData.meta);
|
||||
|
||||
dataset.AvailableTransferSyntaxUID =
|
||||
dataset.AvailableTransferSyntaxUID ||
|
||||
dataset._meta.TransferSyntaxUID?.Value?.[0];
|
||||
dataset.AvailableTransferSyntaxUID || dataset._meta.TransferSyntaxUID?.Value?.[0];
|
||||
|
||||
return dataset;
|
||||
}
|
||||
|
||||
@@ -10,11 +10,7 @@ const processFile = async file => {
|
||||
|
||||
DicomMetadataStore.addInstance(dicomJSONDataset);
|
||||
} catch (error) {
|
||||
console.log(
|
||||
error.name,
|
||||
':Error when trying to load and process local files:',
|
||||
error.message
|
||||
);
|
||||
console.log(error.name, ':Error when trying to load and process local files:', error.message);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -12,9 +12,7 @@ export default function Compose(props) {
|
||||
return (
|
||||
<React.Fragment>
|
||||
{components.reduceRight((acc, curr) => {
|
||||
const [Comp, props] = Array.isArray(curr)
|
||||
? [curr[0], curr[1]]
|
||||
: [curr, {}];
|
||||
const [Comp, props] = Array.isArray(curr) ? [curr[0], curr[1]] : [curr, {}];
|
||||
return <Comp {...props}>{acc}</Comp>;
|
||||
}, children)}
|
||||
</React.Fragment>
|
||||
|
||||
@@ -28,23 +28,15 @@ function defaultRouteInit(
|
||||
{ servicesManager, studyInstanceUIDs, dataSource, filters },
|
||||
hangingProtocolId
|
||||
) {
|
||||
const {
|
||||
displaySetService,
|
||||
hangingProtocolService,
|
||||
uiNotificationService,
|
||||
} = servicesManager.services;
|
||||
const { displaySetService, hangingProtocolService, uiNotificationService } =
|
||||
servicesManager.services;
|
||||
|
||||
const unsubscriptions = [];
|
||||
const issuedWarningSeries = [];
|
||||
const {
|
||||
unsubscribe: instanceAddedUnsubscribe,
|
||||
} = DicomMetadataStore.subscribe(
|
||||
const { unsubscribe: instanceAddedUnsubscribe } = DicomMetadataStore.subscribe(
|
||||
DicomMetadataStore.EVENTS.INSTANCES_ADDED,
|
||||
function({ StudyInstanceUID, SeriesInstanceUID, madeInClient = false }) {
|
||||
const seriesMetadata = DicomMetadataStore.getSeries(
|
||||
StudyInstanceUID,
|
||||
SeriesInstanceUID
|
||||
);
|
||||
function ({ StudyInstanceUID, SeriesInstanceUID, madeInClient = false }) {
|
||||
const seriesMetadata = DicomMetadataStore.getSeries(StudyInstanceUID, SeriesInstanceUID);
|
||||
|
||||
// checks if the series filter was used, if it exists
|
||||
const seriesInstanceUIDs = filters?.seriesInstanceUID;
|
||||
@@ -96,10 +88,7 @@ function defaultRouteInit(
|
||||
|
||||
// run the hanging protocol matching on the displaySets with the predefined
|
||||
// hanging protocol in the mode configuration
|
||||
hangingProtocolService.run(
|
||||
{ studies, activeStudy, displaySets },
|
||||
hangingProtocolId
|
||||
);
|
||||
hangingProtocolService.run({ studies, activeStudy, displaySets }, hangingProtocolId);
|
||||
});
|
||||
|
||||
return unsubscriptions;
|
||||
@@ -128,10 +117,7 @@ export default function ModeRoute({
|
||||
const [studyInstanceUIDs, setStudyInstanceUIDs] = useState();
|
||||
|
||||
const [refresh, setRefresh] = useState(false);
|
||||
const [
|
||||
ExtensionDependenciesLoaded,
|
||||
setExtensionDependenciesLoaded,
|
||||
] = useState(false);
|
||||
const [ExtensionDependenciesLoaded, setExtensionDependenciesLoaded] = useState(false);
|
||||
|
||||
const layoutTemplateData = useRef(false);
|
||||
const locationRef = useRef(null);
|
||||
@@ -145,22 +131,13 @@ export default function ModeRoute({
|
||||
locationRef.current = location;
|
||||
}
|
||||
|
||||
const {
|
||||
displaySetService,
|
||||
hangingProtocolService,
|
||||
userAuthenticationService,
|
||||
} = (servicesManager as ServicesManager).services;
|
||||
const { displaySetService, hangingProtocolService, userAuthenticationService } = (
|
||||
servicesManager as ServicesManager
|
||||
).services;
|
||||
|
||||
const {
|
||||
extensions,
|
||||
sopClassHandlers,
|
||||
hotkeys: hotkeyObj,
|
||||
hangingProtocol,
|
||||
} = mode;
|
||||
const { extensions, sopClassHandlers, hotkeys: hotkeyObj, hangingProtocol } = mode;
|
||||
|
||||
const runTimeHangingProtocolId = lowerCaseSearchParams.get(
|
||||
'hangingprotocolid'
|
||||
);
|
||||
const runTimeHangingProtocolId = lowerCaseSearchParams.get('hangingprotocolid');
|
||||
const token = lowerCaseSearchParams.get('token');
|
||||
|
||||
if (token) {
|
||||
@@ -173,9 +150,7 @@ export default function ModeRoute({
|
||||
});
|
||||
|
||||
// Create a URL object with the current location
|
||||
const urlObj = new URL(
|
||||
window.location.origin + location.pathname + location.search
|
||||
);
|
||||
const urlObj = new URL(window.location.origin + location.pathname + location.search);
|
||||
|
||||
// Remove the token from the URL object
|
||||
urlObj.searchParams.delete('token');
|
||||
@@ -232,9 +207,7 @@ export default function ModeRoute({
|
||||
const loadedExtensions = await loadModules(Object.keys(extensions));
|
||||
for (const extension of loadedExtensions) {
|
||||
const { id: extensionId } = extension;
|
||||
if (
|
||||
extensionManager.registeredExtensionIds.indexOf(extensionId) === -1
|
||||
) {
|
||||
if (extensionManager.registeredExtensionIds.indexOf(extensionId) === -1) {
|
||||
await extensionManager.registerExtension(extension);
|
||||
}
|
||||
}
|
||||
@@ -369,24 +342,21 @@ export default function ModeRoute({
|
||||
* }
|
||||
*/
|
||||
const filters =
|
||||
Array.from(query.keys()).reduce(
|
||||
(acc: Record<string, string>, val: string) => {
|
||||
const lowerVal = val.toLowerCase();
|
||||
if (lowerVal !== 'studyinstanceuids') {
|
||||
// Not sure why the case matters here - it doesn't in the URL
|
||||
if (lowerVal === 'seriesinstanceuid') {
|
||||
const seriesUIDs = getSplitParam(lowerVal, query);
|
||||
return {
|
||||
...acc,
|
||||
seriesInstanceUID: seriesUIDs,
|
||||
};
|
||||
}
|
||||
|
||||
return { ...acc, [val]: getSplitParam(lowerVal, query) };
|
||||
Array.from(query.keys()).reduce((acc: Record<string, string>, val: string) => {
|
||||
const lowerVal = val.toLowerCase();
|
||||
if (lowerVal !== 'studyinstanceuids') {
|
||||
// Not sure why the case matters here - it doesn't in the URL
|
||||
if (lowerVal === 'seriesinstanceuid') {
|
||||
const seriesUIDs = getSplitParam(lowerVal, query);
|
||||
return {
|
||||
...acc,
|
||||
seriesInstanceUID: seriesUIDs,
|
||||
};
|
||||
}
|
||||
},
|
||||
{}
|
||||
) ?? {};
|
||||
|
||||
return { ...acc, [val]: getSplitParam(lowerVal, query) };
|
||||
}
|
||||
}, {}) ?? {};
|
||||
|
||||
if (route.init) {
|
||||
return await route.init(
|
||||
|
||||
@@ -39,11 +39,7 @@ const getStudiesfromDisplaySets = (displaysets): StudyMetadata[] => {
|
||||
}, []);
|
||||
// Return the sorted studies, first on study date and second on study instance UID
|
||||
ret.sort((a, b) => {
|
||||
return compare(
|
||||
a.StudyDate,
|
||||
b.StudyDate,
|
||||
compare(a.StudyInstanceUID, b.StudyInstanceUID)
|
||||
);
|
||||
return compare(a.StudyDate, b.StudyDate, compare(a.StudyInstanceUID, b.StudyInstanceUID));
|
||||
});
|
||||
return ret;
|
||||
};
|
||||
@@ -61,9 +57,7 @@ const getStudiesFromUIDs = (studyUids: string[]): StudyMetadata[] => {
|
||||
|
||||
/** Gets the array of studies */
|
||||
const getStudies = (studyUids?: string[], displaySets): StudyMetadata[] => {
|
||||
return (
|
||||
getStudiesFromUIDs(studyUids) || getStudiesfromDisplaySets(displaySets)
|
||||
);
|
||||
return getStudiesFromUIDs(studyUids) || getStudiesfromDisplaySets(displaySets);
|
||||
};
|
||||
|
||||
export default getStudies;
|
||||
|
||||
@@ -4,15 +4,12 @@ import { Link } from 'react-router-dom';
|
||||
|
||||
import { useAppConfig } from '@state';
|
||||
|
||||
const NotFound = ({
|
||||
message = 'Sorry, this page does not exist.',
|
||||
showGoBackButton = true,
|
||||
}) => {
|
||||
const NotFound = ({ message = 'Sorry, this page does not exist.', showGoBackButton = true }) => {
|
||||
const [appConfig] = useAppConfig();
|
||||
const { showStudyList } = appConfig;
|
||||
|
||||
return (
|
||||
<div className="w-full h-full flex justify-center items-center text-white">
|
||||
<div className="flex h-full w-full items-center justify-center text-white">
|
||||
<div>
|
||||
<h4>{message}</h4>
|
||||
{showGoBackButton && showStudyList && (
|
||||
|
||||
@@ -6,9 +6,7 @@ function SignoutCallbackComponent({ userManager }) {
|
||||
const navigate = useNavigate();
|
||||
|
||||
const onRedirectSuccess = (/* user */) => {
|
||||
const { pathname, search = '' } = JSON.parse(
|
||||
sessionStorage.getItem('ohif-redirect-to')
|
||||
);
|
||||
const { pathname, search = '' } = JSON.parse(sessionStorage.getItem('ohif-redirect-to'));
|
||||
|
||||
navigate(`${pathname}?${search}`);
|
||||
};
|
||||
|
||||
@@ -77,9 +77,7 @@ function WorkList({
|
||||
const shouldUseDefaultSort = sortBy === '' || !sortBy;
|
||||
const sortModifier = sortDirection === 'descending' ? 1 : -1;
|
||||
const defaultSortValues =
|
||||
shouldUseDefaultSort && canSort
|
||||
? { sortBy: 'studyDate', sortDirection: 'ascending' }
|
||||
: {};
|
||||
shouldUseDefaultSort && canSort ? { sortBy: 'studyDate', sortDirection: 'ascending' } : {};
|
||||
const sortedStudies = studies;
|
||||
|
||||
if (canSort) {
|
||||
@@ -129,8 +127,7 @@ function WorkList({
|
||||
const rollingPageNumberMod = Math.floor(101 / filterValues.resultsPerPage);
|
||||
const rollingPageNumber = oldPageNumber % rollingPageNumberMod;
|
||||
const isNextPage = newPageNumber > oldPageNumber;
|
||||
const hasNextPage =
|
||||
Math.max(rollingPageNumber, 1) * resultsPerPage < numOfStudies;
|
||||
const hasNextPage = Math.max(rollingPageNumber, 1) * resultsPerPage < numOfStudies;
|
||||
|
||||
if (isNextPage && !hasNextPage) {
|
||||
return;
|
||||
@@ -168,10 +165,7 @@ function WorkList({
|
||||
|
||||
// TODO: nesting/recursion?
|
||||
if (key === 'studyDate') {
|
||||
if (
|
||||
currValue.startDate &&
|
||||
defaultValue.startDate !== currValue.startDate
|
||||
) {
|
||||
if (currValue.startDate && defaultValue.startDate !== currValue.startDate) {
|
||||
queryString.startDate = currValue.startDate;
|
||||
}
|
||||
if (currValue.endDate && defaultValue.endDate !== currValue.endDate) {
|
||||
@@ -305,7 +299,7 @@ function WorkList({
|
||||
<>
|
||||
<Icon
|
||||
name="group-layers"
|
||||
className={classnames('inline-flex mr-2 w-4', {
|
||||
className={classnames('mr-2 inline-flex w-4', {
|
||||
'text-primary-active': isExpanded,
|
||||
'text-secondary-light': !isExpanded,
|
||||
})}
|
||||
@@ -366,9 +360,9 @@ function WorkList({
|
||||
<Link
|
||||
className={isValidMode ? '' : 'cursor-not-allowed'}
|
||||
key={i}
|
||||
to={`${dataPath ? '../../' : ''}${
|
||||
mode.routeName
|
||||
}${dataPath || ''}?${query.toString()}`}
|
||||
to={`${dataPath ? '../../' : ''}${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.
|
||||
@@ -396,9 +390,7 @@ function WorkList({
|
||||
</StudyListExpandedRow>
|
||||
),
|
||||
onClickRow: () =>
|
||||
setExpandedRows(s =>
|
||||
isExpanded ? s.filter(n => rowKey !== n) : [...s, rowKey]
|
||||
),
|
||||
setExpandedRows(s => (isExpanded ? s.filter(n => rowKey !== n) : [...s, rowKey])),
|
||||
isExpanded,
|
||||
};
|
||||
});
|
||||
@@ -426,9 +418,7 @@ function WorkList({
|
||||
title: t('UserPreferencesModal:User Preferences'),
|
||||
content: UserPreferences,
|
||||
contentProps: {
|
||||
hotkeyDefaults: hotkeysManager.getValidHotkeyDefinitions(
|
||||
hotkeyDefaults
|
||||
),
|
||||
hotkeyDefaults: hotkeysManager.getValidHotkeyDefinitions(hotkeyDefaults),
|
||||
hotkeyDefinitions,
|
||||
onCancel: hide,
|
||||
currentLanguage: currentLanguage(),
|
||||
@@ -451,9 +441,7 @@ function WorkList({
|
||||
icon: 'power-off',
|
||||
title: t('Header:Logout'),
|
||||
onClick: () => {
|
||||
navigate(
|
||||
`/logout?redirect_uri=${encodeURIComponent(window.location.href)}`
|
||||
);
|
||||
navigate(`/logout?redirect_uri=${encodeURIComponent(window.location.href)}`);
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -489,14 +477,14 @@ function WorkList({
|
||||
customizationService.get('ohif.dataSourceConfigurationComponent') ?? {};
|
||||
|
||||
return (
|
||||
<div className="bg-black h-screen flex flex-col ">
|
||||
<div className="flex h-screen flex-col bg-black ">
|
||||
<Header
|
||||
isSticky
|
||||
menuOptions={menuOptions}
|
||||
isReturnEnabled={false}
|
||||
WhiteLabeling={appConfig.whiteLabeling}
|
||||
/>
|
||||
<div className="overflow-y-auto ohif-scrollbar flex flex-col grow">
|
||||
<div className="ohif-scrollbar flex grow flex-col overflow-y-auto">
|
||||
<StudyListFilter
|
||||
numOfStudies={pageNumber * resultsPerPage > 100 ? 101 : numOfStudies}
|
||||
filtersMeta={filtersMeta}
|
||||
@@ -506,13 +494,11 @@ function WorkList({
|
||||
isFiltering={isFiltering(filterValues, defaultFilterValues)}
|
||||
onUploadClick={uploadProps ? () => show(uploadProps) : undefined}
|
||||
getDataSourceConfigurationComponent={
|
||||
dataSourceConfigurationComponent
|
||||
? () => dataSourceConfigurationComponent()
|
||||
: undefined
|
||||
dataSourceConfigurationComponent ? () => dataSourceConfigurationComponent() : undefined
|
||||
}
|
||||
/>
|
||||
{hasStudies ? (
|
||||
<div className="grow flex flex-col">
|
||||
<div className="flex grow flex-col">
|
||||
<StudyListTable
|
||||
tableDataSource={tableDataSource.slice(offset, offsetAndTake)}
|
||||
numOfStudies={numOfStudies}
|
||||
@@ -531,7 +517,7 @@ function WorkList({
|
||||
) : (
|
||||
<div className="flex flex-col items-center justify-center pt-48">
|
||||
{appConfig.showLoadingIndicator && isLoadingData ? (
|
||||
<LoadingIndicatorProgress className={'w-full h-full bg-black'} />
|
||||
<LoadingIndicatorProgress className={'h-full w-full bg-black'} />
|
||||
) : (
|
||||
<EmptyStudies />
|
||||
)}
|
||||
@@ -589,9 +575,7 @@ function _getQueryFilterValues(params) {
|
||||
endDate: params.get('enddate') || null,
|
||||
},
|
||||
description: params.get('description'),
|
||||
modalities: params.get('modalities')
|
||||
? params.get('modalities').split(',')
|
||||
: [],
|
||||
modalities: params.get('modalities') ? params.get('modalities').split(',') : [],
|
||||
accession: params.get('accession'),
|
||||
sortBy: params.get('sortby'),
|
||||
sortDirection: params.get('sortdirection'),
|
||||
@@ -615,9 +599,7 @@ function _sortStringDates(s1, s2, sortModifier) {
|
||||
const s2Date = moment(s2.date, ['YYYYMMDD', 'YYYY.MM.DD'], true);
|
||||
|
||||
if (s1Date.isValid() && s2Date.isValid()) {
|
||||
return (
|
||||
(s1Date.toISOString() > s2Date.toISOString() ? 1 : -1) * sortModifier
|
||||
);
|
||||
return (s1Date.toISOString() > s2Date.toISOString() ? 1 : -1) * sortModifier;
|
||||
} else if (s1Date.isValid()) {
|
||||
return sortModifier;
|
||||
} else if (s2Date.isValid()) {
|
||||
|
||||
@@ -17,7 +17,7 @@ const NotFoundServer = ({
|
||||
message = 'Unable to query for studies at this time. Check your data source configuration or network connection',
|
||||
}) => {
|
||||
return (
|
||||
<div className="absolute w-full h-full flex justify-center items-center text-white">
|
||||
<div className="absolute flex h-full w-full items-center justify-center text-white">
|
||||
<div>
|
||||
<h4>{message}</h4>
|
||||
</div>
|
||||
@@ -31,12 +31,14 @@ NotFoundServer.propTypes = {
|
||||
|
||||
const NotFoundStudy = () => {
|
||||
return (
|
||||
<div className="absolute w-full h-full flex justify-center items-center text-white">
|
||||
<div className="absolute flex h-full w-full items-center justify-center text-white">
|
||||
<div>
|
||||
<h4>
|
||||
One or more of the requested studies are not available at this time.
|
||||
Return to the{' '}
|
||||
<Link className="text-primary-light" to={'/'}>
|
||||
One or more of the requested studies are not available at this time. Return to the{' '}
|
||||
<Link
|
||||
className="text-primary-light"
|
||||
to={'/'}
|
||||
>
|
||||
study list
|
||||
</Link>{' '}
|
||||
to select a different study to view.
|
||||
@@ -106,9 +108,7 @@ const createRoutes = ({
|
||||
props: { children: WorkList, servicesManager, extensionManager },
|
||||
};
|
||||
|
||||
const customRoutes = customizationService.getGlobalCustomization(
|
||||
'customRoutes'
|
||||
);
|
||||
const customRoutes = customizationService.getGlobalCustomization('customRoutes');
|
||||
const allRoutes = [
|
||||
...routes,
|
||||
...(showStudyList ? [WorkListRoute] : []),
|
||||
@@ -120,7 +120,10 @@ const createRoutes = ({
|
||||
function RouteWithErrorBoundary({ route, ...rest }) {
|
||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||
return (
|
||||
<ErrorBoundary context={`Route ${route.path}`} fallbackRoute="/">
|
||||
<ErrorBoundary
|
||||
context={`Route ${route.path}`}
|
||||
fallbackRoute="/"
|
||||
>
|
||||
<route.children
|
||||
{...rest}
|
||||
{...route.props}
|
||||
@@ -146,11 +149,7 @@ const createRoutes = ({
|
||||
exact
|
||||
path={route.path}
|
||||
element={
|
||||
<PrivateRoute
|
||||
handleUnauthenticated={
|
||||
userAuthenticationService.handleUnauthenticated
|
||||
}
|
||||
>
|
||||
<PrivateRoute handleUnauthenticated={userAuthenticationService.handleUnauthenticated}>
|
||||
<RouteWithErrorBoundary route={route} />
|
||||
</PrivateRoute>
|
||||
}
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
navigator.serviceWorker.getRegistrations().then(function(registrations) {
|
||||
navigator.serviceWorker.getRegistrations().then(function (registrations) {
|
||||
for (let registration of registrations) {
|
||||
registration.unregister();
|
||||
}
|
||||
});
|
||||
|
||||
// https://developers.google.com/web/tools/workbox/guides/troubleshoot-and-debug
|
||||
importScripts(
|
||||
'https://storage.googleapis.com/workbox-cdn/releases/5.0.0-beta.1/workbox-sw.js'
|
||||
);
|
||||
importScripts('https://storage.googleapis.com/workbox-cdn/releases/5.0.0-beta.1/workbox-sw.js');
|
||||
|
||||
// Install newest
|
||||
// https://developers.google.com/web/tools/workbox/modules/workbox-core
|
||||
|
||||
@@ -34,18 +34,13 @@ const initUserManager = (oidc, routerBasename) => {
|
||||
const baseUri = `${protocol}//${host}${routerBasename}`;
|
||||
|
||||
const redirect_uri = firstOpenIdClient.redirect_uri || '/callback';
|
||||
const silent_redirect_uri =
|
||||
firstOpenIdClient.silent_redirect_uri || '/silent-refresh.html';
|
||||
const post_logout_redirect_uri =
|
||||
firstOpenIdClient.post_logout_redirect_uri || '/';
|
||||
const silent_redirect_uri = firstOpenIdClient.silent_redirect_uri || '/silent-refresh.html';
|
||||
const post_logout_redirect_uri = firstOpenIdClient.post_logout_redirect_uri || '/';
|
||||
|
||||
const openIdConnectConfiguration = Object.assign({}, firstOpenIdClient, {
|
||||
redirect_uri: _makeAbsoluteIfNecessary(redirect_uri, baseUri),
|
||||
silent_redirect_uri: _makeAbsoluteIfNecessary(silent_redirect_uri, baseUri),
|
||||
post_logout_redirect_uri: _makeAbsoluteIfNecessary(
|
||||
post_logout_redirect_uri,
|
||||
baseUri
|
||||
),
|
||||
post_logout_redirect_uri: _makeAbsoluteIfNecessary(post_logout_redirect_uri, baseUri),
|
||||
});
|
||||
|
||||
return getUserManagerForOpenIdConnectClient(openIdConnectConfiguration);
|
||||
@@ -77,18 +72,12 @@ function LoginComponent(userManager) {
|
||||
const ohifRedirectTo = {
|
||||
pathname: new URL(targetLinkUri).pathname,
|
||||
};
|
||||
sessionStorage.setItem(
|
||||
'ohif-redirect-to',
|
||||
JSON.stringify(ohifRedirectTo)
|
||||
);
|
||||
sessionStorage.setItem('ohif-redirect-to', JSON.stringify(ohifRedirectTo));
|
||||
} else {
|
||||
const ohifRedirectTo = {
|
||||
pathname: '/',
|
||||
};
|
||||
sessionStorage.setItem(
|
||||
'ohif-redirect-to',
|
||||
JSON.stringify(ohifRedirectTo)
|
||||
);
|
||||
sessionStorage.setItem('ohif-redirect-to', JSON.stringify(ohifRedirectTo));
|
||||
}
|
||||
|
||||
if (loginHint !== null) {
|
||||
@@ -101,11 +90,7 @@ function LoginComponent(userManager) {
|
||||
return null;
|
||||
}
|
||||
|
||||
function OpenIdConnectRoutes({
|
||||
oidc,
|
||||
routerBasename,
|
||||
userAuthenticationService,
|
||||
}) {
|
||||
function OpenIdConnectRoutes({ oidc, routerBasename, userAuthenticationService }) {
|
||||
const userManager = initUserManager(oidc, routerBasename);
|
||||
|
||||
const getAuthorizationHeader = () => {
|
||||
@@ -137,9 +122,7 @@ function OpenIdConnectRoutes({
|
||||
const storageEventListener = event => {
|
||||
const signOutEvent = localStorage.getItem('signoutEvent');
|
||||
if (signOutEvent) {
|
||||
navigate(
|
||||
`/logout?redirect_uri=${encodeURIComponent(window.location.href)}`
|
||||
);
|
||||
navigate(`/logout?redirect_uri=${encodeURIComponent(window.location.href)}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -165,24 +148,21 @@ function OpenIdConnectRoutes({
|
||||
const { pathname, search } = location;
|
||||
|
||||
const redirect_uri = new URL(userManager.settings._redirect_uri).pathname; //.replace(routerBasename,'')
|
||||
const silent_refresh_uri = new URL(userManager.settings._silent_redirect_uri)
|
||||
.pathname; //.replace(routerBasename,'')
|
||||
const post_logout_redirect_uri = new URL(
|
||||
userManager.settings._post_logout_redirect_uri
|
||||
).pathname; //.replace(routerBasename,'');
|
||||
const silent_refresh_uri = new URL(userManager.settings._silent_redirect_uri).pathname; //.replace(routerBasename,'')
|
||||
const post_logout_redirect_uri = new URL(userManager.settings._post_logout_redirect_uri).pathname; //.replace(routerBasename,'');
|
||||
|
||||
// const pathnameRelative = pathname.replace(routerBasename,'');
|
||||
|
||||
if (pathname !== redirect_uri) {
|
||||
sessionStorage.setItem(
|
||||
'ohif-redirect-to',
|
||||
JSON.stringify({ pathname, search })
|
||||
);
|
||||
sessionStorage.setItem('ohif-redirect-to', JSON.stringify({ pathname, search }));
|
||||
}
|
||||
|
||||
return (
|
||||
<Routes basename={routerBasename}>
|
||||
<Route path={silent_refresh_uri} onEnter={window.location.reload} />
|
||||
<Route
|
||||
path={silent_refresh_uri}
|
||||
onEnter={window.location.reload}
|
||||
/>
|
||||
<Route
|
||||
path={post_logout_redirect_uri}
|
||||
element={
|
||||
|
||||
Reference in new issue
Block a user