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

feat((eicMakeDecisionFlow)): extend make decision contextual box and highlight...

feat((eicMakeDecisionFlow)): extend make decision contextual box and highlight editorial decision co
parent b16891af
No related branches found
No related tags found
2 merge requests!110Sprint 21 Features,!92Hin 946
......@@ -40,22 +40,20 @@ const ManuscriptEicDecision = ({
</ItemOverrideAlert>
</Row>
<Row mt={2}>
<Item vertical>
<Label required>
{
messagesLabel[
get(formValues, 'decision', 'return-to-handling-editor')
]
}
</Label>
<ValidatedField
component={ValidatedTextArea}
name="message"
validate={[required]}
/>
</Item>
</Row>
{get(formValues, 'decision') !== 'publish' && (
<Row mt={2}>
<Item vertical>
<Label required>
{messagesLabel[get(formValues, 'decision', 'reject')]}
</Label>
<ValidatedField
component={ValidatedTextArea}
name="message"
validate={[required]}
/>
</Item>
</Row>
)}
<Row justify="flex-end" mt={4}>
<Button onClick={handleSubmit} primary size="medium">
......
......@@ -6,8 +6,14 @@ import {
withFileDownload,
} from 'pubsweet-component-faraday-ui'
const EditorialCommentCard = ({ journal, reports = [] }) => (
<ContextualBox label="Editorial Comments" mb={2}>
const EditorialCommentCard = ({ journal, reports = [], toggle, expanded }) => (
<ContextualBox
expanded={expanded}
label="Editorial Comments"
mb={2}
scrollIntoView
toggle={toggle}
>
{reports.map(report => (
<EditorialReportCard journal={journal} key={report.id} report={report} />
))}
......
......@@ -26,7 +26,6 @@ const eicDecisions = [
const messagesLabel = {
'return-to-handling-editor': 'Comments for Handling Editor',
publish: 'Comments for Author',
reject: 'Comments for Author',
}
......@@ -69,6 +68,8 @@ const ManuscriptLayout = ({
reviewerRecommendations,
toggleReviewerDetails,
reviewerDetailsExpanded,
toggleHeRecommendation,
heRecommendationExpanded,
}) => (
<Root pb={30}>
{!isEmpty(collection) && !isEmpty(fragment) ? (
......@@ -103,8 +104,10 @@ const ManuscriptLayout = ({
{get(currentUser, 'permissions.canViewReports', true) &&
!!editorialRecommendations.length && (
<EditorialCommentCard
expanded={heRecommendationExpanded}
journal={journal}
reports={editorialRecommendations}
toggle={toggleHeRecommendation}
/>
)}
......@@ -194,6 +197,7 @@ const ManuscriptLayout = ({
{get(currentUser, 'permissions.canMakeDecision', false) && (
<ManuscriptEicDecision
formValues={get(formValues, 'eicDecision')}
highlight={editorialRecommendations.length > 0}
messagesLabel={messagesLabel}
mt={2}
options={
......
......@@ -425,6 +425,10 @@ export default compose(
toggleReviewerDetails: toggle,
reviewerDetailsExpanded: expanded,
})),
fromRenderProps(RemoteOpener, ({ toggle, expanded }) => ({
toggleHeRecommendation: toggle,
heRecommendationExpanded: expanded,
})),
withProps(({ currentUser, collection, submittedOwnRecommendation }) => ({
getSignedUrl,
shouldReview:
......@@ -443,7 +447,13 @@ export default compose(
clearCustomError,
hasManuscriptFailure,
fetchUpdatedCollection,
currentUser: { isInvitedHE, isInvitedToReview, isHEToManuscript },
editorialRecommendations,
currentUser: {
isInvitedHE,
isInvitedToReview,
isHEToManuscript,
isEIC,
},
} = this.props
if (hasManuscriptFailure) {
history.push('/not-found')
......@@ -479,6 +489,10 @@ export default compose(
if (isHEToManuscript && !!reviewerReports.length) {
this.props.toggleReviewerDetails()
}
if (isEIC && !!editorialRecommendations.length) {
this.props.toggleHeRecommendation()
}
},
}),
)(ManuscriptLayout)
......@@ -73,7 +73,7 @@ const DecisionForm = ({
{decision === 'return-to-handling-editor' && (
<Row>
<RowItem vertical>
<Label>Comments for Handling Editor</Label>
<Label>Comments for Author</Label>
<ValidatedField
component={TextAreaField}
name="messageToHE"
......
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