Compare commits

...
Author SHA1 Message Date
ohif-bot 1fb98884d2 chore(release): publish [skip ci]
- @ohif/viewer@1.0.2
2019-09-09 16:35:06 +00:00
Danny Brown 7f8f9dc073 Merge pull request #902 from dannyrb/fix/regenerator-runtime-issue-for-umd-build
fix: import regenerator-runtime for umd build
2019-09-09 12:26:33 -04:00
Danny Brown c6f89495b2 Merge branch 'master' into fix/regenerator-runtime-issue-for-umd-build 2019-09-09 12:26:20 -04:00
dannyrb bad987a06b fix: import regenerator-runtime for umd build 2019-09-09 12:25:37 -04:00
ohif-bot c73abb518f chore(release): publish [skip ci]
- @ohif/extension-cornerstone@1.0.0
 - @ohif/extension-dicom-html@0.50.5
 - @ohif/extension-vtk@0.50.8
 - @ohif/core@0.50.6
 - @ohif/viewer@1.0.1
2019-09-09 15:17:11 +00:00
James Petts d12d01215e Merge pull request #900 from JamesAPetts/cst4
Upgrade to cornerstoneTools 4.0.1 and dcmjs 0.6.0
2019-09-09 17:03:10 +02:00
James A. Petts 86adb5113a feat: 🎸 Upgraded to cornerstoneTools 4.0
Upgraded OHIF to run on cornerstone-tools 4.0.1 and dcmjs 0.6.0.

