diff --git a/platform/viewer/src/App.js b/platform/viewer/src/App.js index 6819838ff29..1a196db267e 100644 --- a/platform/viewer/src/App.js +++ b/platform/viewer/src/App.js @@ -86,6 +86,7 @@ class App extends Component { static defaultProps = { config: { + showStudyList: true, whiteLabelling: {}, oidc: [], extensions: [], @@ -102,6 +103,7 @@ class App extends Component { const { config, defaultExtensions } = props; const appDefaultConfig = { + showStudyList: true, cornerstoneExtensionConfig: {}, extensions: [], routerBasename: '/', diff --git a/platform/viewer/src/components/Header/Header.js b/platform/viewer/src/components/Header/Header.js index 8fa2a69374e..19b7c76c044 100644 --- a/platform/viewer/src/components/Header/Header.js +++ b/platform/viewer/src/components/Header/Header.js @@ -1,30 +1,29 @@ import React, { useState, useEffect } from 'react'; import { Link, withRouter } from 'react-router-dom'; import { withTranslation } from 'react-i18next'; - import PropTypes from 'prop-types'; - +import classNames from 'classnames'; import { Dropdown, AboutContent, withModal } from '@ohif/ui'; - +// import { UserPreferences } from './../UserPreferences'; import OHIFLogo from '../OHIFLogo/OHIFLogo.js'; import './Header.css'; -// Context -import AppContext from './../../context/AppContext'; - function Header(props) { const { t, user, userManager, modal: { show }, - home, + useLargeLogo, + linkPath, + linkText, location, children, } = props; const [options, setOptions] = useState([]); + const hasLink = linkText && linkPath; useEffect(() => { const optionsValue = [ @@ -61,15 +60,12 @@ function Header(props) { setOptions(optionsValue); }, [setOptions, show, t, user, userManager]); - const { appConfig = {} } = AppContext; - const showStudyList = - appConfig.showStudyList !== undefined ? appConfig.showStudyList : true; - - // ANTD -- Hamburger, Drawer, Menu return ( <>
{t('INVESTIGATIONAL USE ONLY')}
-
+
{location && location.studyLink && ( - {t('Study list')} + {t(linkText)} )}
@@ -105,7 +101,11 @@ function Header(props) { } Header.propTypes = { - home: PropTypes.bool.isRequired, + // Study list, / + linkText: PropTypes.string, + linkPath: PropTypes.string, + useLargeLogo: PropTypes.bool, + // location: PropTypes.object.isRequired, children: PropTypes.node, t: PropTypes.func.isRequired, @@ -115,7 +115,7 @@ Header.propTypes = { }; Header.defaultProps = { - home: true, + useLargeLogo: false, children: OHIFLogo(), }; diff --git a/platform/viewer/src/connectedComponents/Viewer.js b/platform/viewer/src/connectedComponents/Viewer.js index ce4c287b279..e0824933a03 100644 --- a/platform/viewer/src/connectedComponents/Viewer.js +++ b/platform/viewer/src/connectedComponents/Viewer.js @@ -16,6 +16,7 @@ import { extensionManager } from './../App.js'; // Contexts import WhiteLabellingContext from '../context/WhiteLabellingContext.js'; import UserManagerContext from '../context/UserManagerContext'; +import AppContext from '../context/AppContext'; import './Viewer.css'; @@ -230,9 +231,23 @@ class Viewer extends Component { {whiteLabelling => ( {userManager => ( - - {whiteLabelling.logoComponent} - + + {appContext => ( + + {whiteLabelling.logoComponent} + + )} + )} )} @@ -290,11 +305,11 @@ class Viewer extends Component { activeIndex={this.props.activeViewportIndex} /> ) : ( - - )} + + )} {/* MAIN */} @@ -332,7 +347,7 @@ export default withDialog(Viewer); * @param {Study[]} studies * @param {DisplaySet[]} studies[].displaySets */ -const _mapStudiesToThumbnails = function (studies) { +const _mapStudiesToThumbnails = function(studies) { return studies.map(study => { const { StudyInstanceUID } = study; diff --git a/platform/viewer/src/routes/routesUtil.js b/platform/viewer/src/routes/routesUtil.js index bfa466530f1..29c678e4cf5 100644 --- a/platform/viewer/src/routes/routesUtil.js +++ b/platform/viewer/src/routes/routesUtil.js @@ -45,9 +45,7 @@ const ROUTES_DEF = { path: ['/studylist', '/'], component: StudyListRouting, condition: appConfig => { - return appConfig.showStudyList !== undefined - ? appConfig.showStudyList - : true; + return appConfig.showStudyList; }, }, local: { @@ -72,10 +70,7 @@ const ROUTES_DEF = { '/projects/:project/locations/:location/datasets/:dataset/dicomStores/:dicomStore', component: StudyListRouting, condition: appConfig => { - const showList = - appConfig.showStudyList !== undefined - ? appConfig.showStudyList - : true; + const showList = appConfig.showStudyList; return showList && !!appConfig.enableGoogleCloudAdapter; }, diff --git a/platform/viewer/src/studylist/StudyListRoute.js b/platform/viewer/src/studylist/StudyListRoute.js index dd90809f720..1e2726a5578 100644 --- a/platform/viewer/src/studylist/StudyListRoute.js +++ b/platform/viewer/src/studylist/StudyListRoute.js @@ -214,7 +214,7 @@ function StudyListRoute(props) { {userManager => (