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