BREAKING CHANGE: n
2019-09-09 16:43:48 +02:00
James A. Petts 5220cd371c Upgrade to cornerstoneTools 4.0.1 and dcmjs 0.6.0 2019-09-09 16:32:52 +02:00
Danny Brown 16b063a504 ci: fix docs deploy-preview redirect (#878)
* docs: filling in missing readme sections

* ci: fix docs deploy-preview redirect
2019-09-06 15:09:20 -04:00
ohif-bot d0d75987f7 chore(release): publish [skip ci]
- @ohif/viewer@1.0.0
2019-09-06 18:40:55 +00:00
ladeirarodolfo 7c4ee734fa refactor: 💡 React components to consume appConfig using Context (#852)
* refactor: 💡 React components to consume appConfig using Context

React components to consume app configuration using React Context and
React Hooks. Non React components to continue using global variable
window.config. Related documentation also changed.

Closes: #725

* refactor: 💡 Removing unecessary code

On current React component there is no need to import useContext method
from React, so, removing it.

* refactor: 💡 Code review

Code review. Minor changes based on review inputs and moving userManager
to an init method

BREAKING CHANGE: #725

Closes: #725

* docs: don't include implementation detail in docs

* docs: don't include implementation detail in docs

* docs: no need to specify implementation details in employment recipe

* docs: no need to specify implementation details in deployment recipe
2019-09-06 14:31:26 -04:00
28 changed files with 1524 additions and 1418 deletions

No files matched your search

+6
View File
@@ -0,0 +1,6 @@
# Specific to our deploy-preview
# Our docs are published using CircleCI + GitBook
# Confgure redirects using netlify.toml
# PWA Demo
/pwa/* /pwa/index.html 200
+3
View File
@@ -0,0 +1,3 @@
# Netlify redirects
# SPA rules for our docs
/* /index.html 200
@@ -121,11 +121,7 @@ likely want to update:
#### OHIF Viewer
The OHIF Viewer's configuration is imported from a static `.js` file and made
available globally at `window.config`. The configuration we use is set to a
specific file when we build the viewer, and determined by the env variable:
`APP_CONFIG`. You can see where we set its value in the `dockerfile` for this
solution:
The OHIF Viewer's configuration is imported from a static `.js` file. The configuration we use is set to a specific file when we build the viewer, and determined by the env variable: `APP_CONFIG`. You can see where we set its value in the `dockerfile` for this solution:
`ENV APP_CONFIG=config/docker_openresty-orthanc.js`
@@ -122,11 +122,7 @@ likely want to update:
#### OHIF Viewer
The OHIF Viewer's configuration is imported from a static `.js` file and made
available globally at `window.config`. The configuration we use is set to a
specific file when we build the viewer, and determined by the env variable:
`APP_CONFIG`. You can see where we set its value in the `dockerfile` for this
solution:
The OHIF Viewer's configuration is imported from a static `.js` file. The configuration we use is set to a specific file when we build the viewer, and determined by the env variable: `APP_CONFIG`. You can see where we set its value in the `dockerfile` for this solution:
`ENV APP_CONFIG=config/docker_openresty-orthanc-keycloak.js`
+16
View File
@@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.0.0](https://github.com/OHIF/Viewers/compare/@ohif/extension-cornerstone@0.50.5...@ohif/extension-cornerstone@1.0.0) (2019-09-09)
### Features
* 🎸 Upgraded to cornerstoneTools 4.0 ([86adb51](https://github.com/OHIF/Viewers/commit/86adb51))
### BREAKING CHANGES
* n
## [0.50.5](https://github.com/OHIF/Viewers/compare/@ohif/extension-cornerstone@0.50.4...@ohif/extension-cornerstone@0.50.5) (2019-09-06)
**Note:** Version bump only for package @ohif/extension-cornerstone
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@ohif/extension-cornerstone",
"version": "0.50.5",
"version": "1.0.0",
"description": "OHIF extension for Cornerstone",
"author": "OHIF",
"license": "MIT",
@@ -32,9 +32,9 @@
"@ohif/ui": "^0.50.0",
"cornerstone-core": "^2.2.8",
"cornerstone-math": "^0.1.8",
"cornerstone-tools": "^3.1.0",
"cornerstone-tools": "^4.0.1",
"cornerstone-wado-image-loader": "^3.0.0",
"dcmjs": "^0.3.8",
"dcmjs": "^0.6.0",
"dicom-parser": "^1.8.3",
"hammerjs": "^2.0.8",
"prop-types": "^15.6.2",
@@ -1,8 +1,8 @@
import * as dcmjs from "dcmjs";
import * as dcmjs from 'dcmjs';
import OHIF from "@ohif/core";
import cornerstone from "cornerstone-core";
import cornerstoneTools from "cornerstone-tools";
import OHIF from '@ohif/core';
import cornerstone from 'cornerstone-core';
import cornerstoneTools from 'cornerstone-tools';
const { StackManager } = OHIF.utils;
@@ -56,7 +56,7 @@ function retrieveDicomData(wadoUri) {
// TODO: Authorization header depends on the server. If we ever have multiple servers
// we will need to figure out how / when to pass this information in.
return fetch(wadoUri, {
headers: OHIF.DICOMWeb.getAuthorizationHeader()
headers: OHIF.DICOMWeb.getAuthorizationHeader(),
}).then(response => response.arrayBuffer());
}
@@ -91,7 +91,7 @@ async function handleSegmentationStorage(
if (displaySets.length > 1) {
console.warn(
"More than one display set with the same seriesInstanceUid. This is not supported yet..."
'More than one display set with the same seriesInstanceUid. This is not supported yet...'
);
}
@@ -100,17 +100,19 @@ async function handleSegmentationStorage(
const results = parseSeg(arrayBuffer, imageIds);
if (!results) {
throw new Error("Fractional segmentations are not supported");
throw new Error('Fractional segmentations are not supported');
}
const { segMetadata, toolState } = results;
const { labelmapBuffer, segMetadata, segmentsOnFrame } = results;
const { setters } = cornerstoneTools.getModule('segmentation');
segMetadata.seriesInstanceUid = seriesInstanceUid;
addSegMetadataToCornerstoneToolState(
setters.labelmap3DByFirstImageId(
imageIds[0],
labelmapBuffer,
0, // TODO -> Can define a color LUT based on colors in the SEG later.
segMetadata,
toolState,
displaySetInstanceUid
imageIds.length,
segmentsOnFrame
);
const cachedStack = StackManager.findOrCreateStack(
@@ -123,7 +125,7 @@ async function handleSegmentationStorage(
return {
studyInstanceUid,
displaySetInstanceUid,
stack
stack,
};
}
+8
View File
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.50.5](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-html@0.50.4...@ohif/extension-dicom-html@0.50.5) (2019-09-09)
**Note:** Version bump only for package @ohif/extension-dicom-html
## [0.50.4](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-html@0.50.3...@ohif/extension-dicom-html@0.50.4) (2019-09-06)
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@ohif/extension-dicom-html",
"version": "0.50.4",
"version": "0.50.5",
"description": "OHIF extension for rendering structured reports to HTML",
"author": "OHIF",
"license": "MIT",
@@ -29,7 +29,7 @@
},
"peerDependencies": {
"@ohif/core": "^0.50.0",
"dcmjs": "^0.3.3",
"dcmjs": "^0.6.0",
"prop-types": "^15.6.2",
"react": "^15.0.0 || ^16.0.0",
"react-dom": "^15.0.0 || ^16.0.0"
+8
View File
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.50.8](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@0.50.7...@ohif/extension-vtk@0.50.8) (2019-09-09)
**Note:** Version bump only for package @ohif/extension-vtk
## [0.50.7](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@0.50.6...@ohif/extension-vtk@0.50.7) (2019-09-06)
**Note:** Version bump only for package @ohif/extension-vtk
+5 -5
View File
@@ -1,6 +1,6 @@
{
"name": "@ohif/extension-vtk",
"version": "0.50.7",
"version": "0.50.8",
"description": "OHIF extension for VTK.js",
"author": "OHIF",
"license": "MIT",
@@ -34,7 +34,7 @@
"@ohif/ui": "^0.50.0",
"cornerstone-core": "^2.2.8",
"cornerstone-wado-image-loader": "^3.0.0",
"dcmjs": "^0.4.7",
"dcmjs": "^0.6.0",
"dicom-parser": "^1.8.3",
"i18next": "^17.0.3",
"i18next-browser-languagedetector": "^3.0.1",
@@ -51,11 +51,11 @@
"react-vtkjs-viewport": "0.0.11"
},
"devDependencies": {
"@ohif/core": "^0.50.5",
"@ohif/core": "^0.50.6",
"@ohif/ui": "^0.50.4",
"cornerstone-tools": "^3.13.0",
"cornerstone-tools": "^4.0.0",
"cornerstone-wado-image-loader": "^3.0.0",
"dcmjs": "^0.5.1",
"dcmjs": "^0.6.0",
"dicom-parser": "^1.8.3",
"gh-pages": "^2.0.1",
"i18next": "^17.0.3",
+1 -20
View File
@@ -3,7 +3,7 @@
# TOML Reference:
# https://www.netlify.com/docs/netlify-toml-reference/
#
# We use Netlify for deploy previews and deploy previews only.
# We use Netlify for deploy previews and for publishing docs (gh-pages branch).
# https://viewer.ohif.org is created using a different process that is
# managed by CircleCI and deployed to our Google Hosting
#
@@ -40,25 +40,6 @@
publish = ".netlify/www/"
command = "yarn config set workspaces-experimental true && chmod +x .netlify/build-deploy-preview.sh && .netlify/build-deploy-preview.sh"
# Redirects and headers are GLOBAL for all builds – they do not get scoped to
# contexts no matter where you define them in the file.
# For context-specific rules, use _headers or _redirects files, which are
# PER-DEPLOY.
# The following redirect is intended for use with most SPAs that handle
# routing internally.
# By default, redirects won't be applied if there's a file with the same
# path as the one defined in the `from` property. Setting `force` to `true`
# will make the redirect rule take precedence over any existing files.
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
[[redirects]]
from = "/pwa/*"
to = "/pwa/index.html"
status = 200
[[headers]]
# Define which paths this specific [[headers]] block will cover.
for = "/*"
+8
View File
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.50.6](https://github.com/OHIF/Viewers/compare/@ohif/core@0.50.5...@ohif/core@0.50.6) (2019-09-09)
**Note:** Version bump only for package @ohif/core
## [0.50.5](https://github.com/OHIF/Viewers/compare/@ohif/core@0.50.4...@ohif/core@0.50.5) (2019-09-04)
**Note:** Version bump only for package @ohif/core
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@ohif/core",
"version": "0.50.5",
"version": "0.50.6",
"description": "Generic business logic for web-based medical imaging applications",
"author": "OHIF Core Team",
"license": "MIT",
@@ -32,7 +32,7 @@
},
"peerDependencies": {
"cornerstone-core": "^2.2.8",
"cornerstone-tools": "^3.9.0",
"cornerstone-tools": "^4.0.0",
"cornerstone-wado-image-loader": "^3.0.0",
"dicom-parser": "^1.8.3"
},
+35
View File
@@ -3,6 +3,41 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.0.2](https://github.com/OHIF/Viewers/compare/@ohif/viewer@1.0.1...@ohif/viewer@1.0.2) (2019-09-09)
### Bug Fixes
* import regenerator-runtime for umd build ([bad987a](https://github.com/OHIF/Viewers/commit/bad987a))
## [1.0.1](https://github.com/OHIF/Viewers/compare/@ohif/viewer@1.0.0...@ohif/viewer@1.0.1) (2019-09-09)
**Note:** Version bump only for package @ohif/viewer
# [1.0.0](https://github.com/OHIF/Viewers/compare/@ohif/viewer@0.50.21...@ohif/viewer@1.0.0) (2019-09-06)
### Code Refactoring
* 💡 React components to consume appConfig using Context ([#852](https://github.com/OHIF/Viewers/issues/852)) ([7c4ee73](https://github.com/OHIF/Viewers/commit/7c4ee73)), closes [#725](https://github.com/OHIF/Viewers/issues/725) [#725](https://github.com/OHIF/Viewers/issues/725)
### BREAKING CHANGES
* #725
## [0.50.21](https://github.com/OHIF/Viewers/compare/@ohif/viewer@0.50.20...@ohif/viewer@0.50.21) (2019-09-06)
+7 -7
View File
@@ -1,6 +1,6 @@
{
"name": "@ohif/viewer",
"version": "0.50.21",
"version": "1.0.2",
"description": "OHIF Viewer",
"author": "OHIF Contributors",
"license": "MIT",
@@ -41,12 +41,12 @@
},
"dependencies": {
"@babel/runtime": "^7.5.5",
"@ohif/core": "^0.50.5",
"@ohif/extension-cornerstone": "^0.50.5",
"@ohif/extension-dicom-html": "^0.50.4",
"@ohif/core": "^0.50.6",
"@ohif/extension-cornerstone": "^1.0.0",
"@ohif/extension-dicom-html": "^0.50.5",
"@ohif/extension-dicom-microscopy": "^0.50.4",
"@ohif/extension-dicom-pdf": "^0.50.3",
"@ohif/extension-vtk": "^0.50.7",
"@ohif/extension-vtk": "^0.50.8",
"@ohif/i18n": "^0.50.3",
"@ohif/ui": "^0.50.4",
"@tanem/react-nprogress": "^1.1.25",
@@ -54,9 +54,9 @@
"core-js": "^3.2.1",
"cornerstone-core": "^2.2.8",
"cornerstone-math": "^0.1.8",
"cornerstone-tools": "^3.19.2",
"cornerstone-tools": "^4.0.0",
"cornerstone-wado-image-loader": "^3.0.0",
"dcmjs": "^0.4.7",
"dcmjs": "^0.6.0",
"dicom-parser": "^1.8.3",
"dicomweb-client": "^0.4.4",
"hammerjs": "^2.0.8",
+66 -47
View File
@@ -25,12 +25,15 @@ import { OidcProvider } from 'redux-oidc';
import PropTypes from 'prop-types';
import { Provider } from 'react-redux';
import { BrowserRouter as Router } from 'react-router-dom';
import WhiteLabellingContext from './WhiteLabellingContext';
import { getActiveContexts } from './store/layout/selectors.js';
import i18n from '@ohif/i18n';
import setupTools from './setupTools.js';
import store from './store';
import UserManagerContext from './UserManagerContext';
// Contexts
import WhiteLabellingContext from './context/WhiteLabellingContext';
import UserManagerContext from './context/UserManagerContext';
import AppContext from './context/AppContext';
// ~~~~ APP SETUP
initCornerstoneTools({
@@ -74,10 +77,66 @@ class App extends Component {
extensions: [],
};
_appConfig;
_userManager;
constructor(props) {
super(props);
if (this.props.oidc.length) {
this.appConfig = props;
const { servers, extensions, hotkeys, oidc } = props;
this.initUserManager(oidc);
_initExtensions(extensions, hotkeys);
_initServers(servers);
initWebWorkers();
}
render() {
const userManager = this._userManager;
const config = {
appConfig: this._appConfig,
};
if (userManager) {
return (
<AppContext.Provider value={config}>
<Provider store={store}>
<I18nextProvider i18n={i18n}>
<OidcProvider store={store} userManager={userManager}>
<UserManagerContext.Provider value={userManager}>
<Router basename={this.props.routerBasename}>
<WhiteLabellingContext.Provider
value={this.props.whiteLabelling}
>
<OHIFStandaloneViewer userManager={userManager} />
</WhiteLabellingContext.Provider>
</Router>
</UserManagerContext.Provider>
</OidcProvider>
</I18nextProvider>
</Provider>
</AppContext.Provider>
);
}
return (
<AppContext.Provider value={config}>
<Provider store={store}>
<I18nextProvider i18n={i18n}>
<Router basename={this.props.routerBasename}>
<WhiteLabellingContext.Provider value={this.props.whiteLabelling}>
<OHIFStandaloneViewer />
</WhiteLabellingContext.Provider>
</Router>
</I18nextProvider>
</Provider>
</AppContext.Provider>
);
}
initUserManager(oidc) {
if (oidc && !!oidc.length) {
const firstOpenIdClient = this.props.oidc[0];
const { protocol, host } = window.location;
@@ -102,58 +161,18 @@ class App extends Component {
),
});
this.userManager = getUserManagerForOpenIdConnectClient(
this._userManager = getUserManagerForOpenIdConnectClient(
store,
openIdConnectConfiguration
);
}
_initExtensions(this.props.extensions);
_initServers(this.props.servers);
initWebWorkers();
}
render() {
const userManager = this.userManager;
if (userManager) {
return (
<Provider store={store}>
<I18nextProvider i18n={i18n}>
<OidcProvider store={store} userManager={userManager}>
<UserManagerContext.Provider value={userManager}>
<Router basename={this.props.routerBasename}>
<WhiteLabellingContext.Provider
value={this.props.whiteLabelling}
>
<OHIFStandaloneViewer userManager={userManager} />
</WhiteLabellingContext.Provider>
</Router>
</UserManagerContext.Provider>
</OidcProvider>
</I18nextProvider>
</Provider>
);
}
return (
<Provider store={store}>
<I18nextProvider i18n={i18n}>
<Router basename={this.props.routerBasename}>
<WhiteLabellingContext.Provider value={this.props.whiteLabelling}>
<OHIFStandaloneViewer />
</WhiteLabellingContext.Provider>
</Router>
</I18nextProvider>
</Provider>
);
}
}
/**
* @param
*/
function _initExtensions(extensions) {
function _initExtensions(extensions, hotkeys) {
const defaultExtensions = [
GenericViewerCommands,
MeasurementsPanel,
@@ -163,8 +182,8 @@ function _initExtensions(extensions) {
extensionManager.registerExtensions(mergedExtensions);
// Must run after extension commands are registered
if (window.config.hotkeys) {
hotkeysManager.setHotkeys(window.config.hotkeys, true);
if (hotkeys) {
hotkeysManager.setHotkeys(hotkeys, true);
}
}
+6 -4
View File
@@ -20,6 +20,9 @@ import './OHIFStandaloneViewer.css';
import './variables.css';
import './theme-tide.css';
// Contexts
import AppContext from './context/AppContext';
// Dynamic Import Routes (CodeSplitting)
// const IHEInvokeImageDisplay = asyncComponent(() =>
// import('./routes/IHEInvokeImageDisplay.js')
@@ -37,6 +40,7 @@ import './theme-tide.css';
const reload = () => window.location.reload();
class OHIFStandaloneViewer extends Component {
static contextType = AppContext;
state = {
isLoading: false,
};
@@ -63,7 +67,7 @@ class OHIFStandaloneViewer extends Component {
render() {
const { user, userManager } = this.props;
const { appConfig = {} } = this.context;
const userNotLoggedIn = userManager && (!user || user.expired);
if (userNotLoggedIn) {
const pathname = this.props.location.pathname;
@@ -140,9 +144,7 @@ class OHIFStandaloneViewer extends Component {
];
const showStudyList =
window.config && window.config.showStudyList !== undefined
? window.config.showStudyList
: true;
appConfig.showStudyList !== undefined ? appConfig.showStudyList : true;
if (showStudyList) {
routes.push({
path: '/studylist',
@@ -11,13 +11,17 @@ import { AboutModal } from '@ohif/ui';
import { hotkeysManager } from './../../App.js';
import { withTranslation } from 'react-i18next';
// Context
import AppContext from './../../context/AppContext';
class Header extends Component {
static contextType = AppContext;
static propTypes = {
home: PropTypes.bool.isRequired,
location: PropTypes.object.isRequired,
children: PropTypes.node,
t: PropTypes.func.isRequired,
userManager: PropTypes.object
userManager: PropTypes.object,
};
static defaultProps = {
@@ -63,10 +67,10 @@ class Header extends Component {
if (this.props.user && this.props.userManager) {
this.options.push({
title: t('Logout'),
icon: { name: 'power-off' },
onClick: () => {
this.props.userManager.signoutRedirect();
},
icon: { name: 'power-off' },
onClick: () => {
this.props.userManager.signoutRedirect();
},
});
}
@@ -82,10 +86,9 @@ class Header extends Component {
render() {
const { t } = this.props;
const { appConfig = {} } = this.context;
const showStudyList =
window.config.showStudyList !== undefined
? window.config.showStudyList
: true;
appConfig.showStudyList !== undefined ? appConfig.showStudyList : true;
return (
<div className={`entry-header ${this.props.home ? 'header-big' : ''}`}>
<div className="header-left-box">
@@ -5,7 +5,6 @@ import classNames from 'classnames';
import { MODULE_TYPES } from '@ohif/core';
import OHIF from '@ohif/core';
import moment from 'moment';
import WhiteLabellingContext from '../WhiteLabellingContext.js';
import ConnectedHeader from './ConnectedHeader.js';
import ConnectedToolbarRow from './ConnectedToolbarRow.js';
import ConnectedLabellingOverlay from './ConnectedLabellingOverlay';
@@ -13,7 +12,11 @@ import ConnectedStudyBrowser from './ConnectedStudyBrowser.js';
import ConnectedViewerMain from './ConnectedViewerMain.js';
import SidePanel from './../components/SidePanel.js';
import { extensionManager } from './../App.js';
import UserManagerContext from '../UserManagerContext';
// Contexts
import WhiteLabellingContext from '../context/WhiteLabellingContext.js';
import UserManagerContext from '../context/UserManagerContext';
import './Viewer.css';
/**
* Inits OHIF Hanging Protocol's onReady.
@@ -0,0 +1,5 @@
import React from 'react';
let AppContext = React.createContext({});
export default AppContext;
@@ -1,4 +1,4 @@
import OHIFLogo from './components/OHIFLogo/OHIFLogo.js';
import OHIFLogo from '../components/OHIFLogo/OHIFLogo.js';
import React from 'react';
const defaultContextValues = {
+2
View File
@@ -1,6 +1,8 @@
/**
* Entry point index.js for UMD packaging
*/
import 'regenerator-runtime/runtime';
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App.js';
+1 -1
View File
@@ -177,7 +177,7 @@ export default function setupTools(store) {
{ name: 'StackScroll', mouseButtonMasks: [1] },
{ name: 'Brush', mouseButtonMasks: [1] },
{
name: 'FreehandMouse',
name: 'FreehandRoi',
props: {
configuration: {
getMeasurementLocationCallback: toolLabellingFlowCallback,
@@ -1,9 +1,12 @@
import React from 'react';
import React, { useContext } from 'react';
import PropTypes from 'prop-types';
import { withRouter } from 'react-router-dom';
import queryString from 'query-string';
import ConnectedStudyList from './ConnectedStudyList';
// Contexts
import AppContext from '../context/AppContext';
// TODO: Move to @ohif/ui
function toLowerCaseFirstLetter(word) {
@@ -22,16 +25,20 @@ function getFilters({ search }) {
}
function StudyListRouting({ location }) {
const { appConfig = {} } = useContext(AppContext);
const filters = location ? getFilters(location) : undefined;
let studyListFunctionsEnabled = false;
if (window.config && window.config.studyListFunctionsEnabled) {
studyListFunctionsEnabled = window.config.studyListFunctionsEnabled;
if (appConfig.studyListFunctionsEnabled) {
studyListFunctionsEnabled = appConfig.studyListFunctionsEnabled;
}
return <ConnectedStudyList
filters={filters}
studyListFunctionsEnabled={studyListFunctionsEnabled}
/>;
return (
<ConnectedStudyList
filters={filters}
studyListFunctionsEnabled={studyListFunctionsEnabled}
/>
);
}
StudyListRouting.propTypes = {
@@ -10,10 +10,14 @@ import moment from 'moment';
import ConnectedDicomFilesUploader from '../googleCloud/ConnectedDicomFilesUploader';
import ConnectedDicomStorePicker from '../googleCloud/ConnectedDicomStorePicker';
import filesToStudies from '../lib/filesToStudies.js';
import UserManagerContext from '../UserManagerContext';
import WhiteLabellingContext from '../WhiteLabellingContext';
// Contexts
import UserManagerContext from '../context/UserManagerContext';
import WhiteLabellingContext from '../context/WhiteLabellingContext';
import AppContext from '../context/AppContext';
class StudyListWithData extends Component {
static contextType = AppContext;
state = {
searchData: {},
studies: [],
@@ -51,9 +55,10 @@ class StudyListWithData extends Component {
};
componentDidMount() {
const { appConfig = {} } = this.context;
// TODO: Avoid using timepoints here
//const params = { studyInstanceUids, seriesInstanceUids, timepointId, timepointsFilter={} };
if (!this.props.server && window.config.enableGoogleCloudAdapter) {
if (!this.props.server && appConfig.enableGoogleCloudAdapter) {
this.setState({
modalComponentId: 'DicomStorePicker',
});
@@ -184,6 +189,7 @@ class StudyListWithData extends Component {
};
render() {
const { appConfig = {} } = this.context;
const onDrop = async acceptedFiles => {
try {
const studies = await filesToStudies(acceptedFiles);
@@ -203,8 +209,7 @@ class StudyListWithData extends Component {
let healthCareApiButtons = null;
let healthCareApiWindows = null;
// TODO: This should probably be a prop
if (window.config.enableGoogleCloudAdapter) {
if (appConfig.enableGoogleCloudAdapter) {
healthCareApiWindows = (
<ConnectedDicomStorePicker
isOpen={this.state.modalComponentId === 'DicomStorePicker'}
+1281 -1280
View File
File diff suppressed because it is too large. Load diff