Pass in CommandsManager config
This commit is contained in:
parent
3f5660722e
commit
a636df8fdc
26
src/App.js
26
src/App.js
@ -1,5 +1,12 @@
|
|||||||
import './config';
|
import './config';
|
||||||
|
|
||||||
|
import {
|
||||||
|
CommandsManager,
|
||||||
|
HotkeysManager,
|
||||||
|
extensions,
|
||||||
|
redux,
|
||||||
|
utils,
|
||||||
|
} from 'ohif-core';
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import {
|
import {
|
||||||
getDefaultToolbarButtons,
|
getDefaultToolbarButtons,
|
||||||
@ -8,33 +15,34 @@ import {
|
|||||||
} from './utils/index.js';
|
} from './utils/index.js';
|
||||||
|
|
||||||
import ConnectedToolContextMenu from './connectedComponents/ConnectedToolContextMenu';
|
import ConnectedToolContextMenu from './connectedComponents/ConnectedToolContextMenu';
|
||||||
import {
|
|
||||||
CommandsManager,
|
|
||||||
HotkeysManager,
|
|
||||||
extensions,
|
|
||||||
redux,
|
|
||||||
utils,
|
|
||||||
} from 'ohif-core';
|
|
||||||
import OHIFCornerstoneExtension from '@ohif/extension-cornerstone';
|
import OHIFCornerstoneExtension from '@ohif/extension-cornerstone';
|
||||||
import OHIFDicomHtmlExtension from 'ohif-dicom-html-extension';
|
import OHIFDicomHtmlExtension from 'ohif-dicom-html-extension';
|
||||||
import OHIFDicomMicroscopyExtension from 'ohif-dicom-microscopy-extension';
|
import OHIFDicomMicroscopyExtension from 'ohif-dicom-microscopy-extension';
|
||||||
import OHIFDicomPDFExtension from 'ohif-dicom-pdf-extension';
|
import OHIFDicomPDFExtension from 'ohif-dicom-pdf-extension';
|
||||||
import OHIFStandaloneViewer from './OHIFStandaloneViewer';
|
import OHIFStandaloneViewer from './OHIFStandaloneViewer';
|
||||||
import OHIFVTKExtension from '@ohif/extension-vtk';
|
import OHIFVTKExtension from '@ohif/extension-vtk';
|
||||||
import appCommands from './appCommands';
|
|
||||||
import { OidcProvider } from 'redux-oidc';
|
import { OidcProvider } from 'redux-oidc';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { Provider } from 'react-redux';
|
import { Provider } from 'react-redux';
|
||||||
import { BrowserRouter as Router } from 'react-router-dom';
|
import { BrowserRouter as Router } from 'react-router-dom';
|
||||||
import WhiteLabellingContext from './WhiteLabellingContext';
|
import WhiteLabellingContext from './WhiteLabellingContext';
|
||||||
|
import appCommands from './appCommands';
|
||||||
import setupTools from './setupTools';
|
import setupTools from './setupTools';
|
||||||
import store from './store';
|
import store from './store';
|
||||||
|
|
||||||
// ~~~~ APP SETUP
|
// ~~~~ APP SETUP
|
||||||
const _commandsManager = new CommandsManager(store);
|
const commandsManagerConfig = {
|
||||||
|
getAppState: () => store.getState(),
|
||||||
|
getActiveContexts: () => store.getState().ui.activeContexts,
|
||||||
|
};
|
||||||
|
|
||||||
|
const _commandsManager = new CommandsManager(commandsManagerConfig);
|
||||||
const _hotkeysManager = new HotkeysManager(_commandsManager);
|
const _hotkeysManager = new HotkeysManager(_commandsManager);
|
||||||
|
|
||||||
|
// TODO: Should be done in extensions w/ commandsModule
|
||||||
|
// ADD COMMANDS
|
||||||
appCommands.init(_commandsManager);
|
appCommands.init(_commandsManager);
|
||||||
|
|
||||||
// window.config.userPreferences
|
// window.config.userPreferences
|
||||||
Object.keys(window.config.hotkeys).forEach(commandName => {
|
Object.keys(window.config.hotkeys).forEach(commandName => {
|
||||||
const keys = window.config.hotkeys[commandName];
|
const keys = window.config.hotkeys[commandName];
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user