Commit cd0c2b29 authored by Yannis Barlas's avatar Yannis Barlas

fix(*): give admin full editor and so access

parent 80c2c111
......@@ -82,6 +82,7 @@ const Dashboard = props => {
if (loading) return <Loading />
const isAdmin = currentUser.admin
const isEditor = currentUser.auth.isGlobalEditor
const isScienceOfficer = currentUser.auth.isGlobalScienceOfficer
......@@ -136,7 +137,7 @@ const Dashboard = props => {
openReviewerPreviewModal={openReviewerPreviewModal}
/>
{isEditor && (
{(isEditor || isAdmin) && (
<Section
allEditors={allEditors}
allScienceOfficers={allScienceOfficers}
......
......@@ -48,6 +48,7 @@ const Tab = props => {
currentUser,
doi,
editor,
isAdmin,
isEditor,
isLastSubmittedVersion,
isScienceOfficer,
......@@ -108,7 +109,7 @@ const Tab = props => {
/>
)}
{!alreadyRejected && !decision && isScienceOfficer && (
{!alreadyRejected && !decision && (isScienceOfficer || isAdmin) && (
<ScienceOfficerSection
approved={isApprovedByScienceOfficer}
editorSuggestedReviewers={editorSuggestedReviewers}
......@@ -138,7 +139,7 @@ const Tab = props => {
}
/>
{(decision || (!decision && isEditor)) && (
{(decision || (!decision && (isEditor || isAdmin))) && (
<Decision
approved={isApprovedByScienceOfficer}
submitDecision={submitDecision}
......@@ -178,6 +179,7 @@ const EditorPanel = props => {
if (loading) return <Loading />
const isAdmin = currentUser.admin
const isEditor = currentUser.auth.isGlobalEditor
const isScienceOfficer = currentUser.auth.isGlobalScienceOfficer
......@@ -202,6 +204,7 @@ const EditorPanel = props => {
currentUser={currentUser}
doi={doi}
editor={editor}
isAdmin={isAdmin}
isEditor={isEditor}
isLastSubmittedVersion={version.id === lastSubmittedVersion.id}
isScienceOfficer={isScienceOfficer}
......
......@@ -79,25 +79,26 @@ const navLinks = (location, currentUser) => {
</Action>
)
const reviewersLink = isEditor ? (
<Query query={GET_MANUSCRIPT_STATUS_FOR_NAVIGATION} variables={{ id }}>
{({ data, loading }) => {
if (loading) return null
const manuscript = data && data.manuscript
const showAssignReviewersLink = shouldShowAssignReviewersLink(
manuscript,
)
if (!showAssignReviewersLink) return null
return (
<Action active={isReviewers} to={`/assign-reviewers/${id}`}>
Assign Reviewers
</Action>
)
}}
</Query>
) : null
const reviewersLink =
isEditor || isAdmin ? (
<Query query={GET_MANUSCRIPT_STATUS_FOR_NAVIGATION} variables={{ id }}>
{({ data, loading }) => {
if (loading) return null
const manuscript = data && data.manuscript
const showAssignReviewersLink = shouldShowAssignReviewersLink(
manuscript,
)
if (!showAssignReviewersLink) return null
return (
<Action active={isReviewers} to={`/assign-reviewers/${id}`}>
Assign Reviewers
</Action>
)
}}
</Query>
) : null
const teamsLink = (
<Action active={isTeamManager} to="/teams">
......
......@@ -52,6 +52,7 @@ const ReviewerInfo = props => {
return reviewWithChat
})
const isAdmin = currentUser.admin
const isEditor = currentUser.auth.isGlobalEditor
const showPreviousReviewers =
previousReviewers && previousReviewers.length > 0
......@@ -69,7 +70,7 @@ const ReviewerInfo = props => {
return (
<>
{isEditor && showReviewerAssignmentLink && (
{(isEditor || isAdmin) && showReviewerAssignmentLink && (
<>
<AssignReviewerLinkWrapper>
<StyledAction to={`/assign-reviewers/${articleId}`}>
......
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