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

[OHI-1445]
This commit is contained in:
Ibrahim 2025-02-03 09:28:58 -05:00 committed by GitHub
parent 613401e043
commit 9b8e5cfd1a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 33 additions and 5 deletions

View File

@ -61,7 +61,11 @@ export default function PanelSegmentation({
}, },
storeSegmentation: async segmentationId => { storeSegmentation: async segmentationId => {
commandsManager.run('storeSegmentation', { segmentationId }); commandsManager.run({
commandName: 'storeSegmentation',
commandOptions: { segmentationId },
context: 'CORNERSTONE',
});
}, },
onSegmentationDownloadRTSS: segmentationId => { onSegmentationDownloadRTSS: segmentationId => {

View File

@ -12,7 +12,12 @@ import {
* The default sub-menu appearance and setup is defined here, but this can be * The default sub-menu appearance and setup is defined here, but this can be
* replaced by * replaced by
*/ */
const getMenuItemsDefault = ({ commandsManager, items, servicesManager, ...props }) => { const getMenuItemsDefault = ({
commandsManager,
items,
servicesManager,
...props
}: withAppTypes) => {
const { customizationService } = servicesManager.services; const { customizationService } = servicesManager.services;
// This allows replacing the default child item for menus, whereas the entire // 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'); const menuContent = customizationService.getCustomization('ohif.menuContent');
// Default menu item component if none is provided through customization // 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; const MenuItemComponent = menuContent?.content || DefaultMenuItem;

View File

@ -8,7 +8,11 @@ export default {
id: 'tagBrowser', id: 'tagBrowser',
label: 'Tag Browser', label: 'Tag Browser',
iconName: 'DicomTagBrowser', iconName: 'DicomTagBrowser',
commands: 'openDICOMTagViewer', onClick: ({ commandsManager, displaySetInstanceUID }: withAppTypes) => {
commandsManager.runCommand('openDICOMTagViewer', {
displaySetInstanceUID,
});
},
}, },
], ],
'studyBrowser.sortFunctions': [ 'studyBrowser.sortFunctions': [