Skip to content
Snippets Groups Projects
Commit ea64ffb9 authored by Anca Ursachi's avatar Anca Ursachi
Browse files

Merge branch 'hin-restore-he-rec' of gitlab.coko.foundation:xpub/xpub-faraday...

Merge branch 'hin-restore-he-rec' of gitlab.coko.foundation:xpub/xpub-faraday into hin-restore-he-rec
parents ab38cf59 f88c5165
No related branches found
No related tags found
2 merge requests!110Sprint 21 Features,!84Hin restore he rec
......@@ -236,15 +236,14 @@ export const getInvitationsWithReviewersForFragment = (state, fragmentId) =>
.value()
export const canMakeHERecommendation = (state, { collection, statuses }) => {
const { isAccepted, id: heId } = get(collection, 'handlingEditor', {})
const validHe = isAccepted && get(state, 'currentUser.user.id', '') === heId
const validHE = isHEToManuscript(state, get(collection, 'id', ''))
const statusImportance = get(
statuses,
`${get(collection, 'status', 'draft')}.importance`,
1,
)
return statusImportance > 1 && statusImportance < 9 && validHe
return statusImportance > 1 && statusImportance < 9 && validHE
}
// #region Editorial and reviewer recommendations
......
......@@ -47,7 +47,7 @@ const HERecommendation = ({
highlight,
}) => (
<ContextualBox
highlight={!!hasReviewerReports}
highlight={highlight}
label="Your Editorial Recommendation"
mb={2}
>
......
......@@ -32,18 +32,18 @@ const ReviewerDetails = ({
onRevokeReviewerInvite,
toggle,
expanded,
highlight,
canViewReviewersDetails,
...rest
}) =>
canViewReviewersDetails ? (
<ContextualBox
expanded={!!reports.length}
highlight={reports.length === 0}
expanded={expanded}
highlight={highlight}
label="Reviewer Details & Reports"
rightChildren={
<ReviewerBreakdown fitContent fragment={fragment} mr={1} />
}
startExpanded
toggle={toggle}
{...rest}
>
......
......@@ -168,10 +168,10 @@ const ManuscriptLayout = ({
expanded={reviewerDetailsExpanded}
fragment={fragment}
getSignedUrl={getSignedUrl}
highlight={reviewerReports.length === 0}
invitations={invitationsWithReviewers}
journal={journal}
mb={2}
mt={2}
onInviteReviewer={onInviteReviewer}
onResendReviewerInvite={onResendReviewerInvite}
onRevokeReviewerInvite={onRevokeReviewerInvite}
......@@ -185,6 +185,7 @@ const ManuscriptLayout = ({
<HERecommendation
formValues={get(formValues, 'editorialRecommendation', {})}
hasReviewerReports={reviewerRecommendations.length > 0}
highlight={reviewerRecommendations.length > 0}
modalKey="heRecommendation"
onRecommendationSubmit={onEditorialRecommendation}
/>
......
......@@ -146,10 +146,7 @@ export default compose(
isInvitedHE: !isUndefined(pendingHEInvitation),
isInvitedToReview: !isUndefined(pendingReviewerInvitation),
isReviewer: currentUserIsReviewer(state, get(fragment, 'id', '')),
isHEToManuscript: isHEToManuscript(state, {
collectionId: get(collection, 'id', ''),
statuses: get(journal, 'statuses', {}),
}),
isHEToManuscript: isHEToManuscript(state, get(collection, 'id', '')),
permissions: {
canMakeHERecommendation: canMakeHERecommendation(state, {
collection,
......@@ -441,6 +438,7 @@ export default compose(
history,
location,
shouldReview,
reviewerReports,
setEditorInChief,
clearCustomError,
hasManuscriptFailure,
......@@ -478,7 +476,7 @@ export default compose(
this.props.toggleReviewerRecommendations()
}
if (isHEToManuscript) {
if (isHEToManuscript && !!reviewerReports.length) {
this.props.toggleReviewerDetails()
}
},
......
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