fix: Create typed services and allow lower case access to agree with naming conventions (#3141)
* fix: Add typed services * fix: Typed services - PR changes * remaining of the cineService and toolbarService renaming --------- Co-authored-by: Alireza <ar.sedghi@gmail.com>
This commit is contained in:
1 parent
0e1a58da79
commit
7f799b8e3d
55 files changed
+302
-233
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import toolbarButtons from './toolbarButtons.js';
|
||||
import { hotkeys } from '@ohif/core';
|
||||
import { hotkeys, ServicesManager } from '@ohif/core';
|
||||
import { id } from './id';
|
||||
|
||||
const configs = {
|
||||
@@ -53,7 +53,7 @@ function modeFactory({ modeConfiguration }) {
|
||||
* Lifecycle hooks
|
||||
*/
|
||||
onModeEnter: ({ servicesManager, extensionManager }) => {
|
||||
const { ToolBarService, ToolGroupService } = servicesManager.services;
|
||||
const { toolbarService, ToolGroupService } = servicesManager.services;
|
||||
const utilityModule = extensionManager.getModuleEntry(
|
||||
'@ohif/extension-cornerstone.utilityModule.tools'
|
||||
);
|
||||
@@ -94,7 +94,7 @@ function modeFactory({ modeConfiguration }) {
|
||||
let unsubscribe;
|
||||
|
||||
const activateTool = () => {
|
||||
ToolBarService.recordInteraction({
|
||||
toolbarService.recordInteraction({
|
||||
groupId: 'WindowLevel',
|
||||
itemId: 'WindowLevel',
|
||||
interactionType: 'tool',
|
||||
@@ -121,9 +121,9 @@ function modeFactory({ modeConfiguration }) {
|
||||
activateTool
|
||||
));
|
||||
|
||||
ToolBarService.init(extensionManager);
|
||||
ToolBarService.addButtons(toolbarButtons);
|
||||
ToolBarService.createButtonSection('primary', [
|
||||
toolbarService.init(extensionManager);
|
||||
toolbarService.addButtons(toolbarButtons);
|
||||
toolbarService.createButtonSection('primary', [
|
||||
'MeasurementTools',
|
||||
'Zoom',
|
||||
'WindowLevel',
|
||||
@@ -136,10 +136,10 @@ function modeFactory({ modeConfiguration }) {
|
||||
const {
|
||||
ToolGroupService,
|
||||
MeasurementService,
|
||||
ToolBarService,
|
||||
toolbarService,
|
||||
} = servicesManager.services;
|
||||
|
||||
ToolBarService.reset();
|
||||
toolbarService.reset();
|
||||
ToolGroupService.destroy();
|
||||
},
|
||||
validationTags: {
|
||||
|
||||
@@ -69,7 +69,7 @@ function modeFactory() {
|
||||
onModeEnter: ({ servicesManager, extensionManager, commandsManager }) => {
|
||||
const {
|
||||
MeasurementService,
|
||||
ToolBarService,
|
||||
toolbarService,
|
||||
ToolGroupService,
|
||||
} = servicesManager.services;
|
||||
|
||||
@@ -81,7 +81,7 @@ function modeFactory() {
|
||||
let unsubscribe;
|
||||
|
||||
const activateTool = () => {
|
||||
ToolBarService.recordInteraction({
|
||||
toolbarService.recordInteraction({
|
||||
groupId: 'WindowLevel',
|
||||
itemId: 'WindowLevel',
|
||||
interactionType: 'tool',
|
||||
@@ -108,9 +108,9 @@ function modeFactory() {
|
||||
activateTool
|
||||
));
|
||||
|
||||
ToolBarService.init(extensionManager);
|
||||
ToolBarService.addButtons(toolbarButtons);
|
||||
ToolBarService.createButtonSection('primary', [
|
||||
toolbarService.init(extensionManager);
|
||||
toolbarService.addButtons(toolbarButtons);
|
||||
toolbarService.createButtonSection('primary', [
|
||||
'MeasurementTools',
|
||||
'Zoom',
|
||||
'WindowLevel',
|
||||
@@ -126,12 +126,12 @@ function modeFactory() {
|
||||
const {
|
||||
ToolGroupService,
|
||||
SyncGroupService,
|
||||
ToolBarService,
|
||||
toolbarService,
|
||||
SegmentationService,
|
||||
CornerstoneViewportService,
|
||||
} = servicesManager.services;
|
||||
|
||||
ToolBarService.reset();
|
||||
toolbarService.reset();
|
||||
ToolGroupService.destroy();
|
||||
SyncGroupService.destroy();
|
||||
SegmentationService.destroy();
|
||||
|
||||
@@ -69,7 +69,7 @@ function modeFactory() {
|
||||
onModeEnter: ({ servicesManager, extensionManager, commandsManager }) => {
|
||||
const {
|
||||
MeasurementService,
|
||||
ToolBarService,
|
||||
toolbarService,
|
||||
ToolGroupService,
|
||||
} = servicesManager.services;
|
||||
|
||||
@@ -81,7 +81,7 @@ function modeFactory() {
|
||||
let unsubscribe;
|
||||
|
||||
const activateTool = () => {
|
||||
ToolBarService.recordInteraction({
|
||||
toolbarService.recordInteraction({
|
||||
groupId: 'WindowLevel',
|
||||
itemId: 'WindowLevel',
|
||||
interactionType: 'tool',
|
||||
@@ -108,9 +108,9 @@ function modeFactory() {
|
||||
activateTool
|
||||
));
|
||||
|
||||
ToolBarService.init(extensionManager);
|
||||
ToolBarService.addButtons(toolbarButtons);
|
||||
ToolBarService.createButtonSection('primary', [
|
||||
toolbarService.init(extensionManager);
|
||||
toolbarService.addButtons(toolbarButtons);
|
||||
toolbarService.createButtonSection('primary', [
|
||||
'MeasurementTools',
|
||||
'Zoom',
|
||||
'WindowLevel',
|
||||
@@ -126,12 +126,12 @@ function modeFactory() {
|
||||
const {
|
||||
ToolGroupService,
|
||||
SyncGroupService,
|
||||
ToolBarService,
|
||||
toolbarService,
|
||||
SegmentationService,
|
||||
CornerstoneViewportService,
|
||||
} = servicesManager.services;
|
||||
|
||||
ToolBarService.reset();
|
||||
toolbarService.reset();
|
||||
ToolGroupService.destroy();
|
||||
SyncGroupService.destroy();
|
||||
SegmentationService.destroy();
|
||||
|
||||
@@ -42,7 +42,7 @@ function modeFactory({ modeConfiguration }) {
|
||||
*/
|
||||
onModeEnter: ({ servicesManager, extensionManager, commandsManager }) => {
|
||||
const {
|
||||
ToolBarService,
|
||||
toolbarService,
|
||||
ToolGroupService,
|
||||
HangingProtocolService,
|
||||
DisplaySetService,
|
||||
@@ -58,7 +58,7 @@ function modeFactory({ modeConfiguration }) {
|
||||
initToolGroups(toolNames, Enums, ToolGroupService, commandsManager);
|
||||
|
||||
const setWindowLevelActive = () => {
|
||||
ToolBarService.recordInteraction({
|
||||
toolbarService.recordInteraction({
|
||||
groupId: 'WindowLevel',
|
||||
itemId: 'WindowLevel',
|
||||
interactionType: 'tool',
|
||||
@@ -120,9 +120,9 @@ function modeFactory({ modeConfiguration }) {
|
||||
);
|
||||
|
||||
unsubscriptions.push(unsubscribe);
|
||||
ToolBarService.init(extensionManager);
|
||||
ToolBarService.addButtons(toolbarButtons);
|
||||
ToolBarService.createButtonSection('primary', [
|
||||
toolbarService.init(extensionManager);
|
||||
toolbarService.addButtons(toolbarButtons);
|
||||
toolbarService.createButtonSection('primary', [
|
||||
'MeasurementTools',
|
||||
'Zoom',
|
||||
'WindowLevel',
|
||||
@@ -136,13 +136,13 @@ function modeFactory({ modeConfiguration }) {
|
||||
const {
|
||||
ToolGroupService,
|
||||
SyncGroupService,
|
||||
ToolBarService,
|
||||
toolbarService,
|
||||
SegmentationService,
|
||||
CornerstoneViewportService,
|
||||
} = servicesManager.services;
|
||||
|
||||
unsubscriptions.forEach(unsubscribe => unsubscribe());
|
||||
ToolBarService.reset();
|
||||
toolbarService.reset();
|
||||
ToolGroupService.destroy();
|
||||
SyncGroupService.destroy();
|
||||
SegmentationService.destroy();
|
||||
|
||||
Reference in new issue
Block a user