reorganize packages, start converting overall app to react (very broken at the moment)
This commit is contained in:
1 parent
024fe1a448
commit
5f30f7bd35
479 files changed
+5364
-11611
No files matched your search
@@ -0,0 +1,4 @@
|
||||
#root {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
import React, { Component } from 'react';
|
||||
import { withRouter } from 'react-router';
|
||||
import { Route, Switch } from 'react-router-dom';
|
||||
import SecretRoute from './SecretRoute.js';
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
import Provider from "react-redux/es/components/Provider";
|
||||
import Viewer from "./viewer/viewer";
|
||||
import './App.css';
|
||||
|
||||
const reload = () => window.location.reload();
|
||||
const Studylist = OHIF.studylist.components.StudyList;
|
||||
@@ -30,36 +30,34 @@ class App extends Component {
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Provider store={window.store}>
|
||||
<Switch>
|
||||
<SecretRoute
|
||||
exact
|
||||
path="/studylist"
|
||||
component={Studylist}
|
||||
auth={this.props.auth}
|
||||
store={this.props.store}
|
||||
/>
|
||||
<SecretRoute
|
||||
exact
|
||||
path="/"
|
||||
component={Studylist}
|
||||
auth={this.props.auth}
|
||||
store={this.props.store}
|
||||
/>
|
||||
<SecretRoute
|
||||
exact
|
||||
path="/viewer"
|
||||
component={ConnectedViewer}
|
||||
auth={this.props.auth}
|
||||
store={this.props.store}
|
||||
/>
|
||||
{/*<Route path="/silent-refresh.html" onEnter={reload} />
|
||||
<Route path="/logout-redirect.html" onEnter={reload} />*/}
|
||||
<Route render={() =>
|
||||
<div> Sorry, this page does not exist. </div>}
|
||||
/>
|
||||
</Switch>
|
||||
</Provider>
|
||||
<Switch>
|
||||
<Route
|
||||
exact
|
||||
path="/studylist"
|
||||
component={Studylist}
|
||||
/*auth={this.props.auth}*/
|
||||
store={this.props.store}
|
||||
/>
|
||||
<Route
|
||||
exact
|
||||
path="/"
|
||||
component={Studylist}
|
||||
/*auth={this.props.auth}*/
|
||||
store={this.props.store}
|
||||
/>
|
||||
<Route
|
||||
exact
|
||||
path="/viewer"
|
||||
component={Viewer}
|
||||
/*auth={this.props.auth}*/
|
||||
store={this.props.store}
|
||||
/>
|
||||
{/*<Route path="/silent-refresh.html" onEnter={reload} />
|
||||
<Route path="/logout-redirect.html" onEnter={reload} />*/}
|
||||
<Route render={() =>
|
||||
<div> Sorry, this page does not exist. </div>}
|
||||
/>
|
||||
</Switch>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@require '{ohif:design}/app'
|
||||
@require '{ohif:viewerbase}/app'
|
||||
|
||||
.viewerSection
|
||||
display: flex
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { BrowserRouter } from 'react-router-dom';
|
||||
import { Provider } from 'react-redux';
|
||||
import { createStore } from 'redux';
|
||||
import App from './App.js';
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
|
||||
const store = createStore(OHIF.viewerbase.redux.combinedReducer);
|
||||
|
||||
// TODO[react] Use a provider when the whole tree is React
|
||||
window.store = store;
|
||||
|
||||
Meteor.startup(() => {
|
||||
ReactDOM.render(
|
||||
<Provider store={store}>
|
||||
<BrowserRouter>
|
||||
<App store={store}/>
|
||||
</BrowserRouter>
|
||||
</Provider>,
|
||||
document.getElementById('root')
|
||||
);
|
||||
});
|
||||
@@ -1,18 +1,11 @@
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { Template } from 'meteor/templating';
|
||||
import { Session } from 'meteor/session';
|
||||
import { Router } from 'meteor/clinical:router';
|
||||
import { ReactiveVar } from 'meteor/reactive-var';
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
|
||||
import { createStore } from 'redux';
|
||||
import Viewer from '../viewer/viewer.js';
|
||||
|
||||
const store = createStore(OHIF.viewerbase.redux.combinedReducer);
|
||||
|
||||
// TODO[react] Use a provider when the whole tree is React
|
||||
window.store = store;
|
||||
|
||||
Template.ohifViewer.onCreated(() => {
|
||||
const instance = Template.instance();
|
||||
instance.headerClasses = new ReactiveVar('');
|
||||
@@ -50,7 +43,7 @@ Template.ohifViewer.onCreated(() => {
|
||||
|
||||
OHIF.header.dropdown.setItems(headerItems);
|
||||
|
||||
instance.autorun(() => {
|
||||
/*instance.autorun(() => {
|
||||
const currentRoute = Router.current();
|
||||
if (!currentRoute) return;
|
||||
const routeName = currentRoute.route.getName();
|
||||
@@ -64,7 +57,7 @@ Template.ohifViewer.onCreated(() => {
|
||||
|
||||
// Set the viewer open state on session
|
||||
Session.set('ViewerOpened', isViewer);
|
||||
});
|
||||
});*/
|
||||
});
|
||||
|
||||
Template.ohifViewer.events({
|
||||
@@ -72,14 +65,14 @@ Template.ohifViewer.events({
|
||||
event.preventDefault();
|
||||
const isViewer = Session.get('ViewerOpened');
|
||||
|
||||
if (isViewer) {
|
||||
/*if (isViewer) {
|
||||
Router.go('studylist');
|
||||
} else {
|
||||
const { studyInstanceUids } = OHIF.viewer.data;
|
||||
if (studyInstanceUids) {
|
||||
Router.go('viewerStudies', { studyInstanceUids });
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@import "{ohif:design}/app"
|
||||
@import "{ohif:viewerbase}/app"
|
||||
|
||||
body>.header
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Template } from 'meteor/templating';
|
||||
import { $ } from 'meteor/jquery';
|
||||
import $ from 'jquery';
|
||||
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
import 'meteor/ohif:viewerbase';
|
||||
@@ -59,7 +59,7 @@ Template.toolbarSection.helpers({
|
||||
// bottomLabel: 'Hanging'
|
||||
// }]
|
||||
// };
|
||||
|
||||
|
||||
return {
|
||||
toggleable: true,
|
||||
key: 'rightSidebar',
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@require '{ohif:design}/app'
|
||||
@require '{ohif:viewerbase}/app'
|
||||
|
||||
.toolbarSection
|
||||
theme('border-bottom', '%s solid $uiBorderColor' % $uiBorderThickness)
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
import React, { Component } from "react";
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
import { MeasurementTable } from 'meteor/ohif:measurement-table';
|
||||
|
||||
@@ -6,11 +9,7 @@ import FlexboxLayout from '../flexboxLayout/flexboxLayout.js';
|
||||
|
||||
import 'meteor/ohif:cornerstone';
|
||||
import 'meteor/ohif:viewerbase';
|
||||
import 'meteor/ohif:metadata';
|
||||
|
||||
import PropTypes from "prop-types";
|
||||
import React, { Component } from "react";
|
||||
import { Provider } from 'react-redux';
|
||||
|
||||
/**
|
||||
* Inits OHIF Hanging Protocol's onReady.
|
||||
@@ -82,7 +81,6 @@ class Viewer extends Component {
|
||||
|
||||
// Define the OHIF.viewer.data global object
|
||||
OHIF.viewer.data = OHIF.viewer.data || {};
|
||||
debugger;
|
||||
|
||||
// @TypeSafeStudies
|
||||
// Clears OHIF.viewer.Studies collection
|
||||
@@ -93,7 +91,7 @@ class Viewer extends Component {
|
||||
OHIF.viewer.StudyMetadataList.removeAll();
|
||||
|
||||
OHIF.viewer.data.studyInstanceUids = [];
|
||||
|
||||
|
||||
const studies = this.props.studies;
|
||||
studies.forEach(study => {
|
||||
const studyMetadata = new OHIF.metadata.StudyMetadata(study, study.studyInstanceUid);
|
||||
@@ -137,7 +135,7 @@ class Viewer extends Component {
|
||||
}
|
||||
|
||||
Viewer.propTypes = {
|
||||
studies: PropTypes.array.isRequired
|
||||
studies: PropTypes.array
|
||||
};
|
||||
|
||||
export default Viewer;
|
||||
@@ -1,4 +1,4 @@
|
||||
@import "{ohif:design}/app"
|
||||
@import "{ohif:viewerbase}/app"
|
||||
|
||||
body
|
||||
background-color: black
|
||||
|
||||
Reference in new issue
Block a user