PLUGIN_TYPES --> MODULE_TYPES

This commit is contained in:
dannyrb 2019-06-12 16:09:35 -04:00
parent 29f86d41e6
commit 9c797233bb
4 changed files with 12 additions and 21 deletions

View File

@ -1,7 +1,4 @@
import OHIF from 'ohif-core';
const { plugins, utils } = OHIF;
const { PLUGIN_TYPES } = plugins;
import { MODULE_TYPES, utils } from 'ohif-core';
// TODO: Should probably use dcmjs for this
const SOP_CLASS_UIDS = {
@ -20,7 +17,7 @@ const sopClassUids = Object.values(SOP_CLASS_UIDS);
// same SOP Class
const OHIFDicomHtmlSopClassHandler = {
id: 'OHIFDicomHtmlSopClassHandler',
type: PLUGIN_TYPES.SOP_CLASS_HANDLER,
type: MODULE_TYPES.SOP_CLASS_HANDLER,
sopClassUids,
getDisplaySetFromSeries(series, study, dicomWebClient, authorizationHeaders) {
const instance = series.getFirstInstance();

View File

@ -1,7 +1,4 @@
import OHIF from "ohif-core";
const { plugins, utils } = OHIF;
const { PLUGIN_TYPES } = plugins;
import { MODULE_TYPES, utils } from 'ohif-core';
// TODO: Should probably use dcmjs for this
const SOP_CLASS_UIDS = {
@ -10,10 +7,8 @@ const SOP_CLASS_UIDS = {
const OHIFDicomPDFSopClassHandler = {
id: 'OHIFDicomPDFSopClassHandlerPlugin',
type: PLUGIN_TYPES.SOP_CLASS_HANDLER,
sopClassUids: [
SOP_CLASS_UIDS.ENCAPSULATED_PDF
],
type: MODULE_TYPES.SOP_CLASS_HANDLER,
sopClassUids: [SOP_CLASS_UIDS.ENCAPSULATED_PDF],
getDisplaySetFromSeries(series, study, dicomWebClient, authorizationHeaders) {
const instance = series.getFirstInstance();
@ -28,6 +23,6 @@ const OHIFDicomPDFSopClassHandler = {
authorizationHeaders: authorizationHeaders
};
}
}
};
export default OHIFDicomPDFSopClassHandler;

View File

@ -1,10 +1,10 @@
import { connect } from 'react-redux';
import { LayoutManager } from 'react-viewerbase';
import OHIF from 'ohif-core';
import { MODULE_TYPES } from 'ohif-core';
import { connect } from 'react-redux';
const mapStateToProps = state => {
const viewportPluginIds = state.plugins.availablePlugins
.filter(plugin => plugin.type === OHIF.plugins.PLUGIN_TYPES.VIEWPORT)
.filter(plugin => plugin.type === MODULE_TYPES.VIEWPORT)
.map(plugin => plugin.id);
const availablePlugins = {};
@ -17,7 +17,7 @@ const mapStateToProps = state => {
}
});
// TODO Use something like state.plugins.defaultPlugin[OHIF.plugins.PLUGIN_TYPES.VIEWPORT]
// TODO Use something like state.plugins.defaultPlugin[MODULE_TYPES.VIEWPORT]
let defaultPlugin;
if (viewportPluginIds && viewportPluginIds.length) {
defaultPlugin = viewportPluginIds[0];

View File

@ -4,7 +4,7 @@ import React, { Component } from 'react';
import ConnectedLayoutButton from './ConnectedLayoutButton';
import ConnectedPluginSwitch from './ConnectedPluginSwitch.js';
import OHIF from 'ohif-core';
import { MODULE_TYPES } from 'ohif-core';
import PropTypes from 'prop-types';
import { RoundedButtonGroup } from 'react-viewerbase';
@ -57,10 +57,9 @@ class ToolbarRow extends Component {
const currentPluginId = this.props.pluginId;
const { PLUGIN_TYPES, availablePlugins } = OHIF.plugins;
const plugin = availablePlugins.find(entry => {
return (
entry.type === PLUGIN_TYPES.TOOLBAR && entry.id === currentPluginId
entry.type === MODULE_TYPES.TOOLBAR && entry.id === currentPluginId
);
});