[OHIF-193 + OHIF-313] (#1955)
* create context menu * OHIF-193: Add context menu integration with measurement service * OHIF-193: Update comments * OHIF-CR Update: Add requested updates * CR Update: Update measurement service remove function * CR Update: Update casing * CR Updates * Update cornerstone measurments when the label is edited in the measurement service. * Implement click outside behavior * Address reviewer comments. Co-authored-by: Rodrigo Antinarelli <rodrigoantinarelli@gmail.com> Co-authored-by: igoroctaviano <igoroctaviano@gmail.com>
This commit is contained in:
20 files changed
+575
-196
No files matched your search
@@ -0,0 +1,44 @@
|
||||
import { ContextMenu } from '@ohif/ui';
|
||||
import PropTypes from 'prop-types';
|
||||
import React from 'react';
|
||||
|
||||
const ContextMenuMeasurements = ({
|
||||
onGetMenuItems,
|
||||
onSetLabel,
|
||||
onClose,
|
||||
onDelete,
|
||||
}) => {
|
||||
const defaultMenuItems = [
|
||||
{
|
||||
label: 'Delete measurement',
|
||||
actionType: 'Delete',
|
||||
action: item => {
|
||||
onDelete(item);
|
||||
onClose();
|
||||
},
|
||||
value: {},
|
||||
},
|
||||
{
|
||||
label: 'Add Label',
|
||||
actionType: 'setLabel',
|
||||
action: item => {
|
||||
onSetLabel(item);
|
||||
onClose();
|
||||
},
|
||||
value: {},
|
||||
},
|
||||
];
|
||||
|
||||
const menuItems = onGetMenuItems(defaultMenuItems);
|
||||
|
||||
return <ContextMenu items={menuItems} />;
|
||||
};
|
||||
|
||||
ContextMenuMeasurements.propTypes = {
|
||||
onClose: PropTypes.func.isRequired,
|
||||
onSetLabel: PropTypes.func.isRequired,
|
||||
onDelete: PropTypes.func.isRequired,
|
||||
onGetMenuItems: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
export default ContextMenuMeasurements;
|
||||
@@ -0,0 +1 @@
|
||||
export { default } from './ContextMenuMeasurements';
|
||||
Reference in new issue
Block a user