feat(StudyList): Disable study list link/route using 'showStudyList' config property (#597)
fix #574
This commit is contained in:
parent
571dd5848f
commit
4b3994e788
@ -3,6 +3,7 @@ window.config = {
|
|||||||
routerBasename: '/',
|
routerBasename: '/',
|
||||||
// default: ''
|
// default: ''
|
||||||
relativeWebWorkerScriptsPath: '',
|
relativeWebWorkerScriptsPath: '',
|
||||||
|
showStudyList: true,
|
||||||
servers: {
|
servers: {
|
||||||
dicomWeb: [
|
dicomWeb: [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
window.config = {
|
window.config = {
|
||||||
routerBasename: '/',
|
routerBasename: '/',
|
||||||
|
showStudyList: true,
|
||||||
servers: {
|
servers: {
|
||||||
dicomWeb: [
|
dicomWeb: [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
window.config = {
|
window.config = {
|
||||||
routerBasename: '/',
|
routerBasename: '/',
|
||||||
|
showStudyList: true,
|
||||||
relativeWebWorkerScriptsPath: '',
|
relativeWebWorkerScriptsPath: '',
|
||||||
servers: {
|
servers: {
|
||||||
dicomWeb: [
|
dicomWeb: [
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
window.config = {
|
window.config = {
|
||||||
routerBasename: '/',
|
routerBasename: '/',
|
||||||
|
showStudyList: true,
|
||||||
relativeWebWorkerScriptsPath: '',
|
relativeWebWorkerScriptsPath: '',
|
||||||
servers: {
|
servers: {
|
||||||
// This is an array, but we'll only use the first entry for now
|
// This is an array, but we'll only use the first entry for now
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
window.config = {
|
window.config = {
|
||||||
routerBasename: '/',
|
routerBasename: '/',
|
||||||
|
showStudyList: true,
|
||||||
relativeWebWorkerScriptsPath: '',
|
relativeWebWorkerScriptsPath: '',
|
||||||
servers: {
|
servers: {
|
||||||
// This is an array, but we'll only use the first entry for now
|
// This is an array, but we'll only use the first entry for now
|
||||||
|
|||||||
@ -2,6 +2,7 @@ window.config = {
|
|||||||
// default: '/'
|
// default: '/'
|
||||||
routerBasename: '/',
|
routerBasename: '/',
|
||||||
// default: ''
|
// default: ''
|
||||||
|
showStudyList: true,
|
||||||
relativeWebWorkerScriptsPath: '',
|
relativeWebWorkerScriptsPath: '',
|
||||||
servers: {
|
servers: {
|
||||||
dicomWeb: [
|
dicomWeb: [
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
window.config = {
|
window.config = {
|
||||||
routerBasename: '/demo',
|
routerBasename: '/demo',
|
||||||
|
showStudyList: true,
|
||||||
servers: {
|
servers: {
|
||||||
dicomWeb: [
|
dicomWeb: [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
window.config = {
|
window.config = {
|
||||||
routerBasename: '/',
|
routerBasename: '/',
|
||||||
|
showStudyList: true,
|
||||||
servers: {
|
servers: {
|
||||||
dicomWeb: [
|
dicomWeb: [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -42,6 +42,9 @@ class OHIFStandaloneViewer extends Component {
|
|||||||
static propTypes = {
|
static propTypes = {
|
||||||
history: PropTypes.object.isRequired,
|
history: PropTypes.object.isRequired,
|
||||||
user: PropTypes.object,
|
user: PropTypes.object,
|
||||||
|
setContext: PropTypes.func,
|
||||||
|
userManager: PropTypes.object,
|
||||||
|
location: PropTypes.object,
|
||||||
};
|
};
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
@ -93,14 +96,6 @@ class OHIFStandaloneViewer extends Component {
|
|||||||
* See http://reactcommunity.org/react-transition-group/with-react-router/
|
* See http://reactcommunity.org/react-transition-group/with-react-router/
|
||||||
*/
|
*/
|
||||||
const routes = [
|
const routes = [
|
||||||
{
|
|
||||||
path: '/',
|
|
||||||
Component: StudyListRouting,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/studylist',
|
|
||||||
Component: StudyListRouting,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
path: '/viewer',
|
path: '/viewer',
|
||||||
Component: StandaloneRouting,
|
Component: StandaloneRouting,
|
||||||
@ -119,6 +114,21 @@ class OHIFStandaloneViewer extends Component {
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const showStudyList =
|
||||||
|
window.config.showStudyList !== undefined
|
||||||
|
? window.config.showStudyList
|
||||||
|
: true;
|
||||||
|
if (showStudyList) {
|
||||||
|
routes.push({
|
||||||
|
path: '/studylist',
|
||||||
|
Component: StudyListRouting,
|
||||||
|
});
|
||||||
|
routes.push({
|
||||||
|
path: '/',
|
||||||
|
Component: StudyListRouting,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const currentPath = this.props.location.pathname;
|
const currentPath = this.props.location.pathname;
|
||||||
const noMatchingRoutes = !routes.find(r =>
|
const noMatchingRoutes = !routes.find(r =>
|
||||||
matchPath(currentPath, {
|
matchPath(currentPath, {
|
||||||
|
|||||||
@ -71,6 +71,10 @@ class Header extends Component {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { t } = this.props;
|
const { t } = this.props;
|
||||||
|
const showStudyList =
|
||||||
|
window.config.showStudyList !== undefined
|
||||||
|
? window.config.showStudyList
|
||||||
|
: true;
|
||||||
return (
|
return (
|
||||||
<div className={`entry-header ${this.props.home ? 'header-big' : ''}`}>
|
<div className={`entry-header ${this.props.home ? 'header-big' : ''}`}>
|
||||||
<div className="header-left-box">
|
<div className="header-left-box">
|
||||||
@ -85,7 +89,7 @@ class Header extends Component {
|
|||||||
|
|
||||||
{this.props.children}
|
{this.props.children}
|
||||||
|
|
||||||
{!this.props.home && (
|
{showStudyList && !this.props.home && (
|
||||||
<Link
|
<Link
|
||||||
className="header-btn header-studyListLinkSection"
|
className="header-btn header-studyListLinkSection"
|
||||||
to={{
|
to={{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user