From 22fd2b2374f64870bc3b32a17e2fd3e22bf4e7df Mon Sep 17 00:00:00 2001 From: Fmazin Date: Fri, 27 Nov 2020 16:38:50 +0100 Subject: [PATCH 1/9] Added Preview Button to /createERC --- ui/src/components/createERC/CreateERC.js | 10 +++++- .../components/createERC/bindings/Bindings.js | 32 +++++++++++++------ .../createERC/requiredMetadata/Form.js | 21 ++++++++---- .../requiredMetadata/RequiredMetadata.js | 5 +-- .../SpatioTemporalMetadata.js | 23 +++++++++---- 5 files changed, 66 insertions(+), 25 deletions(-) diff --git a/ui/src/components/createERC/CreateERC.js b/ui/src/components/createERC/CreateERC.js index 2b501139..aa99c438 100644 --- a/ui/src/components/createERC/CreateERC.js +++ b/ui/src/components/createERC/CreateERC.js @@ -106,6 +106,11 @@ class CreateERC extends Component { }); } + goToPreview = () => { + let win = window.open('/#/erc/' + this.state.compendium_id); + win.focus(); + } + updateAuthors = async (value) => { var changed = true; @@ -177,6 +182,7 @@ class CreateERC extends Component { metadata={this.state.metadata} setMetadata={this.setMetadata} goToErc={this.goToErc} + goToPreview={this.goToPreview} originalMetadata={this.state.originalMetadata} authors={this.state.authors} authorsChanged={this.state.authorsChanged} @@ -196,6 +202,7 @@ class CreateERC extends Component { { @@ -243,4 +251,4 @@ class CreateERC extends Component { } } -export default CreateERC; \ No newline at end of file +export default CreateERC; diff --git a/ui/src/components/createERC/bindings/Bindings.js b/ui/src/components/createERC/bindings/Bindings.js index 21f3d041..6978dfbf 100644 --- a/ui/src/components/createERC/bindings/Bindings.js +++ b/ui/src/components/createERC/bindings/Bindings.js @@ -191,6 +191,8 @@ function VerticalLinearStepper(props) { const goToErc = () => props.goToErc(); + const goToPreview = () => props.goToPreview(); + return (
@@ -281,9 +283,14 @@ function VerticalLinearStepper(props) { - + {props.candidate + ? + : + } )}
@@ -473,7 +480,7 @@ class Bindings extends Component { } analyzeIfConditions = (analyzedCode, codelines) => { - + for (var codeItem of analyzedCode) { if (codeItem.type === "if" || codeItem.type === "while" ) { if(codeItem.code[0].func && codeItem.code[0].func.id ==="install.packages"){ @@ -531,8 +538,8 @@ class Bindings extends Component { /*handleMouseUp ( e ) { if (this.state.creationStep === 1) { try { - this.setCode(window.getSelection().getRangeAt(0).toString()); - } catch (error) { + this.setCode(window.getSelection().getRangeAt(0).toString()); + } catch (error) { } } else if (this.state.creationStep === 2) { this.setState({ @@ -628,13 +635,17 @@ class Bindings extends Component { saveErc = () => { this.props.setChangedFalse("all") this.props.updateMetadata(this.props.metadata, true) - + } goToErc= () => { this.props.goToErc(); } - + + goToPreview= () => { + this.props.goToPreview(); + } + clearBinding() { let state = this.state; //state.codeview=true; @@ -681,6 +692,7 @@ class Bindings extends Component { saveBinding={this.saveBinding.bind(this)} saveErc={this.saveErc.bind(this)} goToErc={this.goToErc.bind(this)} + goToPreview={this.goToPreview.bind(this)} candidate={this.props.candidate} clearBinding={this.clearBinding.bind(this)} figures={this.state.figures} @@ -729,7 +741,7 @@ class Bindings extends Component { - @@ -809,4 +821,4 @@ export default Bindings; } } } -*/ \ No newline at end of file +*/ diff --git a/ui/src/components/createERC/requiredMetadata/Form.js b/ui/src/components/createERC/requiredMetadata/Form.js index 6e0aac8a..4ab8c9ee 100644 --- a/ui/src/components/createERC/requiredMetadata/Form.js +++ b/ui/src/components/createERC/requiredMetadata/Form.js @@ -64,6 +64,7 @@ export const Form = props => { const goToErc = () => props.goToERC(); + const goToPreview = () => props.goToPreview(); const setMostRestrictive = () => { @@ -334,12 +335,20 @@ export const Form = props => { > Publish - + : + }
{errors.title ? errors.title : ""} @@ -367,4 +376,4 @@ export const Form = props => { ) -} \ No newline at end of file +} diff --git a/ui/src/components/createERC/requiredMetadata/RequiredMetadata.js b/ui/src/components/createERC/requiredMetadata/RequiredMetadata.js index ee03211b..47f4170e 100644 --- a/ui/src/components/createERC/requiredMetadata/RequiredMetadata.js +++ b/ui/src/components/createERC/requiredMetadata/RequiredMetadata.js @@ -102,7 +102,7 @@ class RequiredMetadata extends Component { codeLicense: this.props.originalMetadata.license.code, } - + componentDidMount() { prepareLicense(); refs2 = refs.splice(refs.length - this.props.authors.length, refs.length) @@ -179,6 +179,7 @@ class RequiredMetadata extends Component { setFormValues={this.setFormValues} resetAuthors={refs2} goToERC={this.props.goToErc} + goToPreview={this.props.goToPreview} spatioTemporalChanged={this.props.spatioTemporalChanged} authorsChanged={this.props.authorsChanged} changed={this.props.changed} @@ -190,7 +191,7 @@ class RequiredMetadata extends Component { dataLicenses={dataLicenses} mostRestrictiveData={mostRestrictiveData} leastRestrictiveData={leastRestrictiveData} - candidate={this.props.candidate} + candidate={this.props.candidate} showProgress={this.props.showProgress} />} initialValues={this.formValues} validationSchema={validationSchema} diff --git a/ui/src/components/createERC/spatioTemporalMetadata/SpatioTemporalMetadata.js b/ui/src/components/createERC/spatioTemporalMetadata/SpatioTemporalMetadata.js index 5d5bfb2d..d3456c39 100644 --- a/ui/src/components/createERC/spatioTemporalMetadata/SpatioTemporalMetadata.js +++ b/ui/src/components/createERC/spatioTemporalMetadata/SpatioTemporalMetadata.js @@ -49,6 +49,10 @@ class SpatioTemporalMetadata extends React.Component { this.props.goToErc() } + handlePreview = (e) => { + this.props.goToPreview() + } + handleSave = () => { this.props.setChangedFalse("all") this.props.setMetadata(this.props.metadata, true) @@ -309,12 +313,19 @@ class SpatioTemporalMetadata extends React.Component { > Publish - + {this.props.candidate + ? + : }
{!valid2 ? "Required Metadata is not valid" : ""}
From b01e61775f61c1e1e3b89fa9a4d4735e9f065018 Mon Sep 17 00:00:00 2001 From: Fmazin Date: Mon, 30 Nov 2020 18:10:12 +0100 Subject: [PATCH 2/9] Added detailed page titles and preview notice --- ui/src/components/app/App.js | 21 ++++++------ .../components/app/footerLinks/Impressum.js | 12 +++++-- ui/src/components/app/footerLinks/Privacy.js | 10 ++++-- ui/src/components/authorView/Author.js | 3 +- ui/src/components/createERC/CreateERC.js | 12 ++++--- ui/src/components/discovery/Discovery.js | 8 +++-- ui/src/components/erc/Check/Check.js | 1 + ui/src/components/erc/ERC.js | 13 +++++-- ui/src/components/erc/Inspect/Inspect.js | 34 +++++++++++-------- .../components/erc/Manipulate/Manipulate.js | 7 ++-- ui/src/components/erc/Metadata/Metadata.js | 3 +- .../erc/Substitution/Substitution.js | 1 + ui/src/components/erc/erc.css | 5 +++ ui/src/components/startpage/Startpage.js | 6 +++- ui/src/components/startpageDemo/Startpage.js | 7 +++- 15 files changed, 96 insertions(+), 47 deletions(-) diff --git a/ui/src/components/app/App.js b/ui/src/components/app/App.js index 0dcb8f8f..b450471f 100644 --- a/ui/src/components/app/App.js +++ b/ui/src/components/app/App.js @@ -18,7 +18,7 @@ import Discovery from '../discovery/Discovery'; import ERC from '../erc/ERC'; const Header = ( props ) => { - return ( + return ( @@ -35,22 +35,22 @@ const Header = ( props ) => { */} - {props.loggedIn ? + {props.loggedIn ? : ''} {/**/} - + ); }; @@ -96,20 +96,20 @@ class App extends Component { ) .catch(response => { console.log(response); - }); + }); } render() { return (
-
this.user()} userName={this.state.userName} - userOrcid={this.state.userOrcid}> + userOrcid={this.state.userOrcid}>
- +
@@ -131,4 +131,3 @@ class App extends Component { } export default App - diff --git a/ui/src/components/app/footerLinks/Impressum.js b/ui/src/components/app/footerLinks/Impressum.js index 6f4d18b5..9eaf8f11 100644 --- a/ui/src/components/app/footerLinks/Impressum.js +++ b/ui/src/components/app/footerLinks/Impressum.js @@ -1,13 +1,19 @@ import React, { Component } from "react"; class Impressum extends Component { + + componentDidMount(){ + document.title = "Impressum | o2r Demoserver" + + } + render() { return (

Impressum

Contact

- Westfälische Wilhelms-Universität Münster
+ Westfälische Wilhelms-Universität Münster
Institut für Geoinformatik - o2r Project Team
Heisenbergstraße 2
D-48149 Münster

@@ -16,7 +22,7 @@ class Impressum extends Component {

Notice of Liability

- Although we check the content carefully, we cannot accept responsibility for the content of external links. + Although we check the content carefully, we cannot accept responsibility for the content of external links. The linked sites’ carriers are responsible for their sites’ content.
@@ -24,4 +30,4 @@ class Impressum extends Component { } } -export default Impressum; \ No newline at end of file +export default Impressum; diff --git a/ui/src/components/app/footerLinks/Privacy.js b/ui/src/components/app/footerLinks/Privacy.js index c146c857..c5e21dce 100644 --- a/ui/src/components/app/footerLinks/Privacy.js +++ b/ui/src/components/app/footerLinks/Privacy.js @@ -1,8 +1,14 @@ import React, { Component } from "react"; class Privacy extends Component { + + componentDidMount(){ + document.title = "Privacy | o2r Demoserver" + + } + render() { - return ( + return (

Privacy Policy

User Data

@@ -40,4 +46,4 @@ class Privacy extends Component { } } -export default Privacy; \ No newline at end of file +export default Privacy; diff --git a/ui/src/components/authorView/Author.js b/ui/src/components/authorView/Author.js index cae73a4e..527eb064 100644 --- a/ui/src/components/authorView/Author.js +++ b/ui/src/components/authorView/Author.js @@ -16,6 +16,7 @@ class Author extends Component { } componentDidMount() { this.getCompendia(); + document.title = "Author View | o2r Demoserver" } goToErc = (erc) => { @@ -88,4 +89,4 @@ class Author extends Component { } } -export default Author; \ No newline at end of file +export default Author; diff --git a/ui/src/components/createERC/CreateERC.js b/ui/src/components/createERC/CreateERC.js index aa99c438..eb913981 100644 --- a/ui/src/components/createERC/CreateERC.js +++ b/ui/src/components/createERC/CreateERC.js @@ -35,7 +35,7 @@ class CreateERC extends Component { spatioTemporalChanged: false, authorsValid: false, candidate: true, - showProgress: false, + showProgress: false } } @@ -151,17 +151,21 @@ class CreateERC extends Component { this.setState({ authorsValid: valid }); }; - - componentDidMount = () => this.getMetadata(); + componentDidMount = () => { + this.getMetadata(); + document.title = "Create ERC | o2r Demoserver"; + } handleClose = () => { this.setState({ open: false }) + + } render() { const { value } = this.state; return ( -
+
{ const result = [] @@ -312,4 +316,4 @@ class Discovery extends Component { } } -export default Discovery; \ No newline at end of file +export default Discovery; diff --git a/ui/src/components/erc/Check/Check.js b/ui/src/components/erc/Check/Check.js index c7706e03..5f1780d7 100644 --- a/ui/src/components/erc/Check/Check.js +++ b/ui/src/components/erc/Check/Check.js @@ -181,6 +181,7 @@ class Check extends Component { componentDidMount() { this.getJobs(); + document.title = "Check | ERC " + this.props.id+ " | o2r Demoserver"; } render() { diff --git a/ui/src/components/erc/ERC.js b/ui/src/components/erc/ERC.js index d5bc469c..972df40d 100644 --- a/ui/src/components/erc/ERC.js +++ b/ui/src/components/erc/ERC.js @@ -31,12 +31,17 @@ class ERC extends React.Component { codefiles: null, tabValue: 0, html: true, - pdf: true + pdf: true, + isPreview: false }; this.handleClose = this.handleClose.bind(this); } - componentDidMount = () => { this.getMetadata(); this.props.history.replace(this.props.location.pathname) }; + componentDidMount = () => { + this.getMetadata(); + this.props.history.replace(this.props.location.pathname); + document.title = "ERC " + this.state.id+ " | o2r Demoserver"; + }; setDataFile(datafile) { @@ -164,7 +169,8 @@ class ERC extends React.Component { dataset: dataset, codefiles: data.codefiles, binding: data.interaction[0], - substituted: substituted + substituted: substituted, + isPreview: response.data.candidate }); self.setDisplayFile(data.displayfile); if (Array.isArray(data.inputfiles)) { @@ -211,6 +217,7 @@ class ERC extends React.Component { render() { return (
+ {this.state.isPreview ?

This is a preview! Changes from the create window will not be displayed.

: ""} diff --git a/ui/src/components/erc/Inspect/Inspect.js b/ui/src/components/erc/Inspect/Inspect.js index 6518c3b2..825cc40a 100644 --- a/ui/src/components/erc/Inspect/Inspect.js +++ b/ui/src/components/erc/Inspect/Inspect.js @@ -7,23 +7,27 @@ import SelectFile from './SelectFile/SelectFile'; class Inspect extends Component { + componentDidMount(){ + document.title = "Inspect | ERC " + this.props.state.id+ " | o2r Demoserver"; + } + render() { const props=this.props.state; return ( - {props.codefiles != null && props.codefile != null - ? :''} - {props.codefile != null - ? + {props.codefile != null + ? :
There is no data to display
}
@@ -31,11 +35,11 @@ class Inspect extends Component { {props.dataset != undefined && Array.isArray(props.datafiles) ? : ''} - {props.dataset != null - ? + id={props.id} + /> :
There is no data to display
}
@@ -43,4 +47,4 @@ class Inspect extends Component { } } -export default Inspect; \ No newline at end of file +export default Inspect; diff --git a/ui/src/components/erc/Manipulate/Manipulate.js b/ui/src/components/erc/Manipulate/Manipulate.js index e8d858b5..5b1b8f82 100644 --- a/ui/src/components/erc/Manipulate/Manipulate.js +++ b/ui/src/components/erc/Manipulate/Manipulate.js @@ -38,15 +38,16 @@ class Manipulate extends React.Component { if (this.state.bindings.length > 5) { this.setState({ variant: "scrollable" }) } + document.title = "Manipulate | ERC " + this.props.id+ " | o2r Demoserver"; } componentDidUpdate = (prevProps) => { if(JSON.stringify(this.props.bindings) !== JSON.stringify(prevProps.bindings)){ this.setState({bindings : this.props.bindings, binding: this.props.bindings[0], params: this.getParams(this.props.bindings[0].sourcecode.parameter)}, () => this.setParameter.bind(this)) - + } } - + runManipulateService() { const self = this; self.state.bindings.forEach((binding) => { @@ -273,4 +274,4 @@ class Manipulate extends React.Component { } } -export default Manipulate; \ No newline at end of file +export default Manipulate; diff --git a/ui/src/components/erc/Metadata/Metadata.js b/ui/src/components/erc/Metadata/Metadata.js index 4cc2fc55..cda9d6ff 100644 --- a/ui/src/components/erc/Metadata/Metadata.js +++ b/ui/src/components/erc/Metadata/Metadata.js @@ -16,6 +16,7 @@ class Metadata extends React.Component { componentDidMount() { ref2 = this.refs.map.leafletElement; ref2.fitBounds([this.metadata.spatial.union.bbox[0], this.metadata.spatial.union.bbox[2]]) + document.title = "Metadata | ERC " + this.props.id + " | o2r Demoserver" } goToErc = (id) => { @@ -94,4 +95,4 @@ class Metadata extends React.Component { } } -export default withRouter(Metadata); \ No newline at end of file +export default withRouter(Metadata); diff --git a/ui/src/components/erc/Substitution/Substitution.js b/ui/src/components/erc/Substitution/Substitution.js index d89a0712..b52da4dd 100644 --- a/ui/src/components/erc/Substitution/Substitution.js +++ b/ui/src/components/erc/Substitution/Substitution.js @@ -27,6 +27,7 @@ class Substitution extends React.Component { if (this.props.baseErcData.metadata.o2r.inputfiles.length !== 0) { this.getCompendia() } + document.title = "Substitution | ERC " + this.props.id + " | o2r Demoserver" } getCompendia = () => { diff --git a/ui/src/components/erc/erc.css b/ui/src/components/erc/erc.css index a94f4d92..f92596c0 100644 --- a/ui/src/components/erc/erc.css +++ b/ui/src/components/erc/erc.css @@ -1,3 +1,8 @@ .Erc { text-align: center; } + +#PreviewNotice{ + color: white; + background-color: orange; +} diff --git a/ui/src/components/startpage/Startpage.js b/ui/src/components/startpage/Startpage.js index 139e9105..5934ec77 100644 --- a/ui/src/components/startpage/Startpage.js +++ b/ui/src/components/startpage/Startpage.js @@ -10,6 +10,10 @@ class Startpage extends Component { spacing: "10" }; + componentDidMount(){ + document.title = "Home | o2r Deno Server" + } + render() { const { spacing } = this.state; @@ -28,7 +32,7 @@ class Startpage extends Component { - + diff --git a/ui/src/components/startpageDemo/Startpage.js b/ui/src/components/startpageDemo/Startpage.js index 30f9c630..8269574b 100644 --- a/ui/src/components/startpageDemo/Startpage.js +++ b/ui/src/components/startpageDemo/Startpage.js @@ -9,6 +9,11 @@ class Startpage extends Component { spacing: "10" }; + componentDidMount(){ + document.title = "Home | o2r Demo Server" + } + + render() { const { spacing } = this.state; @@ -42,4 +47,4 @@ class Startpage extends Component { } } -export default Startpage; \ No newline at end of file +export default Startpage; From cad28ec7b81576ae5cdbee80010b40f581bed1c7 Mon Sep 17 00:00:00 2001 From: Fmazin Date: Fri, 4 Dec 2020 16:36:47 +0100 Subject: [PATCH 3/9] Updated preview notice style --- ui/src/components/erc/erc.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/src/components/erc/erc.css b/ui/src/components/erc/erc.css index f92596c0..06edb7ca 100644 --- a/ui/src/components/erc/erc.css +++ b/ui/src/components/erc/erc.css @@ -5,4 +5,7 @@ #PreviewNotice{ color: white; background-color: orange; + margin-left: 30%; + margin-right: 30%; + padding: 20px; } From f0c15a243097a7d0011526d7ce11d3e24776873f Mon Sep 17 00:00:00 2001 From: Fmazin Date: Mon, 7 Dec 2020 16:53:13 +0100 Subject: [PATCH 4/9] Added disable sync scorll in result view --- .../erc/Check/Comparison/Comparison.js | 74 ++++++++++++------- .../erc/Check/Comparison/comparison.css | 7 +- 2 files changed, 55 insertions(+), 26 deletions(-) diff --git a/ui/src/components/erc/Check/Comparison/Comparison.js b/ui/src/components/erc/Check/Comparison/Comparison.js index f9b22139..690e6614 100644 --- a/ui/src/components/erc/Check/Comparison/Comparison.js +++ b/ui/src/components/erc/Check/Comparison/Comparison.js @@ -26,6 +26,7 @@ class Comparison extends Component { if (this.props.location.search === '?result') { self.setState({ open: true }) } + document.title = "Comparison | ERC " + this.state.job.compendium_id + " | o2r Demoserver " } handleClickOpen = () => { @@ -36,29 +37,46 @@ class Comparison extends Component { window.history.back(); } - dialogEntered = () => { - // TODO allow to disable synched scrolling - if (this.state.job.status === 'success') { - $("#frame1").contents().scroll(function () { - $("#frame2").contents().scrollTop($("#frame1").contents().scrollTop()); - }); - $("#frame2").contents().scroll(function () { - $("#frame1").contents().scrollTop($("#frame2").contents().scrollTop()); - }); - } - else { - $("#frame1").contents().scroll(function () { - $("#frame2").contents().scrollTop($("#frame1").contents().scrollTop()); - $("#frame3").contents().scrollTop($("#frame1").contents().scrollTop()); - }); - $("#frame2").contents().scroll(function () { - $("#frame1").contents().scrollTop($("#frame2").contents().scrollTop()); - $("#frame3").contents().scrollTop($("#frame2").contents().scrollTop()); - }); - $("#frame3").contents().scroll(function () { - $("#frame1").contents().scrollTop($("#frame3").contents().scrollTop()); - $("#frame2").contents().scrollTop($("#frame3").contents().scrollTop()); - }); + activateScroll = () => { + + if (this.state.job.status === 'success') { + $("#frame1").contents().scroll(function () { + $("#frame2").contents().scrollTop($("#frame1").contents().scrollTop()); + }); + $("#frame2").contents().scroll(function () { + $("#frame1").contents().scrollTop($("#frame2").contents().scrollTop()); + }); + } + else { + $("#frame1").contents().scroll(function () { + $("#frame2").contents().scrollTop($("#frame1").contents().scrollTop()); + $("#frame3").contents().scrollTop($("#frame1").contents().scrollTop()); + }); + $("#frame2").contents().scroll(function () { + $("#frame1").contents().scrollTop($("#frame2").contents().scrollTop()); + $("#frame3").contents().scrollTop($("#frame2").contents().scrollTop()); + }); + $("#frame3").contents().scroll(function () { + $("#frame1").contents().scrollTop($("#frame3").contents().scrollTop()); + $("#frame2").contents().scrollTop($("#frame3").contents().scrollTop()); + }); + } + } + + deactivateScroll = () => { + $("#frame1").contents().off( "scroll" ); + $("#frame2").contents().off( "scroll" ); + $("#frame3").contents().off( "scroll" ); + } + + handleCheck = () => { + let checked = $('.checkScroll').prop("checked"); + console.log(checked); + if(checked){ + this.deactivateScroll(); + } + else{ + this.activateScroll(); } } @@ -76,7 +94,7 @@ class Comparison extends Component { @@ -101,6 +119,12 @@ class Comparison extends Component {

To use synchronised scrolling in Firefox, move the cursor to the leftmost document.

+
+ +
} @@ -109,4 +133,4 @@ class Comparison extends Component { } } -export default withRouter(Comparison); \ No newline at end of file +export default withRouter(Comparison); diff --git a/ui/src/components/erc/Check/Comparison/comparison.css b/ui/src/components/erc/Check/Comparison/comparison.css index 33381a54..6c01ac55 100644 --- a/ui/src/components/erc/Check/Comparison/comparison.css +++ b/ui/src/components/erc/Check/Comparison/comparison.css @@ -32,4 +32,9 @@ color: #004286; width: 48%; float: left; -} \ No newline at end of file +} + +.checkScroll{ + color: #004286; + margin-top: 1.5%; +} From c3460830886eb865b0040aa550100a59d17d161c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20N=C3=BCst?= Date: Tue, 8 Dec 2020 09:27:05 +0100 Subject: [PATCH 5/9] Update erc.css --- ui/src/components/erc/erc.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/components/erc/erc.css b/ui/src/components/erc/erc.css index 06edb7ca..644cda0d 100644 --- a/ui/src/components/erc/erc.css +++ b/ui/src/components/erc/erc.css @@ -2,7 +2,7 @@ text-align: center; } -#PreviewNotice{ +#PreviewNotice { color: white; background-color: orange; margin-left: 30%; From 03680d383ffa68ed31cb9c8d7c548982ba31dc85 Mon Sep 17 00:00:00 2001 From: Fmazin Date: Mon, 21 Dec 2020 15:13:05 +0100 Subject: [PATCH 6/9] Fixed Titles, Reworked disable sync scroll feature --- .../components/app/footerLinks/Impressum.js | 3 ++- ui/src/components/app/footerLinks/Privacy.js | 3 ++- ui/src/components/authorView/Author.js | 3 ++- ui/src/components/createERC/CreateERC.js | 4 +-- ui/src/components/discovery/Discovery.js | 3 ++- ui/src/components/erc/Check/Check.js | 2 +- .../erc/Check/Comparison/Comparison.js | 27 ++++++++++--------- .../erc/Check/Comparison/comparison.css | 3 +-- ui/src/components/erc/ERC.js | 4 +-- ui/src/components/erc/Inspect/Inspect.js | 3 ++- .../components/erc/Manipulate/Manipulate.js | 2 +- ui/src/components/erc/Metadata/Metadata.js | 5 ++-- .../erc/Substitution/Substitution.js | 3 ++- ui/src/components/erc/erc.css | 2 +- ui/src/components/startpage/Startpage.js | 3 ++- ui/src/components/startpageDemo/Startpage.js | 3 ++- ui/src/helpers/config.json | 5 ++-- ui/src/helpers/theme.js | 5 +++- 18 files changed, 49 insertions(+), 34 deletions(-) diff --git a/ui/src/components/app/footerLinks/Impressum.js b/ui/src/components/app/footerLinks/Impressum.js index 9eaf8f11..6ae494d1 100644 --- a/ui/src/components/app/footerLinks/Impressum.js +++ b/ui/src/components/app/footerLinks/Impressum.js @@ -1,9 +1,10 @@ import React, { Component } from "react"; +import config from '../../../helpers/config'; class Impressum extends Component { componentDidMount(){ - document.title = "Impressum | o2r Demoserver" + document.title = "Impressum" + config.title; } diff --git a/ui/src/components/app/footerLinks/Privacy.js b/ui/src/components/app/footerLinks/Privacy.js index c5e21dce..be3530cd 100644 --- a/ui/src/components/app/footerLinks/Privacy.js +++ b/ui/src/components/app/footerLinks/Privacy.js @@ -1,9 +1,10 @@ import React, { Component } from "react"; +import config from '../../../helpers/config'; class Privacy extends Component { componentDidMount(){ - document.title = "Privacy | o2r Demoserver" + document.title = "Privacy" + config.title; } diff --git a/ui/src/components/authorView/Author.js b/ui/src/components/authorView/Author.js index 527eb064..00c40da9 100644 --- a/ui/src/components/authorView/Author.js +++ b/ui/src/components/authorView/Author.js @@ -3,6 +3,7 @@ import React, { Component } from "react"; import httpRequests from '../../helpers/httpRequests'; import ResultList from './resultList' import { Grid, Paper } from "@material-ui/core"; +import config from '../../helpers/config'; class Author extends Component { @@ -16,7 +17,7 @@ class Author extends Component { } componentDidMount() { this.getCompendia(); - document.title = "Author View | o2r Demoserver" + document.title = "Author View" + config.title; } goToErc = (erc) => { diff --git a/ui/src/components/createERC/CreateERC.js b/ui/src/components/createERC/CreateERC.js index eb913981..396b950e 100644 --- a/ui/src/components/createERC/CreateERC.js +++ b/ui/src/components/createERC/CreateERC.js @@ -7,7 +7,7 @@ import RequiredMetadata from './requiredMetadata/RequiredMetadata'; import SpatioTemporalMetadata from './spatioTemporalMetadata/SpatioTemporalMetadata'; import Bindings from './bindings/Bindings'; import httpRequests from '../../helpers/httpRequests'; - +import config from '../../helpers/config'; function TabContainer(props) { @@ -153,7 +153,7 @@ class CreateERC extends Component { componentDidMount = () => { this.getMetadata(); - document.title = "Create ERC | o2r Demoserver"; + document.title = "Create ERC" + config.title; } handleClose = () => { diff --git a/ui/src/components/discovery/Discovery.js b/ui/src/components/discovery/Discovery.js index ed75cb44..cb94bfad 100644 --- a/ui/src/components/discovery/Discovery.js +++ b/ui/src/components/discovery/Discovery.js @@ -6,6 +6,7 @@ import L from 'leaflet' import prepareQuery from './/queryBuilder' import OwnMap, { ref, ref2 } from "./Map" import ResultList from './resultList' +import config from '../../helpers/config'; import './discovery.css' @@ -30,7 +31,7 @@ class Discovery extends Component { componentDidMount() { this.searchCompendia(); this.calculateDateRange(); - document.title = "Discover | o2r Demo Server" + document.title = "Discover" + config.title; } calculateDateRange = () => { diff --git a/ui/src/components/erc/Check/Check.js b/ui/src/components/erc/Check/Check.js index 5f1780d7..afb5519c 100644 --- a/ui/src/components/erc/Check/Check.js +++ b/ui/src/components/erc/Check/Check.js @@ -181,7 +181,7 @@ class Check extends Component { componentDidMount() { this.getJobs(); - document.title = "Check | ERC " + this.props.id+ " | o2r Demoserver"; + document.title = "Check | ERC " + this.props.id + config.title; } render() { diff --git a/ui/src/components/erc/Check/Comparison/Comparison.js b/ui/src/components/erc/Check/Comparison/Comparison.js index 690e6614..5675c4e0 100644 --- a/ui/src/components/erc/Check/Comparison/Comparison.js +++ b/ui/src/components/erc/Check/Comparison/Comparison.js @@ -1,5 +1,5 @@ import React, { Component } from "react"; -import { Button, Dialog, AppBar, Toolbar, Slide, Typography } from "@material-ui/core"; +import { Button, Dialog, AppBar, Toolbar, Slide, Typography, FormControlLabel, Checkbox} from "@material-ui/core"; import logo from '../../../../assets/img/o2r-logo-only-white.svg'; import Iframe from 'react-iframe'; import { withRouter } from 'react-router-dom'; @@ -26,7 +26,7 @@ class Comparison extends Component { if (this.props.location.search === '?result') { self.setState({ open: true }) } - document.title = "Comparison | ERC " + this.state.job.compendium_id + " | o2r Demoserver " + document.title = "Comparison | ERC " + this.state.job.compendium_id + config.title; } handleClickOpen = () => { @@ -69,14 +69,14 @@ class Comparison extends Component { $("#frame3").contents().off( "scroll" ); } - handleCheck = () => { - let checked = $('.checkScroll').prop("checked"); + handleCheck = (event) => { + let checked = event.target.checked; console.log(checked); if(checked){ - this.deactivateScroll(); + this.activateScroll(); } else{ - this.activateScroll(); + this.deactivateScroll(); } } @@ -119,12 +119,15 @@ class Comparison extends Component {

To use synchronised scrolling in Firefox, move the cursor to the leftmost document.

-
- -
+ } + />
} diff --git a/ui/src/components/erc/Check/Comparison/comparison.css b/ui/src/components/erc/Check/Comparison/comparison.css index 6c01ac55..05dabd5d 100644 --- a/ui/src/components/erc/Check/Comparison/comparison.css +++ b/ui/src/components/erc/Check/Comparison/comparison.css @@ -35,6 +35,5 @@ } .checkScroll{ - color: #004286; - margin-top: 1.5%; + margin-top: 0.75%; } diff --git a/ui/src/components/erc/ERC.js b/ui/src/components/erc/ERC.js index 972df40d..b1fbc4a5 100644 --- a/ui/src/components/erc/ERC.js +++ b/ui/src/components/erc/ERC.js @@ -40,7 +40,7 @@ class ERC extends React.Component { componentDidMount = () => { this.getMetadata(); this.props.history.replace(this.props.location.pathname); - document.title = "ERC " + this.state.id+ " | o2r Demoserver"; + document.title = "ERC " + this.state.id + config.title; }; @@ -217,7 +217,7 @@ class ERC extends React.Component { render() { return (
- {this.state.isPreview ?

This is a preview! Changes from the create window will not be displayed.

: ""} + {this.state.isPreview ?

This is a preview! Changes from the create window will not be displayed.

: ""} diff --git a/ui/src/components/erc/Inspect/Inspect.js b/ui/src/components/erc/Inspect/Inspect.js index 825cc40a..36219655 100644 --- a/ui/src/components/erc/Inspect/Inspect.js +++ b/ui/src/components/erc/Inspect/Inspect.js @@ -4,11 +4,12 @@ import { ReflexContainer, ReflexElement, ReflexSplitter } from 'react-reflex'; import CodeView from './CodeView/CodeView'; import DataView from './DataView/DataView'; import SelectFile from './SelectFile/SelectFile'; +import config from '../../../helpers/config'; class Inspect extends Component { componentDidMount(){ - document.title = "Inspect | ERC " + this.props.state.id+ " | o2r Demoserver"; + document.title = "Inspect | ERC " + this.props.state.id + config.title; } render() { diff --git a/ui/src/components/erc/Manipulate/Manipulate.js b/ui/src/components/erc/Manipulate/Manipulate.js index 5b1b8f82..c2d1dac1 100644 --- a/ui/src/components/erc/Manipulate/Manipulate.js +++ b/ui/src/components/erc/Manipulate/Manipulate.js @@ -38,7 +38,7 @@ class Manipulate extends React.Component { if (this.state.bindings.length > 5) { this.setState({ variant: "scrollable" }) } - document.title = "Manipulate | ERC " + this.props.id+ " | o2r Demoserver"; + document.title = "Manipulate | ERC " + this.props.id + config.title; } componentDidUpdate = (prevProps) => { diff --git a/ui/src/components/erc/Metadata/Metadata.js b/ui/src/components/erc/Metadata/Metadata.js index cda9d6ff..04bab88b 100644 --- a/ui/src/components/erc/Metadata/Metadata.js +++ b/ui/src/components/erc/Metadata/Metadata.js @@ -1,6 +1,7 @@ import React from 'react'; import { List, ListItem, ListItemText, Button } from '@material-ui/core'; -import { Map, TileLayer, Polygon } from 'react-leaflet' +import { Map, TileLayer, Polygon } from 'react-leaflet'; +import config from '../../../helpers/config'; import { withRouter } from 'react-router-dom'; @@ -16,7 +17,7 @@ class Metadata extends React.Component { componentDidMount() { ref2 = this.refs.map.leafletElement; ref2.fitBounds([this.metadata.spatial.union.bbox[0], this.metadata.spatial.union.bbox[2]]) - document.title = "Metadata | ERC " + this.props.id + " | o2r Demoserver" + document.title = "Metadata | ERC " + this.props.erc.id + config.title; } goToErc = (id) => { diff --git a/ui/src/components/erc/Substitution/Substitution.js b/ui/src/components/erc/Substitution/Substitution.js index b52da4dd..a562eef5 100644 --- a/ui/src/components/erc/Substitution/Substitution.js +++ b/ui/src/components/erc/Substitution/Substitution.js @@ -1,6 +1,7 @@ import React from 'react'; import httpRequests from '../../../helpers/httpRequests'; +import config from '../../../helpers/config'; import { Card, CardHeader, CardContent, CardActions, Button, IconButton, Collapse, Grid } from '@material-ui/core'; import Substitute from './Substitute/Subsititute' @@ -27,7 +28,7 @@ class Substitution extends React.Component { if (this.props.baseErcData.metadata.o2r.inputfiles.length !== 0) { this.getCompendia() } - document.title = "Substitution | ERC " + this.props.id + " | o2r Demoserver" + document.title = "Substitution | ERC " + this.props.baseErcId + config.title; } getCompendia = () => { diff --git a/ui/src/components/erc/erc.css b/ui/src/components/erc/erc.css index 644cda0d..80a1e680 100644 --- a/ui/src/components/erc/erc.css +++ b/ui/src/components/erc/erc.css @@ -4,7 +4,7 @@ #PreviewNotice { color: white; - background-color: orange; + background-color: #CE5100; margin-left: 30%; margin-right: 30%; padding: 20px; diff --git a/ui/src/components/startpage/Startpage.js b/ui/src/components/startpage/Startpage.js index 5934ec77..05ffffd8 100644 --- a/ui/src/components/startpage/Startpage.js +++ b/ui/src/components/startpage/Startpage.js @@ -4,6 +4,7 @@ import { Card, CardContent, Grid } from "@material-ui/core/"; import './startpage.css'; import Upload from "../uploadERC/Upload"; import InspectExamples from '../inspectExamples/InspectExamples'; +import config from '../../../helpers/config'; class Startpage extends Component { state = { @@ -11,7 +12,7 @@ class Startpage extends Component { }; componentDidMount(){ - document.title = "Home | o2r Deno Server" + document.title = "Home" + config.title; } render() { diff --git a/ui/src/components/startpageDemo/Startpage.js b/ui/src/components/startpageDemo/Startpage.js index 8269574b..dc058d46 100644 --- a/ui/src/components/startpageDemo/Startpage.js +++ b/ui/src/components/startpageDemo/Startpage.js @@ -3,6 +3,7 @@ import React, { Component } from "react"; import './startpage.css'; import InspectExamples from '../inspectExamplesDemo/InspectExamples'; import Dropzone from "../uploadERC/Dropzone/Dropzone"; +import config from '../../helpers/config'; class Startpage extends Component { state = { @@ -10,7 +11,7 @@ class Startpage extends Component { }; componentDidMount(){ - document.title = "Home | o2r Demo Server" + document.title = "Home" + config.title; } diff --git a/ui/src/helpers/config.json b/ui/src/helpers/config.json index 153a95d4..e6235fc2 100644 --- a/ui/src/helpers/config.json +++ b/ui/src/helpers/config.json @@ -1,4 +1,5 @@ { "baseUrl": "http://localhost/api/v1/", - "ercUrl": "http://localhost/#/erc/" -} \ No newline at end of file + "ercUrl": "http://localhost/#/erc/", + "title":" | o2r Demoserver" +} diff --git a/ui/src/helpers/theme.js b/ui/src/helpers/theme.js index ff389fd1..c4a1e662 100644 --- a/ui/src/helpers/theme.js +++ b/ui/src/helpers/theme.js @@ -10,9 +10,12 @@ const o2rTheme = createMuiTheme({ }, success: { main: '#008643' + }, + warn: { + main: '#CE5100' } } }); - export default o2rTheme; \ No newline at end of file + export default o2rTheme; From a6d9dd15f085059972429a3aa0016bd8f927b646 Mon Sep 17 00:00:00 2001 From: Fmazin Date: Mon, 21 Dec 2020 16:11:50 +0100 Subject: [PATCH 7/9] Updated Preview Notice --- ui/src/components/erc/ERC.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/components/erc/ERC.js b/ui/src/components/erc/ERC.js index b1fbc4a5..af3b4067 100644 --- a/ui/src/components/erc/ERC.js +++ b/ui/src/components/erc/ERC.js @@ -217,7 +217,7 @@ class ERC extends React.Component { render() { return (
- {this.state.isPreview ?

This is a preview! Changes from the create window will not be displayed.

: ""} + {this.state.isPreview ?

This is a preview! Changes from the create window will not be displayed.

: ""} From c97f2c2c2a4535d1c34f1ea1d95fdb66308679b4 Mon Sep 17 00:00:00 2001 From: Fmazin Date: Mon, 11 Jan 2021 09:38:32 +0100 Subject: [PATCH 8/9] Removed goToPreview --- ui/src/components/createERC/CreateERC.js | 8 -------- ui/src/components/createERC/bindings/Bindings.js | 9 +-------- ui/src/components/createERC/requiredMetadata/Form.js | 3 +-- .../createERC/requiredMetadata/RequiredMetadata.js | 1 - .../spatioTemporalMetadata/SpatioTemporalMetadata.js | 2 +- 5 files changed, 3 insertions(+), 20 deletions(-) diff --git a/ui/src/components/createERC/CreateERC.js b/ui/src/components/createERC/CreateERC.js index 396b950e..0788cafe 100644 --- a/ui/src/components/createERC/CreateERC.js +++ b/ui/src/components/createERC/CreateERC.js @@ -106,11 +106,6 @@ class CreateERC extends Component { }); } - goToPreview = () => { - let win = window.open('/#/erc/' + this.state.compendium_id); - win.focus(); - } - updateAuthors = async (value) => { var changed = true; @@ -186,7 +181,6 @@ class CreateERC extends Component { metadata={this.state.metadata} setMetadata={this.setMetadata} goToErc={this.goToErc} - goToPreview={this.goToPreview} originalMetadata={this.state.originalMetadata} authors={this.state.authors} authorsChanged={this.state.authorsChanged} @@ -206,7 +200,6 @@ class CreateERC extends Component { { diff --git a/ui/src/components/createERC/bindings/Bindings.js b/ui/src/components/createERC/bindings/Bindings.js index 6978dfbf..b82a7071 100644 --- a/ui/src/components/createERC/bindings/Bindings.js +++ b/ui/src/components/createERC/bindings/Bindings.js @@ -191,8 +191,6 @@ function VerticalLinearStepper(props) { const goToErc = () => props.goToErc(); - const goToPreview = () => props.goToPreview(); - return (
@@ -284,7 +282,7 @@ function VerticalLinearStepper(props) { Publish {props.candidate - ? : : : ""} - + this.openPop("downloadOpen")}> Download @@ -309,6 +325,7 @@ class ERC extends React.Component { } + diff --git a/ui/src/components/erc/erc.css b/ui/src/components/erc/erc.css index 80a1e680..a94f4d92 100644 --- a/ui/src/components/erc/erc.css +++ b/ui/src/components/erc/erc.css @@ -1,11 +1,3 @@ .Erc { text-align: center; } - -#PreviewNotice { - color: white; - background-color: #CE5100; - margin-left: 30%; - margin-right: 30%; - padding: 20px; -} diff --git a/ui/src/helpers/theme.js b/ui/src/helpers/theme.js index c4a1e662..b309f666 100644 --- a/ui/src/helpers/theme.js +++ b/ui/src/helpers/theme.js @@ -11,7 +11,7 @@ const o2rTheme = createMuiTheme({ success: { main: '#008643' }, - warn: { + warning: { main: '#CE5100' } }