fix(Browser history): fixed NPE when navigating a study via browser history and history navigation is now available via the navigateHistory command (#3337)

* fix(Browser history):
- fixed an NPE when navigating to a different study via the URL
- exposed browser history navigation via a command

* Added documentation for the navigateHistory command.
Moved the history object from UI to viewer.
This commit is contained in:
Joe Boccanfuso authored and GitHub committed 2023-04-27 10:46:23 -04:00
1 parent eea0ed487b
commit 51cb0519fc
7 files changed
+88 -1

No files matched your search

@@ -313,3 +313,34 @@ function modeFactory() {
};
}
```
> How can I navigate to (or show) a different study via the browser history/URL?
There is a command that does this: `navigateHistory`. It takes an object
argument with the `NavigateHistory` type:
```
export type NavigateHistory = {
to: string; // the URL to navigate to
options?: {
replace?: boolean; // replace or add/push to history?
};
};
```
For instance one could bind a hot key to this command to show a specific study
like this...
```
{
commandName: 'navigateHistory',
commandOptions: {
to:
'/viewer?StudyInstanceUIDs=1.2.3',
},
context: 'DEFAULT',
label: 'Nav Study',
keys: ['n'],
isEditable: true,
},
```