diff --git a/ui/src/components/app/App.js b/ui/src/components/app/App.js index ec2770b1..cd8d5cf2 100644 --- a/ui/src/components/app/App.js +++ b/ui/src/components/app/App.js @@ -1,8 +1,8 @@ import React, { Component } from 'react' -import {Button, AppBar, Toolbar, Typography, ThemeProvider } from '@material-ui/core'; +import {Button, AppBar, Toolbar, Typography, MuiThemeProvider } from '@material-ui/core'; import { Route, NavLink, HashRouter } from "react-router-dom"; -import theme from '../../helpers/theme'; +import o2rTheme from '../../helpers/theme'; import './App.css'; import logo from '../../assets/img/o2r-logo-only-white.svg'; import orcidLogo from '../../assets/img/orcid.png'; @@ -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 ? : ''} {/**/} - + ); }; @@ -106,20 +106,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}>
- +
@@ -135,10 +135,9 @@ 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..6ae494d1 100644 --- a/ui/src/components/app/footerLinks/Impressum.js +++ b/ui/src/components/app/footerLinks/Impressum.js @@ -1,13 +1,20 @@ import React, { Component } from "react"; +import config from '../../../helpers/config'; class Impressum extends Component { + + componentDidMount(){ + document.title = "Impressum" + config.title; + + } + 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 +23,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 +31,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..be3530cd 100644 --- a/ui/src/components/app/footerLinks/Privacy.js +++ b/ui/src/components/app/footerLinks/Privacy.js @@ -1,8 +1,15 @@ import React, { Component } from "react"; +import config from '../../../helpers/config'; class Privacy extends Component { + + componentDidMount(){ + document.title = "Privacy" + config.title; + + } + render() { - return ( + return (

Privacy Policy

User Data

@@ -40,4 +47,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..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,6 +17,7 @@ class Author extends Component { } componentDidMount() { this.getCompendia(); + document.title = "Author View" + config.title; } goToErc = (erc) => { @@ -88,4 +90,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 2b501139..0788cafe 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) { @@ -35,7 +35,7 @@ class CreateERC extends Component { spatioTemporalChanged: false, authorsValid: false, candidate: true, - showProgress: false, + showProgress: false } } @@ -146,17 +146,21 @@ class CreateERC extends Component { this.setState({ authorsValid: valid }); }; - - componentDidMount = () => this.getMetadata(); + componentDidMount = () => { + this.getMetadata(); + document.title = "Create ERC" + config.title; + } handleClose = () => { this.setState({ open: false }) + + } render() { const { value } = this.state; return ( -
+
Publish - + {props.candidate + ? + : + } )}
@@ -472,7 +477,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"){ @@ -530,8 +535,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({ @@ -627,13 +632,13 @@ class Bindings extends Component { saveErc = () => { this.props.setChangedFalse("all") this.props.updateMetadata(this.props.metadata, true) - + } goToErc= () => { this.props.goToErc(); } - + clearBinding() { let state = this.state; //state.codeview=true; @@ -808,4 +813,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 0d7637e3..4364de63 100644 --- a/ui/src/components/createERC/requiredMetadata/Form.js +++ b/ui/src/components/createERC/requiredMetadata/Form.js @@ -333,12 +333,20 @@ export const Form = props => { > Publish - + : + }
{errors.title ? errors.title : ""} @@ -366,4 +374,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..1d1842f3 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) @@ -190,7 +190,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 62744760..4f6502c9 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.goToErc() + } + 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" : ""}
diff --git a/ui/src/components/discovery/Discovery.js b/ui/src/components/discovery/Discovery.js index 88c88eac..4ce5d1a5 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' @@ -27,7 +28,11 @@ class Discovery extends Component { } } - componentDidMount() { this.searchCompendia(); this.calculateDateRange() } + componentDidMount() { + this.searchCompendia(); + this.calculateDateRange(); + document.title = "Discover" + config.title; + } calculateDateRange = () => { const result = [] @@ -312,4 +317,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 5ba6acf7..ad428ee1 100644 --- a/ui/src/components/erc/Check/Check.js +++ b/ui/src/components/erc/Check/Check.js @@ -186,6 +186,7 @@ class Check extends Component { componentDidMount() { this.getJobs(); + 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 019f6eb1..8df1be96 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,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 + config.title; } 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 = (event) => { + let checked = event.target.checked; + console.log(checked); + if(checked){ + this.activateScroll(); + } + else{ + this.deactivateScroll(); } } @@ -76,7 +94,7 @@ class Comparison extends Component { @@ -101,6 +119,15 @@ class Comparison extends Component {

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

+ } + />
} @@ -109,4 +136,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..05dabd5d 100644 --- a/ui/src/components/erc/Check/Comparison/comparison.css +++ b/ui/src/components/erc/Check/Comparison/comparison.css @@ -32,4 +32,8 @@ color: #004286; width: 48%; float: left; -} \ No newline at end of file +} + +.checkScroll{ + margin-top: 0.75%; +} diff --git a/ui/src/components/erc/ERC.js b/ui/src/components/erc/ERC.js index e6ba85bf..bf357bde 100644 --- a/ui/src/components/erc/ERC.js +++ b/ui/src/components/erc/ERC.js @@ -1,7 +1,7 @@ import React from 'react'; import 'react-reflex/styles.css'; import { ReflexContainer, ReflexElement, ReflexSplitter } from 'react-reflex'; -import { Paper, Tabs, Tab, Button, IconButton, Grid, Dialog, DialogActions, DialogTitle, Icon } from "@material-ui/core"; +import { Paper, Tabs, Tab, Button, IconButton, Grid, Dialog, DialogActions, DialogTitle, , Icon, Box} from "@material-ui/core"; import GetAppIcon from '@material-ui/icons/GetApp'; import config from '../../helpers/config'; @@ -34,13 +34,18 @@ class ERC extends React.Component { tabValue: 0, html: true, pdf: true, + isPreview: false doiurl: false, publicLink: 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 + config.title; + }; setDataFile(datafile) { @@ -169,6 +174,7 @@ class ERC extends React.Component { codefiles: data.codefiles, binding: data.interaction[0], substituted: substituted, + isPreview: response.data.candidate candidate: candidate, doiurl: data.identifier.doiurl }, () => { @@ -240,9 +246,26 @@ class ERC extends React.Component { }); } + + + render() { + const classes = this.useStyles return (
+ {this.state.isPreview ? +

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

+
: ""} + @@ -266,7 +289,7 @@ class ERC extends React.Component {