fix(store-segmentation): storing segmentations was hitting the wrong command resulting in an undefined datasource (#4755)

[OHI-1445]
This commit is contained in:
Ibrahim authored and GitHub committed 2025-02-03 09:28:58 -05:00
1 parent 613401e043
commit 9b8e5cfd1a
3 files changed
+33 -5

No files matched your search

@@ -12,7 +12,12 @@ import {
* The default sub-menu appearance and setup is defined here, but this can be
* replaced by
*/
const getMenuItemsDefault = ({ commandsManager, items, servicesManager, ...props }) => {
const getMenuItemsDefault = ({
commandsManager,
items,
servicesManager,
...props
}: withAppTypes) => {
const { customizationService } = servicesManager.services;
// This allows replacing the default child item for menus, whereas the entire
@@ -20,8 +25,23 @@ const getMenuItemsDefault = ({ commandsManager, items, servicesManager, ...props
const menuContent = customizationService.getCustomization('ohif.menuContent');
// Default menu item component if none is provided through customization
const DefaultMenuItem = ({ item }) => (
<DropdownMenuItem onClick={item.onClick}>{item.label || item.title}</DropdownMenuItem>
const DefaultMenuItem = ({
item,
}: {
item: {
id: string;
label: string;
iconName: string;
onClick: ({ ...props }: withAppTypes) => () => void;
};
}) => (
<DropdownMenuItem onClick={() => item.onClick({ ...props })}>
<div className="flex items-center gap-2">
{item.iconName && <Icons.ByName name={item.iconName} />}
<span>{item.label}</span>
</div>
</DropdownMenuItem>
);
const MenuItemComponent = menuContent?.content || DefaultMenuItem;
@@ -8,7 +8,11 @@ export default {
id: 'tagBrowser',
label: 'Tag Browser',
iconName: 'DicomTagBrowser',
commands: 'openDICOMTagViewer',
onClick: ({ commandsManager, displaySetInstanceUID }: withAppTypes) => {
commandsManager.runCommand('openDICOMTagViewer', {
displaySetInstanceUID,
});
},
},
],
'studyBrowser.sortFunctions': [