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

fix(editorialReportCard): changes after code review

parent 573a8422
No related branches found
No related tags found
1 merge request!111Hin 1059
...@@ -17,6 +17,7 @@ const EditorialReportCard = ({ ...@@ -17,6 +17,7 @@ const EditorialReportCard = ({
recommendation, recommendation,
editorName, editorName,
editorRole, editorRole,
handlingEditorName,
collection, collection,
report: { createdOn, reviewer }, report: { createdOn, reviewer },
}) => ( }) => (
...@@ -35,7 +36,7 @@ const EditorialReportCard = ({ ...@@ -35,7 +36,7 @@ const EditorialReportCard = ({
{reviewer && ( {reviewer && (
<Fragment> <Fragment>
<Text mr={1 / 2}> <Text mr={1 / 2}>
{editorName !== 'Assigned' ? editorName : ''} {handlingEditorName !== 'Assigned' ? editorName : ''}
</Text> </Text>
<Tag mr={2}>{editorRole}</Tag> <Tag mr={2}>{editorRole}</Tag>
</Fragment> </Fragment>
...@@ -68,18 +69,20 @@ const EditorialReportCard = ({ ...@@ -68,18 +69,20 @@ const EditorialReportCard = ({
export default compose( export default compose(
withHandlers({ withHandlers({
getReviewerRole: ({ report }) => () => { getEditorRole: ({ report }) => () => {
if (get(report, 'reviewer.handlingEditor')) { if (get(report, 'reviewer.handlingEditor')) {
return 'HE' return 'HE'
} }
return get(report, 'reviewer.editorInChief') ? 'EiC' : '' return get(report, 'reviewer.editorInChief') ? 'EiC' : ''
}, },
getReviewerName: ({ report }) => () => getEditorName: ({ report }) => () =>
`${get(report, 'reviewer.firstName', '')} ${get( `${get(report, 'reviewer.firstName', '')} ${get(
report, report,
'reviewer.lastName', 'reviewer.lastName',
'', '',
)}`, )}`,
getHandlingEditorName: ({ collection }) => () =>
`${get(collection, 'handlingEditor.name', '')}`,
getRecommendationLabel: ({ getRecommendationLabel: ({
report, report,
journal: { recommendations = [] }, journal: { recommendations = [] },
...@@ -91,12 +94,19 @@ export default compose( ...@@ -91,12 +94,19 @@ export default compose(
), ),
}), }),
withProps( withProps(
({ report, getReviewerRole, getReviewerName, getRecommendationLabel }) => ({ ({
report,
getEditorRole,
getEditorName,
getHandlingEditorName,
getRecommendationLabel,
}) => ({
recommendation: getRecommendationLabel(), recommendation: getRecommendationLabel(),
publicReport: getReportComments({ report, isPublic: true }), publicReport: getReportComments({ report, isPublic: true }),
privateReport: getReportComments({ report, isPublic: false }), privateReport: getReportComments({ report, isPublic: false }),
editorName: getReviewerName(), handlingEditorName: getHandlingEditorName(),
editorRole: getReviewerRole(), editorName: getEditorName(),
editorRole: getEditorRole(),
}), }),
), ),
)(EditorialReportCard) )(EditorialReportCard)
......
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