Skip to content

Commit

Permalink
fix(store-segmentation): storing segmentations was hitting the wrong …
Browse files Browse the repository at this point in the history
…command resulting in an undefined datasource (#4755)

[OHI-1445]
  • Loading branch information
IbrahimCSAE authored Feb 3, 2025
1 parent 613401e commit 9b8e5cf
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 5 deletions.
6 changes: 5 additions & 1 deletion extensions/cornerstone/src/panels/PanelSegmentation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ export default function PanelSegmentation({
},

storeSegmentation: async segmentationId => {
commandsManager.run('storeSegmentation', { segmentationId });
commandsManager.run({
commandName: 'storeSegmentation',
commandOptions: { segmentationId },
context: 'CORNERSTONE',
});
},

onSegmentationDownloadRTSS: segmentationId => {
Expand Down
26 changes: 23 additions & 3 deletions extensions/default/src/Components/MoreDropdownMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,36 @@ 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
// getMenuItems can also be replaced by providing it to the MoreDropdownMenu
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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': [
Expand Down

0 comments on commit 9b8e5cf

Please sign in to comment.