fix: remove duplicated deleteMeasurements code (#4895)

This commit is contained in:
Pedro Köhler 2025-03-26 14:58:15 -03:00 committed by GitHub
parent 7f8fa1e1f4
commit 9bde644fce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 6 additions and 17 deletions

View File

@ -4,10 +4,7 @@ import {
VolumeViewport,
utilities as csUtils,
Types as CoreTypes,
cache,
BaseVolumeViewport,
triggerEvent,
eventTarget,
} from '@cornerstonejs/core';
import {
ToolGroupManager,
@ -78,13 +75,10 @@ function commandsModule({
colorbarService,
hangingProtocolService,
syncGroupService,
toolbarService,
segmentationService,
displaySetService,
} = servicesManager.services as AppTypes.Services;
const { measurementServiceSource } = this;
function _getActiveViewportEnabledElement() {
return getActiveViewportEnabledElement(viewportGridService);
}
@ -286,12 +280,6 @@ function commandsModule({
? nearbyToolData
: null;
},
/** Delete the given measurement */
deleteMeasurement: ({ uid }) => {
if (uid) {
measurementServiceSource.remove(uid);
}
},
/**
* Common logic for handling measurement label updates through dialog
* @param uid - measurement uid
@ -1575,9 +1563,6 @@ function commandsModule({
toggleViewportColorbar: {
commandFn: actions.toggleViewportColorbar,
},
deleteMeasurement: {
commandFn: actions.deleteMeasurement,
},
setMeasurementLabel: {
commandFn: actions.setMeasurementLabel,
},

View File

@ -9,7 +9,7 @@ export default {
items: [
{
label: 'Delete measurement',
commands: 'deleteMeasurement',
commands: 'removeMeasurement',
},
{
label: 'Add Label',

View File

@ -22,7 +22,7 @@ export default {
label: 'Delete Measurement',
commands: [
{
commandName: 'deleteMeasurement',
commandName: 'removeMeasurement',
},
],
},

View File

@ -34,3 +34,7 @@ After:
yarn install
yarn run dev
```
## CommandsModule
1. Removed the `deleteMeasurements` command from the `CORNERSTONE` context. It should be replaced by `removeMeasurements` command.