Commit f7519c40 authored by Audrey Hamelers's avatar Audrey Hamelers
Browse files

Merge branch 'dev' into 'master'

Dev

See merge request !185
parents 1ec4c4f9 c67c4855
Pipeline #13097 passed with stages
in 48 seconds
......@@ -113,6 +113,13 @@
margin-top: 1em;
}
hr {
height: 1px;
background-color: #ccc;
border: 0;
margin: 2em auto;
}
ol, ul {
margin-left: 1em;
padding-left: 1em;
......@@ -264,6 +271,10 @@
display: inline-block;
}
.inline {
display: inline;
}
.overflow-hidden {
overflow: hidden;
}
......
......@@ -187,6 +187,7 @@ class PDFViewer extends React.Component {
<Viewer
fitWidth={this.setFit}
loading={loading}
maxPages={this.props.maxPages}
onScroll={this.countPages}
pdf={pdf}
scale={scale}
......
......@@ -14,7 +14,7 @@ const Pane = styled.div`
class Viewer extends React.PureComponent {
render() {
const { pdf, loading, ...props } = this.props
const { pdf, loading, maxPages, ...props } = this.props
const numPages = pdf && pdf._pdfInfo ? pdf._pdfInfo.numPages : 0
return (
<Pane className="pdf-viewer-pane" onScroll={props.onScroll}>
......@@ -30,7 +30,7 @@ class Viewer extends React.PureComponent {
/>
) : (
<React.Fragment>
{numPages < 51 ? (
{!maxPages || numPages < maxPages ? (
[...Array(numPages)].map((v, i) => (
<Page
index={i + 1}
......@@ -43,7 +43,7 @@ class Viewer extends React.PureComponent {
))
) : (
<React.Fragment>
{[...Array(51)].map((v, i) => (
{[...Array(maxPages + 1)].map((v, i) => (
<Page
index={i + 1}
key={`document-page-${Math.round(
......
......@@ -55,7 +55,13 @@ class ManuscriptPreview extends React.Component {
</Doc>
)
} else if (file.mimeType === 'application/pdf') {
return <PDFViewer textContent={this.props.textContent} url={file.url} />
return (
<PDFViewer
maxPages={50}
textContent={this.props.textContent}
url={file.url}
/>
)
}
return (
<Notification type="info">
......
......@@ -165,14 +165,16 @@ class MetaSec extends React.Component {
return log
}, {})
const year =
(publicationDates &&
publicationDates.find(d => d.type === 'ppub') &&
(publicationDates.find(d => d.type === 'ppub').jatsDate
? publicationDates.find(d => d.type === 'ppub').jatsDate.year
: moment(
publicationDates.find(d => d.type === 'ppub').date,
).year())) ||
null
publicationDates &&
publicationDates.reduce((retYear, date) => {
const getYear = date.jatsDate
? date.jatsDate.year
: moment(date.date).year()
if (date.type === 'ppub' || !retYear) {
return getYear
}
return retYear
}, null)
const { edit, notif } = this.state
return (
<React.Fragment>
......
......@@ -116,7 +116,12 @@ const QuickView = ({ manuscript }) => (
</Col>
<Col flex={1}>
<div>Published</div>
<Status current={manuscript.status} mark="ncbi-ready" />
<Status
current={manuscript.status}
mark={
manuscript.status === 'ncbi-triage' ? 'ncbi-triage' : 'ncbi-ready'
}
/>
</Col>
</Checklist>
</React.Fragment>
......
......@@ -20,6 +20,7 @@ const HelpdeskQueue = {
'needs XML QA': ['xml-qa'],
'has XML errors': ['xml-triage'],
'needs citation': ['xml-complete'],
'failed NCBI loading': ['ncbi-triage'],
}
const SubmitterQueue = {
......
......@@ -26,7 +26,7 @@ class DashboardPage extends React.Component {
if (this.state.errors.length > 0) {
setTimeout(() => {
this.setState({ errors: [] })
}, 4000)
}, 5000)
}
}
async setReviewer(noteId, newPath) {
......@@ -36,25 +36,15 @@ class DashboardPage extends React.Component {
awaitRefetchQueries: true,
})
this.props.history.replace(newPath)
if (!set.data.addReviewer) {
this.setState({
errors: [
{
message: 'Manuscript already accepted for review.',
type: 'warning',
},
],
})
} else {
this.setState({
errors: [
{
message: 'Manuscript accepted for review.',
type: 'success',
},
],
})
}
const { success, message } = await set.data.addReviewer
this.setState({
errors: [
{
message,
type: success ? 'success' : 'warning',
},
],
})
}
render() {
const { currentUser, history } = this.props
......
......@@ -54,6 +54,11 @@ const submitterState = {
color: 'success',
url: 'submit',
},
'ncbi-triage': {
status: 'Approved for Europe PMC',
color: 'success',
url: 'submit',
},
published: {
status: 'Available in Europe PMC',
color: 'success',
......@@ -122,6 +127,11 @@ const reviewerState = {
color: 'success',
url: 'submit',
},
'ncbi-triage': {
status: 'Approved for Europe PMC',
color: 'success',
url: 'submit',
},
published: {
status: 'Available in Europe PMC',
color: 'success',
......@@ -190,6 +200,11 @@ const adminState = {
color: 'success',
url: 'activity',
},
'ncbi-triage': {
status: 'NCBI errors',
color: 'error',
url: 'review',
},
published: {
status: 'Available in Europe PMC',
color: 'success',
......
......@@ -10,7 +10,10 @@ export const CURRENT_USER = gql`
`
export const ADD_REVIEWER = gql`
mutation AddReviewer($noteId: ID!) {
addReviewer(noteId: $noteId)
addReviewer(noteId: $noteId) {
success
message
}
}
`
export const COUNT_MANUSCRIPTS = gql`
......
......@@ -36,7 +36,17 @@ const PasswordReset = ({ errors, handleSubmit, touched, status }) => (
)}
{!isEmpty(errors) && typeof errors === 'string' && (
<Notification type="error">{errors}</Notification>
<Notification type="error">
{errors === 'jwt expired' ? (
<React.Fragment>
{`Your password reset link has expired. Please `}
<Link to="/password-reset">reset your password</Link>
{` again.`}
</React.Fragment>
) : (
errors
)}
</Notification>
)}
{status && status.reset && (
......
......@@ -135,23 +135,24 @@ class Review extends React.Component {
}
componentDidMount() {
if (this.page && this.props.manuscript) {
if (
this.props.manuscript.files &&
!this.props.manuscript.files.find(f => f.type === 'PMC')
) {
const { files, status } = this.props.manuscript
if (files && !files.find(f => f.type === 'PMC')) {
this.setState({ showAll: true })
}
if (
['xml-triage', 'tagging'].includes(this.props.manuscript.status) &&
['xml-triage', 'tagging', 'ncbi-triage'].includes(status) &&
this.props.currentUser.admin
) {
this.setState({ pane: 'files', open: false })
this.setState({ pane: 'files', open: status === 'ncbi-triage' })
}
}
}
showSuccess = () =>
new Promise((resolve, reject) => {
if (this.page) {
window.scrollY = 0
window.pageYOffset = 0
document.scrollingElement.scrollTop = 0
this.setState({ success: true })
setTimeout(() => {
this.setState({ success: false }, resolve())
......@@ -228,12 +229,16 @@ class Review extends React.Component {
>
<PreviewPanelDiv style={{ maxWidth: showManuscript && '1000px' }}>
<PreviewPanelHeader>
<H1>
{(status === 'xml-triage' && 'Correct') ||
(status === 'tagging' && 'Tag') ||
'Review'}
{` final web versions`}
</H1>
{status === 'ncbi-triage' ? (
<H1>Fix NCBI loading errors</H1>
) : (
<H1>
{(status === 'xml-triage' && 'Correct') ||
(status === 'tagging' && 'Tag') ||
'Review'}
{` final web versions`}
</H1>
)}
</PreviewPanelHeader>
{pane !== 'files' && (
<Instructions>
......@@ -252,7 +257,7 @@ class Review extends React.Component {
XML files
</Action>
)}
{['xml-qa', 'xml-triage'].includes(status) && (
{['xml-qa', 'xml-triage', 'ncbi-triage'].includes(status) && (
<Action
className={pane === 'xml' ? 'current' : ''}
disabled={!xml}
......
......@@ -62,7 +62,13 @@ class ReviewFooter extends React.Component {
Send for XML QA
</Button>
)
} else if (manuscript.status === 'xml-triage') {
} else if (status === 'ncbi-triage') {
return (
<Button onClick={() => setStatus('xml-complete')} primary>
Retry send to NCBI
</Button>
)
} else if (status === 'xml-triage') {
const options = [
{
value: 'xml-qa',
......@@ -72,10 +78,6 @@ class ReviewFooter extends React.Component {
value: 'xml-review',
label: 'Author review',
},
{
value: 'xml-complete',
label: 'PMC (skip review)',
},
]
return (
<div>
......
......@@ -58,7 +58,11 @@ const ReviewFormDisplay = ({
{annotations && <ListErrors annotations={annotations} />}
{deleted.length > 0 && <ReviewHistory reviews={deleted} />}
<p>
{`You can fix any errors and approve for review, or send this list of issues to the taggers to fix. You may edit the annotation text to provide more detail if necessary.`}
{`You can fix any errors and approve for review, or ${
review
? 'send this list of issues to the taggers to fix. You may edit the annotation text to provide more detail if necessary'
: 'request a fix from the taggers'
}.`}
</p>
<p>
{`If an error is caused by missing or incomplete files, click 'Return for user upload' and you will be given the opportunity to write a message explaining what is needed, and send the manuscript back to the submitter or reviewer to upload files.`}
......@@ -87,6 +91,8 @@ const ReviewFormDisplay = ({
)
}
return null
} else if (status === 'ncbi-triage') {
return null
}
history.push('/')
return null
......
......@@ -116,7 +116,12 @@ class Submit extends React.Component {
this.setState({ editing: null })
}
pruneDupes = () => this.setState({ prune: true })
showSuccess = () => this.setState({ success: true })
showSuccess = () => {
window.scrollY = 0
window.pageYOffset = 0
document.scrollingElement.scrollTop = 0
this.setState({ success: true })
}
render() {
const { currentUser, manuscript, duplicates: checkDupes = [] } = this.props
const {
......
......@@ -10,6 +10,7 @@
"xml-review",
"xml-complete",
"ncbi-ready",
"ncbi-triage",
"published",
"being-withdrawn"
]
\ No newline at end of file
{
"name": "xpub-epmc",
"version": "1.4.0",
"version": "1.5.0",
"private": true,
"description": "xpub configured for Europe PMC Plus manuscript submission system",
"license": "MIT",
......
const resetPasswordTemplate = ({ title, givenNames, surname }, link) => `
<h1 style="font-weight:600;">Reset your password</h1>
<p>Dear ${title ? `${title} ` : ''}${givenNames} ${surname},</p>
<p>Please click the link to <a style="color:#20699C" href="${link}">reset the password</a> of your Europe PMC Plus account.</p>
<p>Please click the link to <a style="color:#20699C" href="${link}">reset the password</a> of your Europe PMC Plus account. This link will expire in 24 hours.</p>
<p>If you did not request a password reset, please disregard this message.</p>
<p>Kind regards,</p>
<p>The Europe PMC Helpdesk</p>
......
......@@ -159,7 +159,7 @@ async function updateManuscriptNcbiStatus(fileName, response) {
)
if (response.status) {
manInput.formState = `Failed NCBI loading\n\n${response.formState}`
manInput.status = 'xml-triage'
manInput.status = 'ncbi-triage'
} else if (response.pmcid) {
const newPMCID = response.pmcid.startsWith('PMC')
? response.pmcid
......
......@@ -127,7 +127,7 @@ async function selectResult(results, manuscripts) {
if (
manuscript.status === 'xml-complete' &&
citationData.meta &&
citationData.meta.volume
(citationData.meta.volume || citationData.meta.issue)
) {
citationData.status = 'ncbi-ready'
}
......
Markdown is supported
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