diff --git a/packages/component-faraday-ui/src/EditorialReportCard.js b/packages/component-faraday-ui/src/EditorialReportCard.js index a43986b4f6648e98b674c47863440594a311bc18..1f394ee94dd7a7af80267eadfc9e59aeb07161b1 100644 --- a/packages/component-faraday-ui/src/EditorialReportCard.js +++ b/packages/component-faraday-ui/src/EditorialReportCard.js @@ -17,6 +17,7 @@ const EditorialReportCard = ({ recommendation, editorName, editorRole, + handlingEditorName, collection, report: { createdOn, reviewer }, }) => ( @@ -35,7 +36,7 @@ const EditorialReportCard = ({ {reviewer && ( <Fragment> <Text mr={1 / 2}> - {editorName !== 'Assigned' ? editorName : ''} + {handlingEditorName !== 'Assigned' ? editorName : ''} </Text> <Tag mr={2}>{editorRole}</Tag> </Fragment> @@ -68,18 +69,20 @@ const EditorialReportCard = ({ export default compose( withHandlers({ - getReviewerRole: ({ report }) => () => { + getEditorRole: ({ report }) => () => { if (get(report, 'reviewer.handlingEditor')) { return 'HE' } return get(report, 'reviewer.editorInChief') ? 'EiC' : '' }, - getReviewerName: ({ report }) => () => + getEditorName: ({ report }) => () => `${get(report, 'reviewer.firstName', '')} ${get( report, 'reviewer.lastName', '', )}`, + getHandlingEditorName: ({ collection }) => () => + `${get(collection, 'handlingEditor.name', '')}`, getRecommendationLabel: ({ report, journal: { recommendations = [] }, @@ -91,12 +94,19 @@ export default compose( ), }), withProps( - ({ report, getReviewerRole, getReviewerName, getRecommendationLabel }) => ({ + ({ + report, + getEditorRole, + getEditorName, + getHandlingEditorName, + getRecommendationLabel, + }) => ({ recommendation: getRecommendationLabel(), publicReport: getReportComments({ report, isPublic: true }), privateReport: getReportComments({ report, isPublic: false }), - editorName: getReviewerName(), - editorRole: getReviewerRole(), + handlingEditorName: getHandlingEditorName(), + editorName: getEditorName(), + editorRole: getEditorRole(), }), ), )(EditorialReportCard)