diff --git a/extensions/default/src/customizations/studyBrowserContextMenu.ts b/extensions/default/src/customizations/studyBrowserContextMenu.ts deleted file mode 100644 index a7399be33..000000000 --- a/extensions/default/src/customizations/studyBrowserContextMenu.ts +++ /dev/null @@ -1,81 +0,0 @@ -export const studyBrowserContextMenu = { - id: 'StudyBrowser.studyContextMenu', - customizationType: 'ohif.contextMenu', - menus: [ - { - id: 'studyBrowserContextMenu', - // selector restricts context menu to when there is nearbyToolData - items: [ - { - label: 'Show in Grid', - commands: { - commandName: 'loadStudy', - commandOptions: { - commands: { - commandName: 'setHangingProtocol', - commandOptions: { - protocolId: '@ohif/mnGrid8', - }, - }, - }, - }, - }, - { - label: 'Show in other monitor', - selector: ({ isMultimonitor }) => isMultimonitor, - commands: { - commandName: 'multimonitor', - commandOptions: { - commands: { - commandName: 'loadStudy', - commandOptions: { - commands: { - commandName: 'setHangingProtocol', - commandOptions: { - protocolId: '@ohif/mnGrid8', - }, - }, - }, - }, - }, - }, - }, - { - label: 'Compare All', - selector: ({ isMultimonitor }) => isMultimonitor, - commands: [ - { - commandName: 'loadStudy', - commandOptions: { - commands: { - commandName: 'setHangingProtocol', - commandOptions: { - protocolId: '@ohif/mnGrid', - }, - }, - }, - }, - { - commandName: 'multimonitor', - commandOptions: { - commands: { - commandName: 'loadStudy', - commandOptions: { - commands: { - commandName: 'setHangingProtocol', - commandOptions: { - protocolId: '@ohif/mnGridMonitor2', - }, - }, - }, - }, - }, - }, - ], - }, - ], - }, - ], -}; - -export default studyBrowserContextMenu; diff --git a/extensions/default/src/getCustomizationModule.tsx b/extensions/default/src/getCustomizationModule.tsx index af719e17f..64ce8fa6b 100644 --- a/extensions/default/src/getCustomizationModule.tsx +++ b/extensions/default/src/getCustomizationModule.tsx @@ -5,7 +5,6 @@ import { ProgressDropdownWithService } from './Components/ProgressDropdownWithSe import DataSourceConfigurationComponent from './Components/DataSourceConfigurationComponent'; import { GoogleCloudDataSourceConfigurationAPI } from './DataSourceConfigurationAPI/GoogleCloudDataSourceConfigurationAPI'; import { utils } from '@ohif/core'; -import studyBrowserContextMenu from './customizations/studyBrowserContextMenu'; import { DropdownMenuSub, DropdownMenuSubTrigger, @@ -215,7 +214,6 @@ export default function getCustomizationModule({ servicesManager, extensionManag return clonedObject; }, }, - studyBrowserContextMenu, { // the generic GUI component to configure a data source using an instance of a BaseDataSourceConfigurationAPI diff --git a/extensions/default/src/getHangingProtocolModule.js b/extensions/default/src/getHangingProtocolModule.js index 8eea3ba9e..4ccd6e271 100644 --- a/extensions/default/src/getHangingProtocolModule.js +++ b/extensions/default/src/getHangingProtocolModule.js @@ -1,4 +1,4 @@ -import { hpMN, hpMN8, hpMNMonitor2 } from './hangingprotocols/hpMNGrid'; +import { hpMN, hpMN8 } from './hangingprotocols/hpMNGrid'; import hpMNCompare from './hangingprotocols/hpCompare'; import hpMammography from './hangingprotocols/hpMammo'; import hpScale from './hangingprotocols/hpScale'; @@ -149,10 +149,6 @@ function getHangingProtocolModule() { name: hpMN8.id, protocol: hpMN8, }, - { - name: hpMNMonitor2.id, - protocol: hpMNMonitor2, - }, ]; } diff --git a/extensions/default/src/hangingprotocols/hpMNGrid.ts b/extensions/default/src/hangingprotocols/hpMNGrid.ts index ebdbd84b0..5792d4203 100644 --- a/extensions/default/src/hangingprotocols/hpMNGrid.ts +++ b/extensions/default/src/hangingprotocols/hpMNGrid.ts @@ -393,163 +393,4 @@ export const hpMN8: Types.HangingProtocol.Protocol = { ], }; -/** - * This hanging protocol extends the default protocol with additional - * images on the second monitor. It assumes the first four images are shown - * on monitor 0 - */ -export const hpMNMonitor2: Types.HangingProtocol.Protocol = { - ...hpMN, - id: '@ohif/mnGridMonitor2', - description: 'Second monitor HP with 2x2 grid', - name: '2x2 Monitor 2', - stages: [ - { - id: '2x2', - name: '2x2', - stageActivation: { - enabled: { - minViewportsMatched: 3, - }, - }, - viewportStructure: { - layoutType: 'grid', - properties: { - rows: 2, - columns: 2, - }, - }, - viewports: [ - { - viewportOptions, - displaySets: [ - { - id: 'defaultDisplaySetId', - matchedDisplaySetsIndex: 4, - }, - ], - }, - { - viewportOptions, - displaySets: [ - { - matchedDisplaySetsIndex: 5, - id: 'defaultDisplaySetId', - }, - ], - }, - { - viewportOptions, - displaySets: [ - { - matchedDisplaySetsIndex: 6, - id: 'defaultDisplaySetId', - }, - ], - }, - { - viewportOptions, - displaySets: [ - { - matchedDisplaySetsIndex: 7, - id: 'defaultDisplaySetId', - }, - ], - }, - ], - }, - - // A 2x1 stage - { - name: '2x1', - stageActivation: { - enabled: { - minViewportsMatched: 1, - }, - }, - viewportStructure: { - layoutType: 'grid', - properties: { - rows: 1, - columns: 2, - }, - }, - viewports: [ - { - viewportOptions, - displaySets: [ - { - id: 'defaultDisplaySetId', - matchedDisplaySetsIndex: 4, - }, - ], - }, - { - viewportOptions, - displaySets: [ - { - matchedDisplaySetsIndex: 5, - id: 'defaultDisplaySetId', - }, - ], - }, - ], - }, - - { - name: '1x1', - stageActivation: { - enabled: { - minViewportsMatched: 0, - }, - }, - viewportStructure: { - layoutType: 'grid', - properties: { - rows: 1, - columns: 1, - }, - }, - viewports: [ - { - viewportOptions, - displaySets: [ - { - id: 'defaultDisplaySetId', - matchedDisplaySetsIndex: 4, - }, - ], - }, - ], - }, - - { - name: '1x1 Base', - stageActivation: { - enabled: { - minViewportsMatched: 1, - }, - }, - viewportStructure: { - layoutType: 'grid', - properties: { - rows: 1, - columns: 1, - }, - }, - viewports: [ - { - viewportOptions, - displaySets: [ - { - id: 'defaultDisplaySetId', - matchedDisplaySetsIndex: 0, - }, - ], - }, - ], - }, - ], -}; - export default hpMN; diff --git a/platform/core/src/classes/CommandsManager.ts b/platform/core/src/classes/CommandsManager.ts index 708654f80..701621eb6 100644 --- a/platform/core/src/classes/CommandsManager.ts +++ b/platform/core/src/classes/CommandsManager.ts @@ -218,7 +218,7 @@ export class CommandsManager { * @param options - to include in the commands run beyond * the commandOptions specified in the base. */ - public run(input: RunInput, options: Record = {}): unknown[] { + public run(input: RunInput, options: Record = {}): unknown { const commands = this.validate(input, options); const results: unknown[] = []; @@ -228,14 +228,11 @@ export class CommandsManager { results.push(this.runCommand(commandName, commandOptions, context)); } - return results; + return results.length === 1 ? results[0] : results; } /** Like run, but await each command before continuing */ - public async runAsync( - input: RunInput, - options: Record = {} - ): Promise { + public async runAsync(input: RunInput, options: Record = {}): Promise { const commands = this.validate(input, options); const results: unknown[] = []; @@ -245,7 +242,7 @@ export class CommandsManager { results.push(await this.runCommand(commandName, commandOptions, context)); } - return results; + return results.length === 1 ? results[0] : results; } }