From 202b27f25190910796951a01c2f97a112c5846db Mon Sep 17 00:00:00 2001 From: Luis Bastiao Silva Date: Sat, 2 Jan 2021 00:37:15 +0000 Subject: [PATCH] Syntax improvement --- .../webapp/js/components/about/aboutView.js | 202 +++++++++--------- .../js/components/management/aetitleView.js | 68 +++--- .../components/management/managementView.js | 30 +-- .../js/components/management/pluginsView.js | 5 +- .../js/components/management/servicesView.js | 5 +- .../js/components/management/storageView.js | 9 +- .../management/transferOptionsView.js | 10 +- .../webapp/js/components/mixins/toastView.js | 10 +- .../webapp/js/components/search/exportView.js | 196 +++++++++-------- .../js/components/search/searchResult.jsx | 52 +++-- 10 files changed, 316 insertions(+), 271 deletions(-) diff --git a/dicoogle/src/main/resources/webapp/js/components/about/aboutView.js b/dicoogle/src/main/resources/webapp/js/components/about/aboutView.js index 9c3395bc1..f72d4efaa 100644 --- a/dicoogle/src/main/resources/webapp/js/components/about/aboutView.js +++ b/dicoogle/src/main/resources/webapp/js/components/about/aboutView.js @@ -24,112 +24,116 @@ const AboutView = React.createClass({ let versionNumber = this.state.version; var title =

Dicoogle PACS, version: {versionNumber}

; var licenses = ( - - - - dcm4che2 -
License: GPL - - - react.js+reflux -
License: BSD - - - Jetty -
License: GPL - -
-
+ + + + dcm4che2 +
License: GPL + + + react.js+reflux +
License: BSD + + + Jetty +
License: GPL + +
+
); var panelsInstance = ( -
- - Dicoogle is an open-source PACS archive software that replaces the traditional database model - with an extensible indexing and retrieval framework and provides easy - expansion of functionalities through the use of plug-ins. It was - designed to accommodate automatic information extraction, - indexing, and storage of all meta-data detected in medical images, without re-engineering or reconfiguration requirements, - thus overcoming the limitations of traditional DICOM query - services. By presenting the technical assets for plugin development - such as a Software Development Kit (SDK), - developers are free to expand the archive independently and - non-exclusively, without changes to the core platform. This extensible architecture of Dicoogle has enabled its use - in research and the healthcare industry, as many use cases can - be fulfilled in the same deployment -
-
+
+ + Dicoogle is an open-source PACS archive software that replaces the + traditional database model with an extensible indexing and retrieval + framework and provides easy expansion of functionalities through the + use of plug-ins. It was designed to accommodate automatic information + extraction, indexing, and storage of all meta-data detected in medical + images, without re-engineering or reconfiguration requirements, thus + overcoming the limitations of traditional DICOM query services. By + presenting the technical assets for plugin development such as a + Software Development Kit (SDK), developers are free to expand the + archive independently and non-exclusively, without changes to the core + platform. This extensible architecture of Dicoogle has enabled its use + in research and the healthcare industry, as many use cases can be + fulfilled in the same deployment +
+
- - {licenses} - Note: Although these are not the only components used, these are - considered the main ones. - + + {licenses} + Note: Although these are not the only components used, these are + considered the main ones. + - - This software is provided by the copyright holders and contributors - "as is" and any express or implied warranties, including, but not - limited to, the implied warranties of merchantability and fitness for - a particular purpose are disclaimed. In no event shall the copyright - owner or contributors be liable for any direct, indirect, incidental, - special, exemplary, or consequential damages (including, but not - limited to, procurement of substitute goods or services; loss of use, - data, or profits; or business interruption) however caused and on any - theory of liability, whether in contract, strict liability, or tort - (including negligence or otherwise) arising in any way out of the use - of this software, even if advised of the possibility of such damage. - - - As an open source software, Dicoogle can accept contributions from - developers around the world. Dicoogle OSS is led and supported by - Bioinformatics UA and - BMD Software. Please check{" "} + + This software is provided by the copyright holders and contributors + "as is" and any express or implied warranties, including, but not + limited to, the implied warranties of merchantability and fitness for + a particular purpose are disclaimed. In no event shall the copyright + owner or contributors be liable for any direct, indirect, incidental, + special, exemplary, or consequential damages (including, but not + limited to, procurement of substitute goods or services; loss of use, + data, or profits; or business interruption) however caused and on any + theory of liability, whether in contract, strict liability, or tort + (including negligence or otherwise) arising in any way out of the use + of this software, even if advised of the possibility of such damage. + + + As an open source software, Dicoogle can accept contributions from + developers around the world. Dicoogle OSS is led and supported by + Bioinformatics UA and{" "} + + BMD Software + . Please check{" "} + the Dicoogle website {" "} - or our{" "} - - GitHub repository - {" "} - for more information. -
- - - - - - - - - - - - -
-
- - - -
-
-
+ or our{" "} + + GitHub repository + {" "} + for more information. +
+ + + + + + + + + + + + +
+
+ + + +
+ +
); return panelsInstance; } diff --git a/dicoogle/src/main/resources/webapp/js/components/management/aetitleView.js b/dicoogle/src/main/resources/webapp/js/components/management/aetitleView.js index 6b62489d3..91b8a215e 100644 --- a/dicoogle/src/main/resources/webapp/js/components/management/aetitleView.js +++ b/dicoogle/src/main/resources/webapp/js/components/management/aetitleView.js @@ -25,25 +25,25 @@ const AETitleView = React.createClass({ AETitleActions.getAETitle(); }, - - _onChange(data) { - if (data.success && this.state.status === "done") { - this.props.showToastMessage("success", { title: "Saved" }); - } else if (data.success) { - this.setState({ - aetitleText: data.message, - status: "done" - }); - - } else { - this.setState({ - dirtyValue: true, - }); - - this.props.showToastMessage("error", { title: "Error", body: data.message }); - } - }, - + _onChange(data) { + if (data.success && this.state.status === "done") { + this.props.showToastMessage("success", { title: "Saved" }); + } else if (data.success) { + this.setState({ + aetitleText: data.message, + status: "done" + }); + } else { + this.setState({ + dirtyValue: true + }); + + this.props.showToastMessage("error", { + title: "Error", + body: data.message + }); + } + }, render() { if (this.state.status === "loading") { @@ -56,22 +56,22 @@ const AETitleView = React.createClass({ ); } - return ( -
-
-

AETitle

-
+ return ( +
+
+

AETitle

+
-
- -
-
- ); +
+ +
+
+ ); }, handleAETitleChange(aetitle) { diff --git a/dicoogle/src/main/resources/webapp/js/components/management/managementView.js b/dicoogle/src/main/resources/webapp/js/components/management/managementView.js index fec15a496..019b3ca8e 100644 --- a/dicoogle/src/main/resources/webapp/js/components/management/managementView.js +++ b/dicoogle/src/main/resources/webapp/js/components/management/managementView.js @@ -7,25 +7,27 @@ import { StorageView } from "../management/storageView"; import { ToastView } from "../mixins/toastView"; const ManagementView = React.createClass({ - getInitialState: function () { + getInitialState: function() { return { selectedtab: 0, showToast: false, - toastType: 'default', + toastType: "default", toastMessage: {} }; }, - showToastMessage: function (toastType, toastMessage) { - this.setState({ - showToast: true, - toastType, - toastMessage - }, - () => setTimeout(() => this.setState({ showToast: false }), 3000)); + showToastMessage: function(toastType, toastMessage) { + this.setState( + { + showToast: true, + toastType, + toastMessage + }, + () => setTimeout(() => this.setState({ showToast: false }), 3000) + ); }, - render: function () { + render: function() { var views = [ , , @@ -89,11 +91,15 @@ const ManagementView = React.createClass({ {views[this.state.selectedtab]} - + ); }, - onTabClicked: function (index) { + onTabClicked: function(index) { this.setState({ selectedtab: index }); } }); diff --git a/dicoogle/src/main/resources/webapp/js/components/management/pluginsView.js b/dicoogle/src/main/resources/webapp/js/components/management/pluginsView.js index 283c62981..4d14e281f 100644 --- a/dicoogle/src/main/resources/webapp/js/components/management/pluginsView.js +++ b/dicoogle/src/main/resources/webapp/js/components/management/pluginsView.js @@ -36,7 +36,10 @@ const PluginsView = React.createClass({ }); if (this.state.error) { - this.props.showToastMessage("error", { title: "Error", body: this.state.error }); + this.props.showToastMessage("error", { + title: "Error", + body: this.state.error + }); } else { this.props.showToastMessage("success", { title: "Saved" }); } diff --git a/dicoogle/src/main/resources/webapp/js/components/management/servicesView.js b/dicoogle/src/main/resources/webapp/js/components/management/servicesView.js index 3ea3f726f..36e17311c 100644 --- a/dicoogle/src/main/resources/webapp/js/components/management/servicesView.js +++ b/dicoogle/src/main/resources/webapp/js/components/management/servicesView.js @@ -48,7 +48,10 @@ const ServicesView = React.createClass({ _onChange(data) { if (data.error) { - this.props.showToastMessage("error", { title: "Error", body: data.error }); + this.props.showToastMessage("error", { + title: "Error", + body: data.error + }); return; } else if (!data.error && this.state.status === "done") { this.props.showToastMessage("success", { title: "Success" }); diff --git a/dicoogle/src/main/resources/webapp/js/components/management/storageView.js b/dicoogle/src/main/resources/webapp/js/components/management/storageView.js index b9ca77088..10219615e 100644 --- a/dicoogle/src/main/resources/webapp/js/components/management/storageView.js +++ b/dicoogle/src/main/resources/webapp/js/components/management/storageView.js @@ -179,13 +179,16 @@ const StorageView = React.createClass({ componentWillUnmount() { this.unsubscribe(); }, - _onChange: function (data) { + _onChange: function(data) { if (!data.success) { - this.props.showToastMessage("error", { title: "Error", body: data.status }); + this.props.showToastMessage("error", { + title: "Error", + body: data.status + }); } else if (!data.error && this.state.status === "done") { this.props.showToastMessage("success", { title: "Success" }); } - + this.setState({ data: data.data, status: "done" }); }, diff --git a/dicoogle/src/main/resources/webapp/js/components/management/transferOptionsView.js b/dicoogle/src/main/resources/webapp/js/components/management/transferOptionsView.js index b9c26f2f7..1fcd985e2 100644 --- a/dicoogle/src/main/resources/webapp/js/components/management/transferOptionsView.js +++ b/dicoogle/src/main/resources/webapp/js/components/management/transferOptionsView.js @@ -28,7 +28,10 @@ const TransferOptionsView = React.createClass({ _onChange(data) { //console.log(data); if (!data.success) { - this.props.showToastMessage("error", { title: "Error", body: data.status }); + this.props.showToastMessage("error", { + title: "Error", + body: data.status + }); } else if (data.success && this.state.status === "done") { this.props.showToastMessage("success", { title: "Saved" }); } @@ -107,7 +110,10 @@ const TransferOptionsView = React.createClass({
-
diff --git a/dicoogle/src/main/resources/webapp/js/components/mixins/toastView.js b/dicoogle/src/main/resources/webapp/js/components/mixins/toastView.js index 10d46df16..d60c7d5cf 100644 --- a/dicoogle/src/main/resources/webapp/js/components/mixins/toastView.js +++ b/dicoogle/src/main/resources/webapp/js/components/mixins/toastView.js @@ -11,7 +11,7 @@ const ToastView = React.createClass({ const transitionStyles = { entering: { - transition: `opacity 400ms ease-in-out`, + transition: `opacity 400ms ease-in-out` }, exiting: { transition: `opacity 400ms ease-in-out`, @@ -24,7 +24,7 @@ const ToastView = React.createClass({ return ( - {(state) => ( + {state => (

{message.title}

- {message.body && -
- {message.body} -
- } + {message.body &&
{message.body}
}
)} diff --git a/dicoogle/src/main/resources/webapp/js/components/search/exportView.js b/dicoogle/src/main/resources/webapp/js/components/search/exportView.js index 6cb2f1e2d..5b1971906 100644 --- a/dicoogle/src/main/resources/webapp/js/components/search/exportView.js +++ b/dicoogle/src/main/resources/webapp/js/components/search/exportView.js @@ -14,7 +14,7 @@ import { ExportStore } from "../../stores/exportStore"; import { ToastView } from "../mixins/toastView"; const ExportView = React.createClass({ - getInitialState: function () { + getInitialState: function() { return { fields: [], presets: [], @@ -30,18 +30,18 @@ const ExportView = React.createClass({ current: 0, showToast: false, - toastType: 'default', + toastType: "default", toastMessage: {} }; }, - componentWillMount: function () { + componentWillMount: function() { // Subscribe to the store. console.log("subscribe listener"); this.unsubscribe = ExportStore.listen(this._onChange); }, - componentDidMount: function () { + componentDidMount: function() { ExportActions.getFieldList(); ExportActions.getPresets(); }, @@ -50,16 +50,18 @@ const ExportView = React.createClass({ this.unsubscribe(); }, - showToastMessage: function (toastType, toastMessage) { - this.setState({ - showToast: true, - toastType, - toastMessage - }, - () => setTimeout(() => this.setState({ showToast: false }), 3000)); + showToastMessage: function(toastType, toastMessage) { + this.setState( + { + showToast: true, + toastType, + toastMessage + }, + () => setTimeout(() => this.setState({ showToast: false }), 3000) + ); }, - _onChange: function (data) { + _onChange: function(data) { if (!data.success) { this.setState({ status: "failed" @@ -102,89 +104,93 @@ const ExportView = React.createClass({ const { showToast, toastType, toastMessage } = this.state; return ( - - - Export to CSV - - - - Preset (optional): - + + + Fields to export: + + + + Inline fields to export (optional): + +
+