ESLint fixes and cleanup
This commit is contained in:
parent
ecbaddfa93
commit
d45d2ee8f4
@ -7,7 +7,7 @@
|
||||
"dependencies": {
|
||||
"cornerstone-core": "2.2.8",
|
||||
"cornerstone-math": "0.1.7",
|
||||
"cornerstone-tools": "3.0.0-b.1471",
|
||||
"cornerstone-tools": "3.0.0-b.1512",
|
||||
"cornerstone-wado-image-loader": "2.2.3",
|
||||
"dicom-parser": "1.8.3",
|
||||
"hammerjs": "^2.0.8",
|
||||
@ -24,7 +24,7 @@
|
||||
"react-router": "^4.3.1",
|
||||
"react-router-dom": "^4.3.1",
|
||||
"react-scripts": "^2.1.1",
|
||||
"react-viewerbase": "^0.1.9",
|
||||
"react-viewerbase": "^0.1.10",
|
||||
"redux": "^4.0.1",
|
||||
"redux-oidc": "^3.1.0"
|
||||
},
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { withRouter } from 'react-router';
|
||||
import { Route, Switch } from 'react-router-dom';
|
||||
import { connect } from 'react-redux';
|
||||
@ -21,10 +22,18 @@ function setContext(context) {
|
||||
context
|
||||
}
|
||||
});*/
|
||||
console.log(context);
|
||||
}
|
||||
|
||||
function LoadingUser() {
|
||||
return (<div>Loading user...</div>);
|
||||
}
|
||||
|
||||
class App extends Component {
|
||||
static propTypes = {
|
||||
history: PropTypes.object.isRequired,
|
||||
user: PropTypes.object
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.unlisten = this.props.history.listen((location, action) => {
|
||||
setContext(window.location.pathname);
|
||||
@ -40,7 +49,13 @@ class App extends Component {
|
||||
|
||||
if (!user || user.expired) {
|
||||
// TODO: redirect to OAuth page if necessary
|
||||
//return ('Loading user...');
|
||||
return <Switch>
|
||||
<Route path="/callback" component={CallbackPage} />
|
||||
<Route exact path='/login' component={() => {
|
||||
userManager.signinRedirect();
|
||||
}}/>
|
||||
<Route component={LoadingUser}/>
|
||||
</Switch>;
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@ -1,9 +1,14 @@
|
||||
import React from "react";
|
||||
import React, { Component } from "react";
|
||||
import { CallbackComponent } from "redux-oidc";
|
||||
import { withRouter } from "react-router-dom";
|
||||
import PropTypes from 'prop-types';
|
||||
import userManager from "./userManager";
|
||||
|
||||
class CallbackPage extends React.Component {
|
||||
class CallbackPage extends Component {
|
||||
static propTypes = {
|
||||
history: PropTypes.object
|
||||
}
|
||||
|
||||
render() {
|
||||
// just redirect to '/' in both cases
|
||||
return (
|
||||
@ -12,7 +17,7 @@ class CallbackPage extends React.Component {
|
||||
successCallback={() => this.props.history.push("/")}
|
||||
errorCallback={error => {
|
||||
this.props.history.push("/");
|
||||
console.error(error);
|
||||
throw new Error(error);
|
||||
}}
|
||||
>
|
||||
<div>Redirecting...</div>
|
||||
|
||||
@ -17,7 +17,6 @@ const mapStateToProps = state => {
|
||||
const mapDispatchToProps = dispatch => {
|
||||
return {
|
||||
setViewportActive: viewportIndex => {
|
||||
console.log(`setViewportActive: ${viewportIndex}`);
|
||||
dispatch(setViewportActive(viewportIndex))
|
||||
}
|
||||
};
|
||||
|
||||
@ -14,8 +14,6 @@ const mapDispatchToProps = dispatch => {
|
||||
return {
|
||||
// TODO: Change if layout switched becomes more complex
|
||||
onChange: selectedCell => {
|
||||
console.log(`setLayout: ${JSON.stringify(selectedCell)}`);
|
||||
|
||||
let viewports = [];
|
||||
const rows = selectedCell.row + 1;
|
||||
const columns = selectedCell.col + 1;
|
||||
|
||||
@ -16,7 +16,6 @@ const mapStateToProps = state => {
|
||||
const mapDispatchToProps = dispatch => {
|
||||
return {
|
||||
setToolActive: tool => {
|
||||
console.log(`setViewportActive: ${tool}`);
|
||||
dispatch(setToolActive(tool.command))
|
||||
}
|
||||
};
|
||||
|
||||
@ -21,8 +21,6 @@ class ToolbarRow extends Component {
|
||||
|
||||
onLeftSidebarValueChanged = (value) => {
|
||||
this.props.setLeftSidebarOpen(!!value);
|
||||
|
||||
console.log('value changed: ', value);
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
@ -96,7 +96,7 @@ class ViewerMain extends Component {
|
||||
cornerstone={cornerstone}
|
||||
cornerstoneTools={cornerstoneTools}
|
||||
/>);
|
||||
};
|
||||
}
|
||||
|
||||
setViewportData = ({viewportIndex, item}) => {
|
||||
// TODO: Replace this with mapDispatchToProps call
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
import React from 'react'
|
||||
import { Link, withRouter } from 'react-router-dom'
|
||||
import { Dropdown } from "../components"
|
||||
import Icons from "../images/icons.svg"
|
||||
import './Header.css'
|
||||
import list from './HeaderMenuList.json'
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Link, withRouter } from 'react-router-dom';
|
||||
import { Dropdown } from "../components";
|
||||
import Icons from "../images/icons.svg";
|
||||
import './Header.css';
|
||||
import list from './HeaderMenuList.json';
|
||||
|
||||
function Header({ home, lastStudy, location }) {
|
||||
function Header({ home, location }) {
|
||||
const { state } = location
|
||||
|
||||
return (
|
||||
@ -49,4 +50,13 @@ function Header({ home, lastStudy, location }) {
|
||||
)
|
||||
}
|
||||
|
||||
Header.propTypes = {
|
||||
home: PropTypes.bool.isRequired,
|
||||
location: PropTypes.object.isRequired
|
||||
};
|
||||
|
||||
Header.defaultProps = {
|
||||
home: true
|
||||
};
|
||||
|
||||
export default withRouter(Header)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import React, { Component } from "react";
|
||||
//import PropTypes from "prop-types";
|
||||
import PropTypes from "prop-types";
|
||||
import qs from 'query-string'
|
||||
import Viewer from "./Viewer/Viewer";
|
||||
import OHIF from 'ohif-core';
|
||||
@ -66,15 +66,15 @@ function parseQueryAndFetchStudies(query) {
|
||||
}
|
||||
|
||||
class StandaloneRouting extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
this.state = {
|
||||
studies: null,
|
||||
error: null
|
||||
};
|
||||
state = {
|
||||
studies: null,
|
||||
error: null
|
||||
}
|
||||
|
||||
static propTypes = {
|
||||
location: PropTypes.object
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
const query = qs.parse(this.props.location.search);
|
||||
parseQueryAndFetchStudies(query).then(studies => {
|
||||
|
||||
@ -6,18 +6,21 @@ import { StudyList } from "react-viewerbase";
|
||||
import Header from "./Header";
|
||||
|
||||
class StudyListWithData extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
state = {
|
||||
searchData: {},
|
||||
studies: null,
|
||||
error: null
|
||||
};
|
||||
|
||||
this.state = {
|
||||
searchData: {},
|
||||
studies: null,
|
||||
error: null
|
||||
};
|
||||
static propTypes = {
|
||||
patientId: PropTypes.string,
|
||||
server: PropTypes.object,
|
||||
user: PropTypes.object,
|
||||
history: PropTypes.object
|
||||
};
|
||||
|
||||
this.rowsPerPage = 20;
|
||||
this.defaultSort = { field: 'patientName', order: 'desc' };
|
||||
}
|
||||
static rowsPerPage = 25;
|
||||
static defaultSort = { field: 'patientName', order: 'desc' };
|
||||
|
||||
componentDidMount() {
|
||||
// TODO: Avoid using timepoints here
|
||||
@ -28,7 +31,7 @@ class StudyListWithData extends Component {
|
||||
|
||||
searchForStudies = (searchData = {
|
||||
currentPage: 0,
|
||||
rowsPerPage: this.rowsPerPage
|
||||
rowsPerPage: StudyListWithData.rowsPerPage
|
||||
}) => {
|
||||
const { server } = this.props;
|
||||
const filter = {
|
||||
@ -66,19 +69,15 @@ class StudyListWithData extends Component {
|
||||
error: true,
|
||||
});
|
||||
|
||||
console.error(error);
|
||||
throw new Error(error);
|
||||
});
|
||||
}
|
||||
|
||||
onImport = () => {
|
||||
console.log('onImport');
|
||||
//console.log('onImport');
|
||||
}
|
||||
|
||||
onSelectItem = (studyInstanceUID) => {
|
||||
console.log('onSelectItem');
|
||||
|
||||
console.log('studyInstanceUID');
|
||||
|
||||
this.props.history.push(`/viewer/${studyInstanceUID}`);
|
||||
}
|
||||
|
||||
@ -97,24 +96,18 @@ class StudyListWithData extends Component {
|
||||
const studyCount = this.state.studies ? this.state.studies.length : 0;
|
||||
|
||||
return (<>
|
||||
<Header home user={this.props.user}/>
|
||||
<Header home={true} user={this.props.user}/>
|
||||
<StudyList studies={this.state.studies}
|
||||
studyCount={studyCount}
|
||||
studyListFunctionsEnabled={false}
|
||||
onImport={this.onImport}
|
||||
onSelectItem={this.onSelectItem}
|
||||
pageSize={this.rowsPerPage}
|
||||
defaultSort={this.defaultSort}
|
||||
defaultSort={StudyListWithData.defaultSort}
|
||||
onSearch={this.onSearch} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
StudyListWithData.propTypes = {
|
||||
patientId: PropTypes.string,
|
||||
server: PropTypes.object,
|
||||
user: PropTypes.object
|
||||
};
|
||||
|
||||
export default withRouter(StudyListWithData);
|
||||
|
||||
@ -84,7 +84,7 @@ class Viewer extends Component {
|
||||
|
||||
render() {
|
||||
return (<>
|
||||
<Header />
|
||||
<Header home={false}/>
|
||||
<div className='viewerDialogs'>
|
||||
{/*<CineDialog/>*/}
|
||||
</div>
|
||||
|
||||
@ -5,13 +5,15 @@ import Viewer from "./Viewer/Viewer.js";
|
||||
import createDisplaySets from './lib/createDisplaySets.js';
|
||||
|
||||
class ViewerFromStudyData extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
static propTypes = {
|
||||
studyInstanceUids: PropTypes.array.isRequired,
|
||||
seriesInstanceUids: PropTypes.array,
|
||||
server: PropTypes.object
|
||||
};
|
||||
|
||||
this.state = {
|
||||
studies: null,
|
||||
error: null
|
||||
};
|
||||
state = {
|
||||
studies: null,
|
||||
error: null
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
@ -32,7 +34,7 @@ class ViewerFromStudyData extends Component {
|
||||
error: true,
|
||||
});
|
||||
|
||||
console.error(error);
|
||||
throw new Error(error);
|
||||
});
|
||||
|
||||
}
|
||||
@ -50,10 +52,4 @@ class ViewerFromStudyData extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
ViewerFromStudyData.propTypes = {
|
||||
studyInstanceUids: PropTypes.array.isRequired,
|
||||
seriesInstanceUids: PropTypes.array,
|
||||
server: PropTypes.object
|
||||
};
|
||||
|
||||
export default ViewerFromStudyData;
|
||||
|
||||
@ -7,6 +7,18 @@ class Dropdown extends Component {
|
||||
open: false
|
||||
}
|
||||
|
||||
static propTypes = {
|
||||
titleElement: PropTypes.node,
|
||||
title: PropTypes.string,
|
||||
align: PropTypes.oneOf(['left', 'center', 'right']),
|
||||
list: PropTypes.arrayOf(PropTypes.shape({
|
||||
title: PropTypes.string.isRequired,
|
||||
icon: PropTypes.string,
|
||||
onClick: PropTypes.func,
|
||||
link: PropTypes.string,
|
||||
}))
|
||||
};
|
||||
|
||||
renderList = () => {
|
||||
const { list, align } = this.props
|
||||
|
||||
@ -52,7 +64,9 @@ class Dropdown extends Component {
|
||||
renderTitleElement = () => {
|
||||
const { titleElement, title } = this.props
|
||||
|
||||
if (titleElement) return titleElement
|
||||
if (titleElement) {
|
||||
return titleElement;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
@ -92,15 +106,4 @@ class Dropdown extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
Dropdown.propTypes = {
|
||||
titleElement: PropTypes.node,
|
||||
align: PropTypes.oneOf(['left', 'center', 'right']),
|
||||
list: PropTypes.arrayOf(PropTypes.shape({
|
||||
title: PropTypes.string.isRequired,
|
||||
icon: PropTypes.string,
|
||||
onClick: PropTypes.func,
|
||||
link: PropTypes.string,
|
||||
}))
|
||||
};
|
||||
|
||||
export default Dropdown
|
||||
|
||||
@ -28,4 +28,4 @@ export function getWADORSImageId(instance, frame) {
|
||||
}
|
||||
|
||||
return `wadors:${uri}`;
|
||||
};
|
||||
}
|
||||
|
||||
@ -1,3 +1,6 @@
|
||||
import loglevel from 'loglevel';
|
||||
log = loglevel.getLogger('OHIFViewer');
|
||||
|
||||
const log = loglevel.getLogger('OHIFViewer');
|
||||
log.setLevel('info');
|
||||
|
||||
export default log;
|
||||
|
||||
@ -4,7 +4,6 @@ const defaultState = {
|
||||
}
|
||||
|
||||
const ui = (state = defaultState, action) => {
|
||||
console.log(action);
|
||||
switch (action.type) {
|
||||
case 'SET_LEFT_SIDEBAR_OPEN':
|
||||
return Object.assign({}, state, { leftSidebarOpen: action.state });
|
||||
|
||||
@ -2527,6 +2527,14 @@ cornerstone-tools@3.0.0-b.1471:
|
||||
"@babel/runtime" "7.1.2"
|
||||
cornerstone-math "^0.1.7"
|
||||
|
||||
cornerstone-tools@3.0.0-b.1512:
|
||||
version "3.0.0-b.1512"
|
||||
resolved "https://registry.yarnpkg.com/cornerstone-tools/-/cornerstone-tools-3.0.0-b.1512.tgz#64e60709b7b638c08d201313a5748aa6f5145337"
|
||||
integrity sha512-+lpoPJnTTkGq61XZzrNfAVhYJprBYqFZc++D0TgVUUOfAlXn5I016+cabfRQ/K65ecTfd8RitFK/LrIBUE7D2Q==
|
||||
dependencies:
|
||||
"@babel/runtime" "7.1.2"
|
||||
cornerstone-math "^0.1.7"
|
||||
|
||||
cornerstone-wado-image-loader@2.2.3:
|
||||
version "2.2.3"
|
||||
resolved "https://registry.yarnpkg.com/cornerstone-wado-image-loader/-/cornerstone-wado-image-loader-2.2.3.tgz#2d4c06b5c87cd9198b52906c48e2d9dd145de986"
|
||||
@ -8309,10 +8317,10 @@ react-bootstrap-modal@^4.2.0:
|
||||
react-overlays "^0.8.0"
|
||||
react-transition-group "^2.0.0"
|
||||
|
||||
react-cornerstone-viewport@^0.1.3:
|
||||
version "0.1.3"
|
||||
resolved "https://registry.yarnpkg.com/react-cornerstone-viewport/-/react-cornerstone-viewport-0.1.3.tgz#d0c3b6e0d1adde9b3282465ae3397428f76aaf52"
|
||||
integrity sha512-ZbnT8M6HZimPGtdIlc1qPg04RmzlOijsWXTVdBBTAWPg5PUqbdBShQRjv+KvciL4kb6I+77WPWpsxJ1+QEoV+w==
|
||||
react-cornerstone-viewport@^0.1.4:
|
||||
version "0.1.4"
|
||||
resolved "https://registry.yarnpkg.com/react-cornerstone-viewport/-/react-cornerstone-viewport-0.1.4.tgz#6e1e1e31cbfca28617d4aebddd591f3a13206382"
|
||||
integrity sha512-bowfkjKR/hdg+2nEQy2BJejjKIsudiedJrMKehygK2f0SI17w2FC8r8QJPysdykfwz1WuBouOlA0JJtfHzk+CQ==
|
||||
dependencies:
|
||||
cornerstone-core "2.2.8"
|
||||
cornerstone-math "0.1.7"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user