Commit af456808 authored by Audrey Hamelers's avatar Audrey Hamelers

#476 change options when new reviewer at initial QA

parent 6945d354
Pipeline #12982 passed with stages
in 1 minute and 18 seconds
......@@ -148,6 +148,9 @@ class Submit extends React.Component {
name: rev.alias.name,
}
}
const reviewerNote = notes
? notes.find(n => n.notesType === 'selectedReviewer')
: null
const submitter =
teams && teams.find(team => team.role === 'submitter')
? teams.find(team => team.role === 'submitter').teamMembers[0]
......@@ -288,28 +291,30 @@ class Submit extends React.Component {
</Content>
</React.Fragment>
))}
{currentUser.admin && status === 'submitted' && (
<React.Fragment>
<Header>
<H3>Report Errors</H3>
</Header>
<Content>
<div>
<p>
{`Check the following and select anything that is missing:`}
</p>
<CheckboxGroup
name="admin-checklist"
onChange={c =>
this.setState({ checkedBoxes: c })
}
options={adminOptions}
value={checkedBoxes}
/>
</div>
</Content>
</React.Fragment>
)}
{currentUser.admin &&
status === 'submitted' &&
!reviewerNote && (
<React.Fragment>
<Header>
<H3>Report Errors</H3>
</Header>
<Content>
<div>
<p>
{`Check the following and select anything that is missing:`}
</p>
<CheckboxGroup
name="admin-checklist"
onChange={c =>
this.setState({ checkedBoxes: c })
}
options={adminOptions}
value={checkedBoxes}
/>
</div>
</Content>
</React.Fragment>
)}
</PanelContent>
</div>
</EditPanel>
......@@ -327,7 +332,7 @@ class Submit extends React.Component {
<div>
{currentUser.admin && status === 'submitted' ? (
<SubmitApprove
adminButton
adminButton={reviewerNote ? 'review' : 'tagging'}
disabled={sections.some(sec => sec.error)}
manuscriptId={manuscript.id}
/>
......
......@@ -48,13 +48,13 @@ const SubmitApprove = ({
variables.data.status = 'xml-triage'
}
await submitManuscript({ variables })
if (adminButton) {
if (adminButton === 'tagging') {
history.push(`/submission/${manuscriptId}/review`)
} else {
close()
}
}
if (adminButton) {
if (adminButton === 'tagging') {
return (
<Mutation mutation={ALERT_PIS}>
{(epmc_emailGrantPis, { data }) => {
......@@ -77,6 +77,19 @@ const SubmitApprove = ({
</Mutation>
)
}
if (adminButton === 'review') {
return (
<Button
disabled={disabled}
onClick={() => {
submit('submitted')
}}
primary
>
Send for new review
</Button>
)
}
return (
<Portal transparent>
<p>Please certify the following statements are true:</p>
......
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