From 23db979ffa0dda727f4f54d5eb6f1ea01099366e Mon Sep 17 00:00:00 2001 From: leocouderc Date: Thu, 2 Jul 2020 16:47:17 +0200 Subject: [PATCH 01/15] ldap implementation --- BackEnd/controllers/options.js | 12 ++- BackEnd/model/Options.js | 25 ++++++ BackEnd/routes/index.js | 6 +- .../components/Admin/UserManagement/Ldap.js | 80 +++++++++++++++++++ .../Admin/UserManagement/UserManagement.js | 14 +++- .../components/Admin/UserManagement/Users.js | 2 +- FrontEnd/src/services/options.js | 44 +++++++++- 7 files changed, 173 insertions(+), 10 deletions(-) create mode 100644 FrontEnd/src/components/Admin/UserManagement/Ldap.js diff --git a/BackEnd/controllers/options.js b/BackEnd/controllers/options.js index fb0b988f3..c038118ef 100644 --- a/BackEnd/controllers/options.js +++ b/BackEnd/controllers/options.js @@ -24,4 +24,14 @@ var setOrthancServer = function (req, res) { res.end() } -module.exports = { changeSchedule, getSchedule, getOrthancServer, setOrthancServer } +var getMode = async function(req, res) { + const mode = await Options.getMode() + res.json(mode) +} + +var changeMode = async function(req, res) { + const mode = req.body.mode + Options.changeMode(mode) +} + +module.exports = { changeSchedule, getSchedule, getOrthancServer, setOrthancServer, getMode, changeMode } diff --git a/BackEnd/model/Options.js b/BackEnd/model/Options.js index 930f9c197..cbd1fb807 100644 --- a/BackEnd/model/Options.js +++ b/BackEnd/model/Options.js @@ -42,6 +42,31 @@ const Options = { } return Options.configSettings + }, + + getMode: async () => { + let mode + try { + mode = await db.Option.findOne() + + } catch (err) { + console.log(err) + } + + return mode.ldap + }, + + changeMode: async (mode) => { + + try { + await db.Option.upsert({ + id:1, + ldap: mode + }) + + } catch (err) { + console.log(err) + } } } diff --git a/BackEnd/routes/index.js b/BackEnd/routes/index.js index e9bc3fb3d..cefe370c3 100644 --- a/BackEnd/routes/index.js +++ b/BackEnd/routes/index.js @@ -5,7 +5,7 @@ require('express-async-errors') const { authentication, logOut } = require('../controllers/authentication') const { getRobotDetails, getAllRobotDetails, addRobotJob, validateRobotJob, deleteRobotJob, removeQueryFromJob, addAnonJob, getAnonJob, getDeleteJob, addDeleteJob } = require('../controllers/Robot2') -const { changeSchedule, getSchedule, getOrthancServer, setOrthancServer } = require('../controllers/options') +const { changeSchedule, getSchedule, getOrthancServer, setOrthancServer, getMode, changeMode } = require('../controllers/options') const { getParsedAnswer } = require('../controllers/query') const { reverseProxyGet, reverseProxyPost, reverseProxyPostUploadDicom, reverseProxyPut, reverseProxyPutPlainText, reverseProxyDelete } = require('../controllers/reverseProxy') const { getRoles, createRole, modifyRole, deleteRole, getPermission, getRoleFromToken } = require('../controllers/role') @@ -153,4 +153,8 @@ router.delete('/roles', userAdminMidelware, deleteRole) //token router.get('/token', userAuthMidelware, getRoleFromToken) +//Mode +router.get('/mode', userAdminMidelware, getMode) +router.put('/changeMode', userAdminMidelware, changeMode) + module.exports = router \ No newline at end of file diff --git a/FrontEnd/src/components/Admin/UserManagement/Ldap.js b/FrontEnd/src/components/Admin/UserManagement/Ldap.js new file mode 100644 index 000000000..c103adfba --- /dev/null +++ b/FrontEnd/src/components/Admin/UserManagement/Ldap.js @@ -0,0 +1,80 @@ +import React, { Component, Fragment } from "react" +import Toggle from 'react-toggle' +import apis from "../../../services/apis" + +class Ldap extends Component { + + state = { + check: false + } + + constructor(props) { + super(props) + this.changeMode=this.changeMode.bind(this) + } + + async getModeFromDB() { + return await apis.options.getMode() + } + + async componentWillMount() { + let value = await this.getModeFromDB() + console.log(value) + this.setState({check: value}) + } + + async changeMode() { + this.setState(prevState =>({check: !prevState.check})) + await apis.options.changeMode(!this.state.check) + } + + render() { + return ( + +

Distant Users Panel

