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
@@ -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>
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user