-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
study item dropdown menu customizations #4668
Open
sedghi
wants to merge
25
commits into
feat/multi-monitor-take2
Choose a base branch
from
feat/mm-some-customizations
base: feat/multi-monitor-take2
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
d074c25
Merge branch 'master' of github.com:OHIF/Viewers into feat/multi-moni…
sedghi c82c3ec
fix(ContextMenu): Ensure annotation visibility and locking checks onl…
sedghi 1d8a83e
refactor(ViewportActionBar): Change import of PatientInfo to named im…
sedghi a9e802e
feat(ThumbnailMenu): Implement dropdown menu for thumbnail actions an…
sedghi a5e8c0e
feat(ThumbnailMenu): Enhance thumbnail interactions with customizable…
sedghi 74065e8
feat(StudyMenu): Introduce StudyMenuItems for enhanced study interact…
sedghi c8f1dc0
feat(MultiMonitor): Enhance multi-monitor functionality and command e…
sedghi ba4d42c
fix(MultiMonitorService): Correct parameter casing for StudyInstanceUIDs
sedghi 0eafda5
feat(StudyBrowser): Enhance study and thumbnail menu items with custo…
sedghi 4a5fefc
feat(Customization): Add 'View Options' menu with 2D and 3D view sele…
sedghi d5d6c72
feat(Customization): Implement dynamic dropdown menu rendering for st…
sedghi f8c816a
refactor(PanelStudyBrowserTracking): Add comment for clarity in menu …
sedghi a420c08
refactor(commandsModule): Remove unused getStudiesfromDisplaySets fun…
sedghi 47b7de7
refactor(Customization): Update dropdown menu items and protocols
sedghi 5f22515
refactor(Customization): Update dropdown menu item styling and remove…
sedghi 48f1131
refactor(Customization): Improve dropdown menu item handling and upda…
sedghi 13e1fd8
Merge branch 'feat/multi-monitor-take2' of github.com:OHIF/Viewers in…
sedghi 5d8cb4c
fix: Mostly preserve the settings on refresh of source window
wayfarer3130 336c24c
fix: Preserve destination measurements
wayfarer3130 02fedce
Cleanup
wayfarer3130 85fbb38
refactor(Customization): Update dropdown menu item labels and improve…
sedghi 612ce4f
Merge remote-tracking branch 'origin/master' into feat/mm-some-custom…
wayfarer3130 1324e4e
Merge remote-tracking branch 'origin/feat/multi-monitor-take2' into f…
wayfarer3130 39f5cd6
fix: Externalize the more drop down menu customizability
wayfarer3130 d43db73
Fix unit test
wayfarer3130 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
import { | ||
DropdownMenu, | ||
DropdownMenuContent, | ||
DropdownMenuTrigger, | ||
Icons, | ||
Button, | ||
} from '@ohif/ui-next'; | ||
|
||
/** | ||
* The default sub-menu appearance and setup is defined here, but this can be | ||
* replaced by | ||
*/ | ||
const getMenuItemsDefault = ({ commandsManager, items, servicesManager, ...props }) => { | ||
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'); | ||
|
||
return ( | ||
<DropdownMenuContent | ||
hideWhenDetached | ||
align="start" | ||
onClick={e => { | ||
e.stopPropagation(); | ||
e.preventDefault(); | ||
}} | ||
> | ||
{items?.map(item => | ||
menuContent.content({ | ||
key: item.id, | ||
item, | ||
commandsManager, | ||
servicesManager, | ||
...props, | ||
}) | ||
)} | ||
</DropdownMenuContent> | ||
); | ||
}; | ||
|
||
/** | ||
* The component provides a ... sub-menu for various components which appears | ||
* on hover over the main component. | ||
* | ||
* @param bindProps - properties to define the sub-menu | ||
* @returns Component bound to the bindProps | ||
*/ | ||
export default function MoreDropdownMenu(bindProps) { | ||
const { | ||
menuItemsKey, | ||
getMenuItems = getMenuItemsDefault, | ||
commandsManager, | ||
servicesManager, | ||
} = bindProps; | ||
const { customizationService } = servicesManager.services; | ||
|
||
const items = customizationService.getCustomization(menuItemsKey)?.value; | ||
|
||
function BoundMoreDropdownMenu(props) { | ||
return ( | ||
<DropdownMenu> | ||
<DropdownMenuTrigger asChild> | ||
<Button | ||
variant="ghost" | ||
size="icon" | ||
className="hidden group-hover:inline-flex data-[state=open]:inline-flex" | ||
onClick={e => { | ||
e.preventDefault(); | ||
e.stopPropagation(); | ||
}} | ||
> | ||
<Icons.More /> | ||
</Button> | ||
</DropdownMenuTrigger> | ||
{getMenuItems({ | ||
...props, | ||
commandsManager: commandsManager, | ||
servicesManager: servicesManager, | ||
items, | ||
})} | ||
</DropdownMenu> | ||
); | ||
} | ||
return BoundMoreDropdownMenu; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is actually supposed to be other monitor since there might be three monitors, and it might be executed on the second monitor already, causing it to launch on the first monitor.