Skip to content
Snippets Groups Projects
Commit 4b9f294b authored by Audrey Hamelers's avatar Audrey Hamelers
Browse files

#1145

parent 9245d655
No related branches found
No related tags found
3 merge requests!358Merge in latest from master,!351Master,!346Upgrades to metrics and error reporting
This commit is part of merge request !351. Comments created here will be created in the context of that merge request.
......@@ -34,7 +34,7 @@ class ManuscriptPreview extends React.Component {
this.refdiv = refdiv
}
render() {
const { file } = this.props
const { file, original } = this.props
if (!file || this.state.hasError) {
return (
<Notification type="error">
......@@ -44,19 +44,32 @@ class ManuscriptPreview extends React.Component {
}
if (file.type === 'source') {
return (
<Doc id={this.state.html && 'html-preview'} ref={this.setRef}>
{this.state.html ? (
<Wax
readonly
renderLayout={({ editor, ...props }) => <div>{editor}</div>}
value={this.state.html}
/>
) : (
<Loading>
<LoadingIcon />
</Loading>
)}
</Doc>
<React.Fragment>
<Notification type="warning">
{`The preview is intended for the review of content only. If it is not formatted correctly, you can check formatting by `}
<A
download={original.filename}
href={original.url}
title="Download the manuscript"
>
downloading the original source file
</A>
{'.'}
</Notification>
<Doc id={this.state.html && 'html-preview'} ref={this.setRef}>
{this.state.html ? (
<Wax
readonly
renderLayout={({ editor, ...props }) => <div>{editor}</div>}
value={this.state.html}
/>
) : (
<Loading>
<LoadingIcon />
</Loading>
)}
</Doc>
</React.Fragment>
)
} else if (file.mimeType === 'application/pdf') {
return (
......
......@@ -486,7 +486,12 @@ class Review extends React.Component {
</React.Fragment>
)}
{pane === 'original' && sourceFile && (
<ManuscriptPreview file={sourceFile} />
<ManuscriptPreview
file={sourceFile}
original={allfiles.find(
file => file.type === 'manuscript',
)}
/>
)}
</PanelContent>
</PreviewPanelDiv>
......@@ -514,7 +519,12 @@ class Review extends React.Component {
Close manuscript file
</Button>
</ButtonSpacer>
<ManuscriptPreview file={sourceFile} />
<ManuscriptPreview
file={sourceFile}
original={allfiles.find(
file => file.type === 'manuscript',
)}
/>
</PanelContent>
) : (
<React.Fragment>
......
......@@ -287,6 +287,9 @@ class Submit extends React.Component {
allfiles.find(file => file.type === 'source') ||
allfiles.find(file => file.type === 'manuscript')
}
original={allfiles.find(
file => file.type === 'manuscript',
)}
textContent={highlights =>
currentUser.admin && status === 'submitted'
? this.setState({ highlights })
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment