Commit b14c9cd2 authored by Audrey Hamelers's avatar Audrey Hamelers

still show warning on in-review when admin is submitter

parent 5c935aa5
Pipeline #12985 passed with stages
in 5 minutes and 41 seconds
......@@ -22,6 +22,16 @@ const SubmitText = ({ currentUser, teams, status, history }) => {
? teams.find(team => team.role === 'reviewer').teamMembers[0]
: null
const AdminWarning = () => (
<React.Fragment>
<Notif type="warning">
<B>This manuscript has not yet been submitted!</B>
<br />
{` Its status is '${status}'. Be wary of committing any actions on behalf of a user.`}
</Notif>
</React.Fragment>
)
if (submitter && submitter.user.id === currentUser.id) {
if (status === 'submission-error') {
return (
......@@ -30,6 +40,9 @@ const SubmitText = ({ currentUser, teams, status, history }) => {
</Notif>
)
}
if (currentUser.admin && status === 'in-review') {
return <AdminWarning />
}
return null
} else if (reviewer && reviewer.user.id === currentUser.id) {
return (
......@@ -51,15 +64,7 @@ const SubmitText = ({ currentUser, teams, status, history }) => {
)
} else if (currentUser.admin) {
if (status !== 'submitted') {
return (
<React.Fragment>
<Notif type="warning">
<B>This manuscript has not yet been submitted!</B>
<br />
{` Its status is '${status}'. Be wary of committing any actions on behalf of a user.`}
</Notif>
</React.Fragment>
)
return <AdminWarning />
}
return null
}
......
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