+
+
+
+
LDAP/AD connexion
+
+
+ +
+
+
+
+
+ + +
+
+ + +
+
+
+
+ + +
+
+ + +
+
+
+
+ + +
+
+ +
+ +
+
+ ) + } +} + +export default Ldap; \ No newline at end of file diff --git a/FrontEnd/src/components/Admin/UserManagement/UserManagement.js b/FrontEnd/src/components/Admin/UserManagement/UserManagement.js index 6429b4388..9efd0dda9 100644 --- a/FrontEnd/src/components/Admin/UserManagement/UserManagement.js +++ b/FrontEnd/src/components/Admin/UserManagement/UserManagement.js @@ -2,6 +2,8 @@ import React, { Component } from 'react' import Users from './Users' import Roles from './Roles' +import Ldap from './Ldap' + class UserManagement extends Component { @@ -23,6 +25,9 @@ class UserManagement extends Component { case 'Roles': component = break + case 'Ldap': + component = + break default: break } @@ -41,11 +46,14 @@ class UserManagement extends Component {
diff --git a/FrontEnd/src/components/Admin/UserManagement/Users.js b/FrontEnd/src/components/Admin/UserManagement/Users.js index 05d21e6d6..722bc37dd 100644 --- a/FrontEnd/src/components/Admin/UserManagement/Users.js +++ b/FrontEnd/src/components/Admin/UserManagement/Users.js @@ -148,7 +148,7 @@ class Users extends Component { return (
-

Users Panel

+

Local Users Panel

{ + return fetch('/api/tools/shutdown', updateOptions(shutdownOrthancOption) ).then((answer) => { if (!answer.ok) {throw answer} return (answer.json()) }).catch((error) => { @@ -129,7 +129,7 @@ const Options = { method: 'GET' } - return fetch('api/tools/log-level', updateOptions(getVerbosityOption) ).then(response => { + return fetch('/api/tools/log-level', updateOptions(getVerbosityOption) ).then(response => { if (response.ok) { return response.text() } @@ -147,7 +147,7 @@ const Options = { body: value } - return fetch('api/tools/log-level', updateOptions(setVerbosityOption) ).then((answer) => { + return fetch('/api/tools/log-level', updateOptions(setVerbosityOption) ).then((answer) => { if (!answer.ok) {throw answer} toastifySuccess("Verbosity have been updated") }).catch((error) => { @@ -156,7 +156,7 @@ const Options = { }, getPlugins(){ - return fetch('api/plugins',updateOptions(optionPlugin)).then(response => { + return fetch('/api/plugins',updateOptions(optionPlugin)).then(response => { if (response.ok) { return response.json() } @@ -164,6 +164,42 @@ const Options = { }).catch(error => { toastifyError(error.statusText) }) + }, + + getMode() { + return fetch('/api/mode',updateOptions(optionPlugin)).then(response => { + if (response.ok) { + return response.json() + } + else throw response + }).catch(error => { + toastifyError(error.statusText) + }) + }, + + changeMode(mode) { + + const payload = { + mode: mode + } + + const changeModeOption = { + method: 'PUT', + headers: { + Accept: 'application/json', + 'Content-Type': 'application/json' + }, + body: JSON.stringify(payload) + } + + return fetch('/api/changeMode',updateOptions(changeModeOption)).then(response => { + if (response.ok) { + return response.json() + } + else throw response + }).catch(error => { + toastifyError(error.statusText) + }) } } From 72caf59360c99b0586769195262886591a7307d7 Mon Sep 17 00:00:00 2001 From: leocouderc Date: Fri, 3 Jul 2020 17:22:06 +0200 Subject: [PATCH 02/15] ldap add --- BackEnd/controllers/authentication.js | 2 +- BackEnd/database/models/role.js | 2 -- BackEnd/midelwares/authentication.js | 4 +-- BackEnd/model/Options.js | 2 +- .../components/Admin/UserManagement/Ldap.js | 35 ++++++++++++++----- 5 files changed, 30 insertions(+), 15 deletions(-) diff --git a/BackEnd/controllers/authentication.js b/BackEnd/controllers/authentication.js index 28627f5af..0f5b54366 100644 --- a/BackEnd/controllers/authentication.js +++ b/BackEnd/controllers/authentication.js @@ -11,7 +11,7 @@ authentication = async function (req, res) { let user = new Users(body.username) let infosUser = await user.getUserRight() - payload = { + let payload = { username: body.username, admin: infosUser.admin, import: infosUser.import, diff --git a/BackEnd/database/models/role.js b/BackEnd/database/models/role.js index 7c840e7d4..c980b90aa 100644 --- a/BackEnd/database/models/role.js +++ b/BackEnd/database/models/role.js @@ -1,7 +1,5 @@ 'use strict'; -const Users = require("../../model/Users"); - module.exports = (sequelize, DataTypes) => { const Role = sequelize.define('Role', { import: DataTypes.BOOLEAN, diff --git a/BackEnd/midelwares/authentication.js b/BackEnd/midelwares/authentication.js index 7bdb97f52..e0f8c0d57 100644 --- a/BackEnd/midelwares/authentication.js +++ b/BackEnd/midelwares/authentication.js @@ -31,11 +31,9 @@ function decode (req, res) { } const userAuthMidelware = function (req, res, next) { - - let decoded; try { - decoded = decode(req, res); + decode(req, res); } catch(err) { return } diff --git a/BackEnd/model/Options.js b/BackEnd/model/Options.js index cbd1fb807..ebd7d7f87 100644 --- a/BackEnd/model/Options.js +++ b/BackEnd/model/Options.js @@ -57,7 +57,7 @@ const Options = { }, changeMode: async (mode) => { - + try { await db.Option.upsert({ id:1, diff --git a/FrontEnd/src/components/Admin/UserManagement/Ldap.js b/FrontEnd/src/components/Admin/UserManagement/Ldap.js index c103adfba..df7ae44ab 100644 --- a/FrontEnd/src/components/Admin/UserManagement/Ldap.js +++ b/FrontEnd/src/components/Admin/UserManagement/Ldap.js @@ -1,11 +1,13 @@ import React, { Component, Fragment } from "react" import Toggle from 'react-toggle' import apis from "../../../services/apis" +import BootstrapTable from 'react-bootstrap-table-next'; class Ldap extends Component { state = { - check: false + check: false, + roles: [] } constructor(props) { @@ -28,6 +30,24 @@ class Ldap extends Component { await apis.options.changeMode(!this.state.check) } + columns = [ + { + dataField: 'groupName', + text: 'Group name', + sort: true + }, { + dataField: 'associedRole', + text: 'Associed role', + formatter: (cell, row, index) => { + } + }, { + dataField: 'delete', + text: 'Delete', + formatter: (cell, row, index) => { + } + } + ] + render() { return ( @@ -41,7 +61,7 @@ class Ldap extends Component {
-
+
@@ -63,14 +83,13 @@ class Ldap extends Component {
-
- - +
+ +
- -
- + ) From 29250ec0652ef4f5483250559ffbac45c7a82180 Mon Sep 17 00:00:00 2001 From: Sylvain berthier Date: Mon, 6 Jul 2020 10:15:49 +0200 Subject: [PATCH 03/15] debug user modify password --- .../Admin/UserManagement/InputPassword.js | 44 +++++++++++++++++++ .../components/Admin/UserManagement/Users.js | 40 +++++------------ 2 files changed, 56 insertions(+), 28 deletions(-) create mode 100644 FrontEnd/src/components/Admin/UserManagement/InputPassword.js diff --git a/FrontEnd/src/components/Admin/UserManagement/InputPassword.js b/FrontEnd/src/components/Admin/UserManagement/InputPassword.js new file mode 100644 index 000000000..024655f2b --- /dev/null +++ b/FrontEnd/src/components/Admin/UserManagement/InputPassword.js @@ -0,0 +1,44 @@ +import React, { Component } from 'react' + +class InputPassword extends Component { + + state = { + password: '' + } + + constructor(props){ + super(props) + this.changeListener = this.changeListener.bind(this) + this.saveListener = this.saveListener.bind(this) + } + + componentDidMount() { + this.setState({ + password: this.props.previousPassword + }) + } + + changeListener(event){ + if(event.target !== null){ + this.setState({ + password: event.target.value + }) + } + } + + saveListener(){ + this.props.onUpdate(this.getValue()) + } + + getValue(){ + return this.state.password + } + + render() { + return ( + + ); + } +} + +export default InputPassword; \ No newline at end of file diff --git a/FrontEnd/src/components/Admin/UserManagement/Users.js b/FrontEnd/src/components/Admin/UserManagement/Users.js index f853ae58d..824e2fba6 100644 --- a/FrontEnd/src/components/Admin/UserManagement/Users.js +++ b/FrontEnd/src/components/Admin/UserManagement/Users.js @@ -7,12 +7,12 @@ import cellEditFactory from 'react-bootstrap-table2-editor' import apis from '../../../services/apis'; import CreateUser from './CreateUser' +import InputPassword from './InputPassword' class Users extends Component { state = { - password: undefined, username: '', users: [], showDelete: false, @@ -24,7 +24,6 @@ class Users extends Component { constructor(props) { super(props) - this.handleChange = this.handleChange.bind(this) this.modify = this.modify.bind(this) this.delete = this.delete.bind(this) this.resetState = this.resetState.bind(this) @@ -37,7 +36,7 @@ class Users extends Component { answer.forEach((user) => { users.push({ ...user, - password: undefined + password: '' }) }) this.setState({ @@ -47,33 +46,18 @@ class Users extends Component { resetState(){ this.setState({ - password: undefined, showDelete: false }) this.getUsers() } - - handleChange(event) { - const target = event.target - const name = target.name - const value = target.value - this.setState({ - [name]: value - }) - } async modify(row){ - let payload = {} - if (this.state.password === ''){ + let payload = {...row} + if (row.password === ''){ payload = { - ...row, + ...payload, password: null } - } else { - payload = { - ...row, - password: this.state.password - } } await apis.User.modifyUser(payload).then(()=>{ this.resetState() @@ -115,13 +99,13 @@ class Users extends Component { sort: true }, { dataField: 'password', - text: 'New Password', - editable: false, - formatter: (cell, row, index) => { - return ( - - ) - } + text: 'New Password', + style: { + 'fontSize': '0px' + }, + editorRenderer: (editorProps, value, row, column, rowIndex, columnIndex) => ( + + ) }, { dataField: 'edit', text: 'Edit', From 97175f8151a0953151eacd1bc8b74f7d8e02e721 Mon Sep 17 00:00:00 2001 From: Sylvain berthier Date: Mon, 6 Jul 2020 10:22:26 +0200 Subject: [PATCH 04/15] #312 - fix --- FrontEnd/src/components/Anonymize/AnonymizePanel.js | 7 +++++++ .../src/components/Anonymize/AnonymizePanelProgress.js | 5 ++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/FrontEnd/src/components/Anonymize/AnonymizePanel.js b/FrontEnd/src/components/Anonymize/AnonymizePanel.js index 1ab45f1d5..929fb4238 100644 --- a/FrontEnd/src/components/Anonymize/AnonymizePanel.js +++ b/FrontEnd/src/components/Anonymize/AnonymizePanel.js @@ -26,6 +26,13 @@ class AnonymizePanel extends Component { this.testAllId = this.testAllId.bind(this) } + async componentDidMount() { + let robot = await apis.anon.getAnonJob(this.props.username) + if (robot.status !== 'Finished') + this.props.setProgress(true) + } + + getPatients(){ let patients = [] patients = studyArrayToPatientArray(this.props.anonList) diff --git a/FrontEnd/src/components/Anonymize/AnonymizePanelProgress.js b/FrontEnd/src/components/Anonymize/AnonymizePanelProgress.js index 253abe37c..c25eb693d 100644 --- a/FrontEnd/src/components/Anonymize/AnonymizePanelProgress.js +++ b/FrontEnd/src/components/Anonymize/AnonymizePanelProgress.js @@ -13,7 +13,8 @@ class AnonymizePanelProgress extends Component { show: false, success: 0, failures: 0 - } + } + constructor(props) { super(props); this.getInfo = this.getInfo.bind(this) @@ -64,10 +65,8 @@ class AnonymizePanelProgress extends Component { success: success, failures: failures }) - console.log(robot.status) if (robot.status === 'Finished') {this.stopMonitoring()} } - getStudiesAnonymized(){ let studies = [] From 382305f7eee9cc42d7cf6c9d9a32d8ea55bcb68d Mon Sep 17 00:00:00 2001 From: Sylvain berthier Date: Mon, 6 Jul 2020 10:51:05 +0200 Subject: [PATCH 05/15] AnonymizePanel #284 --- .../src/components/Anonymize/AnonProfile.js | 51 +++++++++++++++++++ .../components/Anonymize/AnonymizePanel.js | 30 ++--------- 2 files changed, 56 insertions(+), 25 deletions(-) create mode 100644 FrontEnd/src/components/Anonymize/AnonProfile.js diff --git a/FrontEnd/src/components/Anonymize/AnonProfile.js b/FrontEnd/src/components/Anonymize/AnonProfile.js new file mode 100644 index 000000000..dfb9ee040 --- /dev/null +++ b/FrontEnd/src/components/Anonymize/AnonProfile.js @@ -0,0 +1,51 @@ +import React, { Component } from 'react' +import { connect } from "react-redux" + +import Select from 'react-select' + +import { saveProfile } from '../../actions/AnonList' + +class AnonProfile extends Component { + state = { } + + + option = [ + {value: 'Default', label: 'Default'}, + {value: 'Full', label: 'Full'} + ] + + getProfileSelected(){ + let index = -1 + this.option.forEach(element => { + if (element.value === this.props.profile){ + index = this.option.indexOf(element) + } + }) + return this.option[index] + } + + render() { + return ( +
+
+ +
+
+ this.props.saveProfile(e.value)} placeholder='Profile' value={this.getProfileSelected()} /> +
+
@@ -207,8 +188,7 @@ const mapDispatchToProps = { emptyAnonymizeList, removePatientFromAnonList, removeStudyFromAnonList, - saveNewValues, - saveProfile, + saveNewValues, autoFill } From f5a455c43e2c93eb2f52b83d4df7a2acaa1ffc2f Mon Sep 17 00:00:00 2001 From: Sylvain berthier Date: Mon, 6 Jul 2020 10:54:44 +0200 Subject: [PATCH 06/15] Export Extern #313 --- FrontEnd/src/components/Admin/UserManagement/RoleForm.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/FrontEnd/src/components/Admin/UserManagement/RoleForm.js b/FrontEnd/src/components/Admin/UserManagement/RoleForm.js index 07408759d..1c1fdd92f 100644 --- a/FrontEnd/src/components/Admin/UserManagement/RoleForm.js +++ b/FrontEnd/src/components/Admin/UserManagement/RoleForm.js @@ -85,7 +85,7 @@ class RoleForm extends Component {
-
Export Local
+
Local Export
this.setState(prevState => ({exportLocal: !prevState.exportLocal}))}/> @@ -93,7 +93,7 @@ class RoleForm extends Component {
-
Export Extern
+
Remote Export
this.setState(prevState => ({exportExtern: !prevState.exportExtern}))}/> From 81f112117e2b8adcae7ac524f3c06df0c7056efa Mon Sep 17 00:00:00 2001 From: Sylvain berthier Date: Mon, 6 Jul 2020 11:26:17 +0200 Subject: [PATCH 07/15] #280 - Refact Admin --- .../src/components/Admin/{ => AET}/AetForm.js | 2 +- .../Admin/{ => AET}/AetRootPanel.js | 2 +- .../Admin/{ => AET}/AetsListTable.js | 2 +- .../src/components/Admin/AdminRootPanel.js | 10 +-- .../Admin/{ => Jobs}/JobsRootPanel.js | 59 +--------------- .../src/components/Admin/Jobs/ModalDetails.js | 67 +++++++++++++++++++ .../Admin/OrthancSettings/ModalRestart.js | 34 ++++++++++ .../Admin/OrthancSettings/ModalShutdown.js | 34 ++++++++++ .../{ => OrthancSettings}/OrthancSettings.js | 50 +++----------- .../components/Admin/{ => Peers}/PeerForm.js | 2 +- .../Admin/{ => Peers}/PeerListTable.js | 2 +- .../Admin/{ => Peers}/PeerRootPanel.js | 2 +- .../{ => Robots}/AutoRetrieveRootPanel.js | 0 .../{ => Robots}/AutoRetrieveSchedule.js | 2 +- .../Admin/{ => Robots}/RobotStatus.js | 2 +- 15 files changed, 159 insertions(+), 111 deletions(-) rename FrontEnd/src/components/Admin/{ => AET}/AetForm.js (98%) rename FrontEnd/src/components/Admin/{ => AET}/AetRootPanel.js (94%) rename FrontEnd/src/components/Admin/{ => AET}/AetsListTable.js (98%) rename FrontEnd/src/components/Admin/{ => Jobs}/JobsRootPanel.js (62%) create mode 100644 FrontEnd/src/components/Admin/Jobs/ModalDetails.js create mode 100644 FrontEnd/src/components/Admin/OrthancSettings/ModalRestart.js create mode 100644 FrontEnd/src/components/Admin/OrthancSettings/ModalShutdown.js rename FrontEnd/src/components/Admin/{ => OrthancSettings}/OrthancSettings.js (67%) rename FrontEnd/src/components/Admin/{ => Peers}/PeerForm.js (98%) rename FrontEnd/src/components/Admin/{ => Peers}/PeerListTable.js (98%) rename FrontEnd/src/components/Admin/{ => Peers}/PeerRootPanel.js (95%) rename FrontEnd/src/components/Admin/{ => Robots}/AutoRetrieveRootPanel.js (100%) rename FrontEnd/src/components/Admin/{ => Robots}/AutoRetrieveSchedule.js (97%) rename FrontEnd/src/components/Admin/{ => Robots}/RobotStatus.js (98%) diff --git a/FrontEnd/src/components/Admin/AetForm.js b/FrontEnd/src/components/Admin/AET/AetForm.js similarity index 98% rename from FrontEnd/src/components/Admin/AetForm.js rename to FrontEnd/src/components/Admin/AET/AetForm.js index ce038a56f..7f2c673ed 100644 --- a/FrontEnd/src/components/Admin/AetForm.js +++ b/FrontEnd/src/components/Admin/AET/AetForm.js @@ -1,6 +1,6 @@ import React, { Component, Fragment } from 'react' import Select from 'react-select' -import apis from '../../services/aets' +import apis from '../../../services/aets' /** * Form to declare or modify an AET diff --git a/FrontEnd/src/components/Admin/AetRootPanel.js b/FrontEnd/src/components/Admin/AET/AetRootPanel.js similarity index 94% rename from FrontEnd/src/components/Admin/AetRootPanel.js rename to FrontEnd/src/components/Admin/AET/AetRootPanel.js index c35fc3828..5868cb961 100644 --- a/FrontEnd/src/components/Admin/AetRootPanel.js +++ b/FrontEnd/src/components/Admin/AET/AetRootPanel.js @@ -1,7 +1,7 @@ import React, { useState, useEffect } from 'react' import Aets from './AetsListTable' import AetForm from './AetForm' -import apis from '../../services/apis' +import apis from '../../../services/apis' /** * Root Panel of AETs options diff --git a/FrontEnd/src/components/Admin/AetsListTable.js b/FrontEnd/src/components/Admin/AET/AetsListTable.js similarity index 98% rename from FrontEnd/src/components/Admin/AetsListTable.js rename to FrontEnd/src/components/Admin/AET/AetsListTable.js index feb8ac748..7f6ac6fb0 100644 --- a/FrontEnd/src/components/Admin/AetsListTable.js +++ b/FrontEnd/src/components/Admin/AET/AetsListTable.js @@ -1,6 +1,6 @@ import React, { Component, Fragment } from 'react' import BootstrapTable from 'react-bootstrap-table-next'; -import apis from '../../services/apis'; +import apis from '../../../services/apis'; /** * Table with known AETs details with Echo and Remove button diff --git a/FrontEnd/src/components/Admin/AdminRootPanel.js b/FrontEnd/src/components/Admin/AdminRootPanel.js index 153cf9bd1..aaf5c2350 100644 --- a/FrontEnd/src/components/Admin/AdminRootPanel.js +++ b/FrontEnd/src/components/Admin/AdminRootPanel.js @@ -1,9 +1,9 @@ import React, { useState } from 'react' -import OrthancSettings from './OrthancSettings' -import AetRootPanel from './AetRootPanel' -import AutoRetrieveRootPanel from './AutoRetrieveRootPanel' -import PeerRootPanel from './PeerRootPanel' -import JobsRootPanel from './JobsRootPanel' +import OrthancSettings from './OrthancSettings/OrthancSettings' +import AetRootPanel from './AET/AetRootPanel' +import AutoRetrieveRootPanel from './Robots/AutoRetrieveRootPanel' +import PeerRootPanel from './Peers/PeerRootPanel' +import JobsRootPanel from './Jobs/JobsRootPanel' import Plugins from './Plugins' import UserManagement from './UserManagement/UserManagement' diff --git a/FrontEnd/src/components/Admin/JobsRootPanel.js b/FrontEnd/src/components/Admin/Jobs/JobsRootPanel.js similarity index 62% rename from FrontEnd/src/components/Admin/JobsRootPanel.js rename to FrontEnd/src/components/Admin/Jobs/JobsRootPanel.js index e27510162..7d6140924 100644 --- a/FrontEnd/src/components/Admin/JobsRootPanel.js +++ b/FrontEnd/src/components/Admin/Jobs/JobsRootPanel.js @@ -2,9 +2,9 @@ import React, { Component, Fragment } from "react"; import BootstrapTable from "react-bootstrap-table-next"; import paginationFactory from "react-bootstrap-table2-paginator"; import Dropdown from "react-bootstrap/Dropdown"; -import Modal from "react-bootstrap/Modal"; -import apis from "../../services/apis"; +import apis from "../../../services/apis"; +import ModalDetails from './ModalDetails' class JobsRootPanel extends Component { @@ -65,39 +65,6 @@ class JobsRootPanel extends Component { ) } - columnDetails = [ - { - dataField: 'ID', - hidden: true - }, { - dataField: 'ErrorCode', - text: 'Error Code' - }, - { - dataField: 'ErrorDescription', - text: 'Error Description' - }, { - dataField: 'Priority', - text: 'Priority' - }, { - dataField: 'Type', - text: 'Type' - }, { - dataField: 'EffectiveRuntime', - text: 'Effective Runtime' - }, { - dataField: 'Content', - text: 'Details', - formatter: (cell, row, index) => { - return ( -
-                        {JSON.stringify(row.Content , null, 2)}
-                    
- ) - } - } - ] - column = [ { dataField: 'ID', @@ -130,27 +97,7 @@ class JobsRootPanel extends Component { return (

Jobs

- this.setState({showDetail: false})} size='xl'> - - Job Details - - - - - - - - + this.setState({showDetail: false})} data={[this.state.rows[this.state.currentRowIndex]]} /> { + return ( +
+                        {JSON.stringify(row.Content , null, 2)}
+                    
+ ) + } + } + ] + + render() { + return ( + + + Job Details + + + + + + + + + ); + } +} + +export default ModalDetails; \ No newline at end of file diff --git a/FrontEnd/src/components/Admin/OrthancSettings/ModalRestart.js b/FrontEnd/src/components/Admin/OrthancSettings/ModalRestart.js new file mode 100644 index 000000000..ee73a7948 --- /dev/null +++ b/FrontEnd/src/components/Admin/OrthancSettings/ModalRestart.js @@ -0,0 +1,34 @@ +import React, { Component } from 'react' +import Modal from 'react-bootstrap/Modal' + +import apis from '../../../services/apis' + +class ModalRestart extends Component { + + constructor(props){ + super(props) + this.reset = this.reset.bind(this) + } + + reset(){ + apis.options.resetOrthanc() + this.props.onHide() + } + + render() { + return ( + + + Confirm restart + + Are you sure to restart Orthanc system ? + + + + + + ); + } +} + +export default ModalRestart; \ No newline at end of file diff --git a/FrontEnd/src/components/Admin/OrthancSettings/ModalShutdown.js b/FrontEnd/src/components/Admin/OrthancSettings/ModalShutdown.js new file mode 100644 index 000000000..8c346e54e --- /dev/null +++ b/FrontEnd/src/components/Admin/OrthancSettings/ModalShutdown.js @@ -0,0 +1,34 @@ +import React, { Component } from 'react' +import Modal from 'react-bootstrap/Modal' + +import apis from '../../../services/apis' + +class ModalShutdown extends Component { + + constructor(props) { + super(props) + this.shutdown = this.shutdown.bind(this) + } + + shutdown(){ + apis.options.shutdownOrthanc() + this.props.onHide() + } + + render() { + return ( + + + Confirm Shutdown + + Are you sure to shutdown Orthanc system ? + + + + + + ); + } +} + +export default ModalShutdown; \ No newline at end of file diff --git a/FrontEnd/src/components/Admin/OrthancSettings.js b/FrontEnd/src/components/Admin/OrthancSettings/OrthancSettings.js similarity index 67% rename from FrontEnd/src/components/Admin/OrthancSettings.js rename to FrontEnd/src/components/Admin/OrthancSettings/OrthancSettings.js index f3cfcd47c..1883181ce 100644 --- a/FrontEnd/src/components/Admin/OrthancSettings.js +++ b/FrontEnd/src/components/Admin/OrthancSettings/OrthancSettings.js @@ -1,7 +1,9 @@ import React, { Component, Fragment } from 'react' -import apis from '../../services/apis'; +import apis from '../../../services/apis'; import Select from 'react-select' -import Modal from 'react-bootstrap/Modal' + +import ModalRestart from './ModalRestart' +import ModalShutdown from './ModalShutdown'; export default class OrthancSettings extends Component { @@ -22,10 +24,6 @@ export default class OrthancSettings extends Component { this.shutdown = this.shutdown.bind(this) this.handleChange = this.handleChange.bind(this) this.testConnexion = this.testConnexion.bind(this) - this.handleShowRestart = this.handleShowRestart.bind(this) - this.handleShowShutdown = this.handleShowShutdown.bind(this) - this.handleCloseRestart = this.handleCloseRestart.bind(this) - this.handleCloseShutdown = this.handleCloseShutdown.bind(this) this.changeListener = this.changeListener.bind(this) } @@ -85,20 +83,6 @@ export default class OrthancSettings extends Component { this.setState({optionSelected: event}) } - //PopUp to confirm restart and shutdown action - handleShowRestart(){ - this.setState({showRestart: true}) - } - handleCloseRestart(){ - this.setState({showRestart: false}) - } - handleCloseShutdown(){ - this.setState({showShutdown: false}) - } - handleShowShutdown(){ - this.setState({showShutdown: true}) - } - verbosities = [ { value: 'default', label: 'Default'}, { value: 'verbose', label: 'Verbose'}, @@ -132,28 +116,10 @@ export default class OrthancSettings extends Component {
- - - - Confirm restart - - Are you sure to restart Orthanc system ? - - - - - - - - - Confirm Shutdown - - Are you sure to shutdown Orthanc system ? - - - - - + this.setState({showRestart: true})} value='Restart' /> + this.setState({showRestart: false})} /> + this.setState({showShutdown: true})} value='Shutdown' /> + this.setState({showShutdown: false})} />
diff --git a/FrontEnd/src/components/Admin/PeerForm.js b/FrontEnd/src/components/Admin/Peers/PeerForm.js similarity index 98% rename from FrontEnd/src/components/Admin/PeerForm.js rename to FrontEnd/src/components/Admin/Peers/PeerForm.js index 1a9d22ab6..4f2a474b2 100644 --- a/FrontEnd/src/components/Admin/PeerForm.js +++ b/FrontEnd/src/components/Admin/Peers/PeerForm.js @@ -1,5 +1,5 @@ import React, {Component, Fragment} from 'react' -import apis from '../../services/apis' +import apis from '../../../services/apis' /** * Form to declare or modify an Orthanc Peer diff --git a/FrontEnd/src/components/Admin/PeerListTable.js b/FrontEnd/src/components/Admin/Peers/PeerListTable.js similarity index 98% rename from FrontEnd/src/components/Admin/PeerListTable.js rename to FrontEnd/src/components/Admin/Peers/PeerListTable.js index 1b71e31d1..21cec2811 100644 --- a/FrontEnd/src/components/Admin/PeerListTable.js +++ b/FrontEnd/src/components/Admin/Peers/PeerListTable.js @@ -1,6 +1,6 @@ import React, { Component, Fragment } from 'react' import BootstrapTable from 'react-bootstrap-table-next'; -import apis from '../../services/apis'; +import apis from '../../../services/apis'; /** * Table with known Peers details with Echo and Remove butto diff --git a/FrontEnd/src/components/Admin/PeerRootPanel.js b/FrontEnd/src/components/Admin/Peers/PeerRootPanel.js similarity index 95% rename from FrontEnd/src/components/Admin/PeerRootPanel.js rename to FrontEnd/src/components/Admin/Peers/PeerRootPanel.js index cf612c860..225c091e0 100644 --- a/FrontEnd/src/components/Admin/PeerRootPanel.js +++ b/FrontEnd/src/components/Admin/Peers/PeerRootPanel.js @@ -1,7 +1,7 @@ import React, { useState, useEffect, Fragment } from 'react' import PeerListTable from './PeerListTable' import PeerForm from './PeerForm' -import apis from '../../services/apis' +import apis from '../../../services/apis' /** * Root Panel of Peers options diff --git a/FrontEnd/src/components/Admin/AutoRetrieveRootPanel.js b/FrontEnd/src/components/Admin/Robots/AutoRetrieveRootPanel.js similarity index 100% rename from FrontEnd/src/components/Admin/AutoRetrieveRootPanel.js rename to FrontEnd/src/components/Admin/Robots/AutoRetrieveRootPanel.js diff --git a/FrontEnd/src/components/Admin/AutoRetrieveSchedule.js b/FrontEnd/src/components/Admin/Robots/AutoRetrieveSchedule.js similarity index 97% rename from FrontEnd/src/components/Admin/AutoRetrieveSchedule.js rename to FrontEnd/src/components/Admin/Robots/AutoRetrieveSchedule.js index fc46f259d..f2e697e09 100644 --- a/FrontEnd/src/components/Admin/AutoRetrieveSchedule.js +++ b/FrontEnd/src/components/Admin/Robots/AutoRetrieveSchedule.js @@ -1,5 +1,5 @@ import React, { Component } from 'react' -import apis from '../../services/apis'; +import apis from '../../../services/apis'; export default class AutoRetrieveSchedule extends Component { diff --git a/FrontEnd/src/components/Admin/RobotStatus.js b/FrontEnd/src/components/Admin/Robots/RobotStatus.js similarity index 98% rename from FrontEnd/src/components/Admin/RobotStatus.js rename to FrontEnd/src/components/Admin/Robots/RobotStatus.js index 645de64bc..4b9ab7dc2 100644 --- a/FrontEnd/src/components/Admin/RobotStatus.js +++ b/FrontEnd/src/components/Admin/Robots/RobotStatus.js @@ -1,7 +1,7 @@ import React, { Component } from 'react' import BootstrapTable from 'react-bootstrap-table-next'; import { Link } from 'react-router-dom' -import apis from '../../services/apis'; +import apis from '../../../services/apis'; export default class RobotStatus extends Component { From 51f2a97aac5d28842717bf4c269719f3506c4e5a Mon Sep 17 00:00:00 2001 From: Sylvain berthier Date: Mon, 6 Jul 2020 12:04:03 +0200 Subject: [PATCH 08/15] refactoring --- FrontEnd/src/components/Delete/Delete.js | 13 +- FrontEnd/src/components/Export/ExportPanel.js | 25 +--- .../src/components/Export/ModalWarning.js | 25 ++++ FrontEnd/src/components/Main/DeleteTool.js | 13 +- FrontEnd/src/components/Main/ModalDelete.js | 22 ++++ FrontEnd/src/components/Modify/ModalModify.js | 96 +++++++++++++++ FrontEnd/src/components/Modify/Modify.js | 112 ++++-------------- 7 files changed, 174 insertions(+), 132 deletions(-) create mode 100644 FrontEnd/src/components/Export/ModalWarning.js create mode 100644 FrontEnd/src/components/Main/ModalDelete.js create mode 100644 FrontEnd/src/components/Modify/ModalModify.js diff --git a/FrontEnd/src/components/Delete/Delete.js b/FrontEnd/src/components/Delete/Delete.js index d50e08b6a..11067bcef 100644 --- a/FrontEnd/src/components/Delete/Delete.js +++ b/FrontEnd/src/components/Delete/Delete.js @@ -7,8 +7,8 @@ import TablePatientsWithNestedStudies from '../CommonComponents/RessourcesDispla import { removePatientFromDeleteList, removeStudyFromDeleteList, emptyDeleteList } from '../../actions/DeleteList' import { removeOrthancContentStudy } from '../../actions/OrthancContent' import {studyArrayToPatientArray} from '../../tools/processResponse' -import Modal from 'react-bootstrap/Modal' import apis from '../../services/apis' +import ModalDelete from '../Main/ModalDelete'; class Delete extends Component { @@ -114,16 +114,7 @@ class Delete extends Component {
- - - Confirm Delete - - Are you sure to Delete the list - - - - - +
) diff --git a/FrontEnd/src/components/Export/ExportPanel.js b/FrontEnd/src/components/Export/ExportPanel.js index c7f446489..5268889fb 100644 --- a/FrontEnd/src/components/Export/ExportPanel.js +++ b/FrontEnd/src/components/Export/ExportPanel.js @@ -1,6 +1,5 @@ import React, { Component } from "react" import { connect } from "react-redux" -import Modal from "react-bootstrap/Modal" import apis from '../../services/apis' import TableStudy from '../CommonComponents/RessourcesDisplay/TableStudy' @@ -9,6 +8,7 @@ import DownloadDropdown from "./DownloadDropdown" import SendAetDropdown from "./SendAetDropdown" import SendPeerDropdown from "./SendPeerDropdown" import TranscodeSelector from './TranscodeSelector' +import ModalWarning from './ModalWarning' import { seriesArrayToStudyArray } from '../../tools/processResponse' import { emptyExportList, removeSeriesFromExportList, removeStudyFromExportList } from '../../actions/ExportList' @@ -30,7 +30,6 @@ class ExportPanel extends Component { this.removeSeries = this.removeSeries.bind(this) this.removeStudy = this.removeStudy.bind(this) this.confirm = this.confirm.bind(this) - this.setModal = this.setModal.bind(this) this.setButton = this.setButton.bind(this) } @@ -119,12 +118,6 @@ class ExportPanel extends Component { return answer } - setModal(){ - this.setState({ - show: !this.state.show - }) - } - setButton(button){ this.setState({ button: button @@ -169,7 +162,7 @@ class ExportPanel extends Component {
- + this.setState({show: true})} setButton={this.setButton} />
@@ -178,19 +171,7 @@ class ExportPanel extends Component {
- - - Confirm export - - - - Some studies are not anonymized ! - - - - {this.state.button} - - + this.setState({show: false})} button={this.state.button} />
) } diff --git a/FrontEnd/src/components/Export/ModalWarning.js b/FrontEnd/src/components/Export/ModalWarning.js new file mode 100644 index 000000000..089083d86 --- /dev/null +++ b/FrontEnd/src/components/Export/ModalWarning.js @@ -0,0 +1,25 @@ +import React, { Component } from 'react' +import Modal from 'react-bootstrap/Modal' + +class ModalWarning extends Component { + + render() { + return ( + + + Confirm export + + + + Some studies are not anonymized ! + + + + {this.props.button} + + + ); + } +} + +export default ModalWarning; \ No newline at end of file diff --git a/FrontEnd/src/components/Main/DeleteTool.js b/FrontEnd/src/components/Main/DeleteTool.js index 0b11212ad..af6b6b608 100644 --- a/FrontEnd/src/components/Main/DeleteTool.js +++ b/FrontEnd/src/components/Main/DeleteTool.js @@ -9,8 +9,8 @@ import TablePatientsWithNestedStudies from '../CommonComponents/RessourcesDispla import { removePatientFromDeleteList, removeStudyFromDeleteList, emptyDeleteList } from '../../actions/DeleteList' import { removeOrthancContentStudy } from '../../actions/OrthancContent' import {studyArrayToPatientArray} from '../../tools/processResponse' -import Modal from 'react-bootstrap/Modal' import apis from '../../services/apis' +import ModalDelete from './ModalDelete'; //Ce composant sera a connecter au redux pour connaitre la longueur de la liste de delete class DeleteTool extends Component { @@ -119,16 +119,7 @@ class DeleteTool extends Component { - - - Confirm Delete - - Are you sure to Delete the list - - - - - + ) diff --git a/FrontEnd/src/components/Main/ModalDelete.js b/FrontEnd/src/components/Main/ModalDelete.js new file mode 100644 index 000000000..9f5772b25 --- /dev/null +++ b/FrontEnd/src/components/Main/ModalDelete.js @@ -0,0 +1,22 @@ +import React, { Component } from 'react' +import Modal from 'react-bootstrap/Modal' + +class ModalDelete extends Component { + + render() { + return ( + + + Confirm Delete + + Are you sure to Delete the list + + + + + + ); + } +} + +export default ModalDelete; \ No newline at end of file diff --git a/FrontEnd/src/components/Modify/ModalModify.js b/FrontEnd/src/components/Modify/ModalModify.js new file mode 100644 index 000000000..05edf81f4 --- /dev/null +++ b/FrontEnd/src/components/Modify/ModalModify.js @@ -0,0 +1,96 @@ +import React, { Component } from 'react' +import Modal from 'react-bootstrap/Modal' +import BootstrapTable from 'react-bootstrap-table-next' +import cellEditFactory from 'react-bootstrap-table2-editor' + + +class ModalModify extends Component { + constructor(props) { + super(props); + this.state = { }; + } + + columns = [ + { + dataField: 'TagName', + text: 'Tag name', + sort: true, + }, { + dataField: 'Value', + text: 'Value', + sort: true, + } + ] + + selectRow = { + mode: 'checkbox', + style: {background: 'red'}, + nonSelectable: ['PatientID', 'SeriesTime', 'SeriesDate', 'Modality', 'StudyDate', 'StudyTime'], + selectionRenderer: ({ mode, checked, disabled }) => { + if (disabled) return 'Mendatory' + else return + }, + selectColumnPosition: 'right', + selectionHeaderRenderer: () => {return 'Delete'} + } + + render() { + return ( + e.stopPropagation()} size='xl'> + + Modify {this.props.level} + + + this.props.level === 'studies' ? ['PatientID'] : [] , + afterSaveCell: (oldValue, newValue, row, column) => { + this.props.afterSaveCell(oldValue, newValue, row, column) + } + }) } + selectRow={this.selectRow} + /> +
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+ + + + +
+ ); + } +} + +export default ModalModify; \ No newline at end of file diff --git a/FrontEnd/src/components/Modify/Modify.js b/FrontEnd/src/components/Modify/Modify.js index 12f1c6a0e..896373f7e 100644 --- a/FrontEnd/src/components/Modify/Modify.js +++ b/FrontEnd/src/components/Modify/Modify.js @@ -1,12 +1,10 @@ import React, { Component, Fragment, createRef } from 'react' -import Modal from 'react-bootstrap/Modal'; import apis from '../../services/apis'; -import BootstrapTable from 'react-bootstrap-table-next' -import cellEditFactory from 'react-bootstrap-table2-editor' import { toastifyError } from '../../services/toastify'; import { toast } from 'react-toastify'; import MonitorJob from '../../tools/MonitorJob' +import ModalModify from './ModalModify'; class Modify extends Component { @@ -23,6 +21,7 @@ class Modify extends Component { super(props) this.openModify = this.openModify.bind(this) this.onHide = this.onHide.bind(this) + this.afterSaveCell = this.afterSaveCell.bind(this) } updateToast(id, progress){ @@ -123,97 +122,34 @@ class Modify extends Component { }) } - handleClick(e){ - e.stopPropagation() - } - - columns = [ - { - dataField: 'TagName', - text: 'Tag name', - sort: true, - }, { - dataField: 'Value', - text: 'Value', - sort: true, - } - ] - - selectRow = { - mode: 'checkbox', - style: {background: 'red'}, - nonSelectable: ['PatientID', 'SeriesTime', 'SeriesDate', 'Modality', 'StudyDate', 'StudyTime'], - selectionRenderer: ({ mode, checked, disabled }) => { - if (disabled) return 'Mendatory' - else return - }, - selectColumnPosition: 'right', - selectionHeaderRenderer: () => {return 'Delete'} + afterSaveCell(oldValue, newValue, row, column){ + this.setState(prevState => ({ + modification: { + ...prevState.modification, + [row.TagName]: row.Value + } + })) } render() { return ( - - - - Modify {this.props.level} - - - this.node = n} - keyField='TagName' - data={this.state.data} - striped={true} - columns={this.columns} - wrapperClasses="table-responsive" - cellEdit={ cellEditFactory({ - blurToSave: true, - autoSelectText: true, - mode: 'click', - nonEditableRows: () => this.props.level === 'studies' ? ['PatientID'] : [] , - afterSaveCell: (oldValue, newValue, row, column) => { - this.setState(prevState => ({ - modification: { - ...prevState.modification, - [row.TagName]: row.Value - } - })) - } - }) } - selectRow={this.selectRow} - /> -
-
- -
-
- this.setState(prevState => ({removePrivateTags: !prevState.removePrivateTags}))} /> -
-
-
-
- -
-
- this.setState(prevState => ({keepSource: !prevState.keepSource}))} /> -
-
-
-
- -
-
- this.setState(prevState => ({remember: !prevState.remember}))} /> -
-
-
- - - - -
+ this.node = n} + show={this.state.show} + onHide={() => this.setState({show: false})} + data={this.state.data} + level={this.props.level} + afterSaveCell={this.afterSaveCell} + defaultCheckedPrivateTags={this.state.removePrivateTags} + onClickPrivateTags={() => this.setState(prevState => ({removePrivateTags: !prevState.removePrivateTags}))} + defaultCheckedKeepSource={this.state.keepSource} + onClickKeepSource={() => this.setState(prevState => ({keepSource: !prevState.keepSource}))} + defaultCheckedRemember={this.state.remember} + onClickRemember={() => this.setState(prevState => ({remember: !prevState.remember}))} + modify={() => this.modify()} + />
); } From cd36a07234c3c8c2400d56644e611b71ca3e9d34 Mon Sep 17 00:00:00 2001 From: leocouderc Date: Mon, 6 Jul 2020 15:17:48 +0200 Subject: [PATCH 09/15] import debug --- BackEnd/controllers/options.js | 3 ++- FrontEnd/src/components/Admin/UserManagement/Ldap.js | 1 - FrontEnd/src/components/Import/Import.js | 8 ++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/BackEnd/controllers/options.js b/BackEnd/controllers/options.js index c038118ef..58416c10f 100644 --- a/BackEnd/controllers/options.js +++ b/BackEnd/controllers/options.js @@ -30,8 +30,9 @@ var getMode = async function(req, res) { } var changeMode = async function(req, res) { - const mode = req.body.mode + const mode = await req.body.mode Options.changeMode(mode) + res.json(true) } module.exports = { changeSchedule, getSchedule, getOrthancServer, setOrthancServer, getMode, changeMode } diff --git a/FrontEnd/src/components/Admin/UserManagement/Ldap.js b/FrontEnd/src/components/Admin/UserManagement/Ldap.js index df7ae44ab..a281959c4 100644 --- a/FrontEnd/src/components/Admin/UserManagement/Ldap.js +++ b/FrontEnd/src/components/Admin/UserManagement/Ldap.js @@ -21,7 +21,6 @@ class Ldap extends Component { async componentWillMount() { let value = await this.getModeFromDB() - console.log(value) this.setState({check: value}) } diff --git a/FrontEnd/src/components/Import/Import.js b/FrontEnd/src/components/Import/Import.js index 59a2dee34..8fd4b2514 100644 --- a/FrontEnd/src/components/Import/Import.js +++ b/FrontEnd/src/components/Import/Import.js @@ -17,6 +17,8 @@ import {addStudiesToDeleteList} from '../../actions/DeleteList' import {addStudiesToAnonList} from '../../actions/AnonList' import { Prompt } from 'react-router-dom' +import updateOptions from '../../authorizedOption' + class Import extends Component { state = { @@ -43,7 +45,7 @@ class Import extends Component { allowMultipleUploads: true, }) - this.uppy.use(XHRUpload, { + let XHRUploadOption = { endpoint: '/api/instances', formData : false, limit : 1, @@ -51,7 +53,9 @@ class Import extends Component { 'Content-Type' : 'application/dicom', 'Accept': 'application/json' } - }) + } + + this.uppy.use(XHRUpload, updateOptions(XHRUploadOption)) this.uppy.on('upload-success', async (file, response) => { if(response.body.ID !== undefined){ From 29aa78013af9a16903b3cb9a218e52274db669c3 Mon Sep 17 00:00:00 2001 From: Sylvain berthier Date: Mon, 6 Jul 2020 15:31:04 +0200 Subject: [PATCH 10/15] debug anonymize panel --- FrontEnd/src/components/Anonymize/AnonymizePanel.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/FrontEnd/src/components/Anonymize/AnonymizePanel.js b/FrontEnd/src/components/Anonymize/AnonymizePanel.js index 4639936c4..22b533897 100644 --- a/FrontEnd/src/components/Anonymize/AnonymizePanel.js +++ b/FrontEnd/src/components/Anonymize/AnonymizePanel.js @@ -28,7 +28,8 @@ class AnonymizePanel extends Component { async componentDidMount() { let robot = await apis.anon.getAnonJob(this.props.username) - if (robot.status !== 'Finished') + console.log(robot) + if (robot.status && robot.status !== 'Finished') this.props.setProgress(true) } From 917a01089ae8ab5f695a868e383030736458e05f Mon Sep 17 00:00:00 2001 From: Sylvain berthier Date: Mon, 6 Jul 2020 15:49:08 +0200 Subject: [PATCH 11/15] debug anonymize panel --- FrontEnd/src/components/Anonymize/AnonymizePanel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FrontEnd/src/components/Anonymize/AnonymizePanel.js b/FrontEnd/src/components/Anonymize/AnonymizePanel.js index 4639936c4..c2912461a 100644 --- a/FrontEnd/src/components/Anonymize/AnonymizePanel.js +++ b/FrontEnd/src/components/Anonymize/AnonymizePanel.js @@ -28,7 +28,7 @@ class AnonymizePanel extends Component { async componentDidMount() { let robot = await apis.anon.getAnonJob(this.props.username) - if (robot.status !== 'Finished') + if (robot.status && robot.status !== 'Finished') this.props.setProgress(true) } From e6fee7fb35d7d86ca1e07a72204e956b36987900 Mon Sep 17 00:00:00 2001 From: Sylvain berthier Date: Mon, 6 Jul 2020 15:56:55 +0200 Subject: [PATCH 12/15] fix LGTM alerts --- FrontEnd/src/components/Admin/UserManagement/InputPassword.js | 4 ++++ FrontEnd/src/components/Anonymize/AnonymizePanel.js | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/FrontEnd/src/components/Admin/UserManagement/InputPassword.js b/FrontEnd/src/components/Admin/UserManagement/InputPassword.js index 024655f2b..9da3809e2 100644 --- a/FrontEnd/src/components/Admin/UserManagement/InputPassword.js +++ b/FrontEnd/src/components/Admin/UserManagement/InputPassword.js @@ -2,6 +2,10 @@ import React, { Component } from 'react' class InputPassword extends Component { + static defaultProps = { + previousPassword = '' + } + state = { password: '' } diff --git a/FrontEnd/src/components/Anonymize/AnonymizePanel.js b/FrontEnd/src/components/Anonymize/AnonymizePanel.js index 12faa5291..cd805fa9e 100644 --- a/FrontEnd/src/components/Anonymize/AnonymizePanel.js +++ b/FrontEnd/src/components/Anonymize/AnonymizePanel.js @@ -16,8 +16,7 @@ class AnonymizePanel extends Component { state = { currentPatient: '', - prefix: '', - progress: {} + prefix: '' } constructor(props) { From 6d0d5225a3cb01c2f8369424a273c93f127637bb Mon Sep 17 00:00:00 2001 From: Sylvain berthier Date: Mon, 6 Jul 2020 16:05:34 +0200 Subject: [PATCH 13/15] fix --- FrontEnd/src/components/Admin/UserManagement/InputPassword.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FrontEnd/src/components/Admin/UserManagement/InputPassword.js b/FrontEnd/src/components/Admin/UserManagement/InputPassword.js index 9da3809e2..35795b7ac 100644 --- a/FrontEnd/src/components/Admin/UserManagement/InputPassword.js +++ b/FrontEnd/src/components/Admin/UserManagement/InputPassword.js @@ -3,7 +3,7 @@ import React, { Component } from 'react' class InputPassword extends Component { static defaultProps = { - previousPassword = '' + previousPassword: '' } state = { From 0eac96d41461a54a7af310c73b113f7b5c8fc4ea Mon Sep 17 00:00:00 2001 From: Salim Kanoun Date: Fri, 10 Jul 2020 12:06:15 +0200 Subject: [PATCH 14/15] remove midelware for ohif --- BackEnd/routes/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/BackEnd/routes/index.js b/BackEnd/routes/index.js index cefe370c3..94ad2b7eb 100644 --- a/BackEnd/routes/index.js +++ b/BackEnd/routes/index.js @@ -104,8 +104,9 @@ router.get('/queries/:orthancIdQuery/parsedAnswers', queryMidelware, getParsedAn router.post('/instances', importMidelware, reverseProxyPostUploadDicom) // Orthanc DicomWebRoutes -router.get('/dicom-web/*', contentMidelware, reverseProxyGet) -router.get('/wado/*', contentMidelware, reverseProxyGet) +//SK ICI AJOUTER CONTENT MIDDELWARE QUAND OHIF POURRA INJECTER LE JWT DANS TOUTES LES REQUETES +router.get('/dicom-web/*', reverseProxyGet) +router.get('/wado/*', reverseProxyGet) //Orthanc export routes router.post('/tools/create-archive', exportLocalMidelware , reverseProxyPost ) From 7ab22f7ad17f52044e107ca13658b1091bee3dd6 Mon Sep 17 00:00:00 2001 From: Salim Kanoun Date: Fri, 10 Jul 2020 12:08:03 +0200 Subject: [PATCH 15/15] change version --- FrontEnd/src/components/Main/Footer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FrontEnd/src/components/Main/Footer.js b/FrontEnd/src/components/Main/Footer.js index 9624e9d9b..5d6086134 100644 --- a/FrontEnd/src/components/Main/Footer.js +++ b/FrontEnd/src/components/Main/Footer.js @@ -8,7 +8,7 @@ export default class Footer extends Component { render () { return ( -
Orthanc Tools JS: 0.2.2 +
Orthanc Tools JS: 0.3.2