fix(SM): drag and drop is now fixed for SM (#3813)
This commit is contained in:
parent
4f9a00f872
commit
f1a67647ae
@ -1,5 +1,6 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
import { utils, ServicesManager } from '@ohif/core';
|
import { utils, ServicesManager } from '@ohif/core';
|
||||||
import { MeasurementTable, Dialog, Input, useViewportGrid, ButtonEnums } from '@ohif/ui';
|
import { MeasurementTable, Dialog, Input, useViewportGrid, ButtonEnums } from '@ohif/ui';
|
||||||
import ActionButtons from './ActionButtons';
|
import ActionButtons from './ActionButtons';
|
||||||
@ -18,6 +19,8 @@ export default function PanelMeasurementTable({
|
|||||||
commandsManager,
|
commandsManager,
|
||||||
extensionManager,
|
extensionManager,
|
||||||
}): React.FunctionComponent {
|
}): React.FunctionComponent {
|
||||||
|
const { t } = useTranslation('MeasurementTable');
|
||||||
|
|
||||||
const [viewportGrid, viewportGridService] = useViewportGrid();
|
const [viewportGrid, viewportGridService] = useViewportGrid();
|
||||||
const { activeViewportId, viewports } = viewportGrid;
|
const { activeViewportId, viewports } = viewportGrid;
|
||||||
const { measurementService, uiDialogService, uiNotificationService, displaySetService } = (
|
const { measurementService, uiDialogService, uiNotificationService, displaySetService } = (
|
||||||
@ -209,7 +212,7 @@ export default function PanelMeasurementTable({
|
|||||||
data-cy={'measurements-panel'}
|
data-cy={'measurements-panel'}
|
||||||
>
|
>
|
||||||
<MeasurementTable
|
<MeasurementTable
|
||||||
title="Measurements"
|
title={t("Measurements")}
|
||||||
servicesManager={servicesManager}
|
servicesManager={servicesManager}
|
||||||
data={displayMeasurements}
|
data={displayMeasurements}
|
||||||
onClick={jumpToImage}
|
onClick={jumpToImage}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { id } from './id';
|
import { id } from './id';
|
||||||
import React, { Suspense } from 'react';
|
import React, { Suspense, useMemo } from 'react';
|
||||||
import getPanelModule from './getPanelModule';
|
import getPanelModule from './getPanelModule';
|
||||||
import getCommandsModule from './getCommandsModule';
|
import getCommandsModule from './getCommandsModule';
|
||||||
|
|
||||||
@ -58,8 +58,17 @@ export default {
|
|||||||
const [viewportGrid, viewportGridService] = useViewportGrid();
|
const [viewportGrid, viewportGridService] = useViewportGrid();
|
||||||
const { activeViewportId } = viewportGrid;
|
const { activeViewportId } = viewportGrid;
|
||||||
|
|
||||||
|
// a unique identifier based on the contents of displaySets.
|
||||||
|
// since we changed our rendering pipeline and if there is no
|
||||||
|
// element size change nor viewportId change we won't re-render
|
||||||
|
// we need a way to force re-rendering when displaySets change.
|
||||||
|
const displaySetsKey = useMemo(() => {
|
||||||
|
return props.displaySets.map(ds => ds.displaySetInstanceUID).join('-');
|
||||||
|
}, [props.displaySets]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<MicroscopyViewport
|
<MicroscopyViewport
|
||||||
|
key={displaySetsKey}
|
||||||
servicesManager={servicesManager}
|
servicesManager={servicesManager}
|
||||||
extensionManager={extensionManager}
|
extensionManager={extensionManager}
|
||||||
commandsManager={commandsManager}
|
commandsManager={commandsManager}
|
||||||
|
|||||||
@ -124,8 +124,11 @@ function modeFactory({ modeConfiguration }) {
|
|||||||
* segmentations and we should exclude them
|
* segmentations and we should exclude them
|
||||||
*/
|
*/
|
||||||
isValidMode: ({ modalities }) => {
|
isValidMode: ({ modalities }) => {
|
||||||
if (modalities.length === 1) {
|
// Don't show the mode if the selected studies have only one modality
|
||||||
return !['SM', 'US', 'MG', 'OT', 'DOC', 'CR'].includes(modalities[0]);
|
// that is not supported by the mode
|
||||||
|
const modalitiesArray = modalities.split('\\');
|
||||||
|
if (modalitiesArray.length === 1) {
|
||||||
|
return !['SM', 'US', 'MG', 'OT', 'DOC', 'CR'].includes(modalitiesArray[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@ -5,5 +5,6 @@
|
|||||||
"MAX": "MAX",
|
"MAX": "MAX",
|
||||||
"NonTargets": "NonTargets",
|
"NonTargets": "NonTargets",
|
||||||
"Relabel": "Relabel",
|
"Relabel": "Relabel",
|
||||||
"Targets": "Targets"
|
"Targets": "Targets",
|
||||||
|
"Measurements": "Measurements"
|
||||||
}
|
}
|
||||||
|
|||||||
10
yarn.lock
10
yarn.lock
@ -14227,10 +14227,10 @@ media-typer@0.3.0:
|
|||||||
resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748"
|
resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748"
|
||||||
integrity sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==
|
integrity sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==
|
||||||
|
|
||||||
medium-zoom@^1.0.4:
|
medium-zoom@^1.0.8:
|
||||||
version "1.0.8"
|
version "1.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/medium-zoom/-/medium-zoom-1.0.8.tgz#2bd1fbcf2961fa7b0e318fe284462aa9b8608ed2"
|
resolved "https://registry.yarnpkg.com/medium-zoom/-/medium-zoom-1.1.0.tgz#6efb6bbda861a02064ee71a2617a8dc4381ecc71"
|
||||||
integrity sha512-CjFVuFq/IfrdqesAXfg+hzlDKu6A2n80ZIq0Kl9kWjoHh9j1N9Uvk5X0/MmN0hOfm5F9YBswlClhcwnmtwz7gA==
|
integrity sha512-ewyDsp7k4InCUp3jRmwHBRFGyjBimKps/AJLjRSox+2q/2H4p/PNpQf+pwONWlJiOudkBXtbdmVbFjqyybfTmQ==
|
||||||
|
|
||||||
memfs@^3.1.2, memfs@^3.4.1, memfs@^3.4.12, memfs@^3.4.3:
|
memfs@^3.1.2, memfs@^3.4.1, memfs@^3.4.12, memfs@^3.4.3:
|
||||||
version "3.6.0"
|
version "3.6.0"
|
||||||
@ -16166,7 +16166,7 @@ plugin-image-zoom@ataft/plugin-image-zoom:
|
|||||||
version "1.1.0"
|
version "1.1.0"
|
||||||
resolved "https://codeload.github.com/ataft/plugin-image-zoom/tar.gz/3e64669f3c8fb998a556432ca3f56e0f617454f2"
|
resolved "https://codeload.github.com/ataft/plugin-image-zoom/tar.gz/3e64669f3c8fb998a556432ca3f56e0f617454f2"
|
||||||
dependencies:
|
dependencies:
|
||||||
medium-zoom "^1.0.8"
|
medium-zoom "^1.0.4"
|
||||||
|
|
||||||
polished@^4.2.2:
|
polished@^4.2.2:
|
||||||
version "4.2.2"
|
version "4.2.2"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user