Skip to content
Snippets Groups Projects
Commit 319f3eb9 authored by Tania Fecheta's avatar Tania Fecheta
Browse files

feat(reviewerDetails): change highlight and expanded due to different statusses

parent f48995c3
No related branches found
No related tags found
2 merge requests!110Sprint 21 Features,!67Hin restore he rec
......@@ -5,7 +5,7 @@ export const isHEToManuscript = (state, collectionId) => {
const { id = '', isAccepted = false } = chain(state)
.get('collections', [])
.find(c => c.id === collectionId)
.get('handlingEditor.id', '')
.get('handlingEditor', '')
.value()
return isAccepted && id === get(state, 'currentUser.user.id')
}
......
......@@ -15,7 +15,7 @@ const EditorialReportCard = ({
recommendation,
reviewerName,
reviewerRole,
report: { submittedOn, reviewer },
report: { createdOn, reviewer },
}) => (
<Root>
<Row justify="space-between" mb={2}>
......@@ -31,7 +31,7 @@ const EditorialReportCard = ({
<Tag mr={2}>{reviewerRole}</Tag>
</Fragment>
)}
<DateParser timestamp={submittedOn}>
<DateParser timestamp={createdOn}>
{date => <Text>{date}</Text>}
</DateParser>
</Item>
......
......@@ -40,8 +40,17 @@ const parseFormValues = ({ recommendation, ...rest }) => {
}
}
const HERecommendation = ({ formValues, handleSubmit, hasReviewerReports }) => (
<ContextualBox highlight label="Your Editorial Recommendation" mb={2}>
const HERecommendation = ({
formValues,
handleSubmit,
hasReviewerReports,
highlight,
}) => (
<ContextualBox
highlight={!!hasReviewerReports}
label="Your Editorial Recommendation"
mb={2}
>
<Root>
<Row justify="flex-start">
<ItemOverrideAlert flex={0} vertical>
......
......@@ -37,7 +37,8 @@ const ReviewerDetails = ({
}) =>
canViewReviewersDetails ? (
<ContextualBox
expanded={expanded}
expanded={!!reports.length}
highlight={reports.length === 0}
label="Reviewer Details & Reports"
rightChildren={
<ReviewerBreakdown fitContent fragment={fragment} mr={1} />
......
......@@ -162,29 +162,6 @@ const ManuscriptLayout = ({
toggle={toggleAssignHE}
/>
{get(currentUser, 'permissions.canMakeDecision', false) && (
<ManuscriptEicDecision
formValues={get(formValues, 'eicDecision')}
messagesLabel={messagesLabel}
mt={2}
options={
get(collection, 'status', 'submitted') === 'submitted'
? [last(eicDecisions)]
: eicDecisions
}
submitDecision={createRecommendation}
/>
)}
{get(currentUser, 'permissions.canMakeHERecommendation', false) && (
<HERecommendation
formValues={get(formValues, 'editorialRecommendation', {})}
hasReviewerReports={reviewerRecommendations.length > 0}
modalKey="heRecommendation"
onRecommendationSubmit={onEditorialRecommendation}
/>
)}
{get(currentUser, 'permissions.canViewReviewersDetails', false) && (
<ReviewerDetails
currentUser={currentUser}
......@@ -193,14 +170,39 @@ const ManuscriptLayout = ({
getSignedUrl={getSignedUrl}
invitations={invitationsWithReviewers}
journal={journal}
mb={2}
mt={2}
onInviteReviewer={onInviteReviewer}
onResendReviewerInvite={onResendReviewerInvite}
onRevokeReviewerInvite={onRevokeReviewerInvite}
reviewerReports={reviewerReports}
scrollIntoView
toggle={toggleReviewerDetails}
/>
)}
{get(currentUser, 'permissions.canMakeHERecommendation', false) && (
<HERecommendation
formValues={get(formValues, 'editorialRecommendation', {})}
hasReviewerReports={reviewerRecommendations.length > 0}
modalKey="heRecommendation"
onRecommendationSubmit={onEditorialRecommendation}
/>
)}
{get(currentUser, 'permissions.canMakeDecision', false) && (
<ManuscriptEicDecision
formValues={get(formValues, 'eicDecision')}
messagesLabel={messagesLabel}
mt={2}
options={
get(collection, 'status', 'submitted') === 'submitted'
? [last(eicDecisions)]
: eicDecisions
}
submitDecision={createRecommendation}
/>
)}
</Fragment>
) : (
<Text>Loading...</Text>
......
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