fix(SM): drag and drop is now fixed for SM (#3813)

This commit is contained in:
Alireza authored and GitHub committed 2023-11-28 13:04:30 -05:00
1 parent 4f9a00f872
commit f1a67647ae
5 files changed
+26 -10

No files matched your search

@@ -1,5 +1,6 @@
import React, { useEffect, useState } from 'react';
import PropTypes from 'prop-types';
import { useTranslation } from 'react-i18next';
import { utils, ServicesManager } from '@ohif/core';
import { MeasurementTable, Dialog, Input, useViewportGrid, ButtonEnums } from '@ohif/ui';
import ActionButtons from './ActionButtons';
@@ -18,6 +19,8 @@ export default function PanelMeasurementTable({
commandsManager,
extensionManager,
}): React.FunctionComponent {
const { t } = useTranslation('MeasurementTable');
const [viewportGrid, viewportGridService] = useViewportGrid();
const { activeViewportId, viewports } = viewportGrid;
const { measurementService, uiDialogService, uiNotificationService, displaySetService } = (
@@ -209,7 +212,7 @@ export default function PanelMeasurementTable({
data-cy={'measurements-panel'}
>
<MeasurementTable
title="Measurements"
title={t("Measurements")}
servicesManager={servicesManager}
data={displayMeasurements}
onClick={jumpToImage}
+10 -1
View File
@@ -1,5 +1,5 @@
import { id } from './id';
import React, { Suspense } from 'react';
import React, { Suspense, useMemo } from 'react';
import getPanelModule from './getPanelModule';
import getCommandsModule from './getCommandsModule';
@@ -58,8 +58,17 @@ export default {
const [viewportGrid, viewportGridService] = useViewportGrid();
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 (
<MicroscopyViewport
key={displaySetsKey}
servicesManager={servicesManager}
extensionManager={extensionManager}
commandsManager={commandsManager}