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 = ({
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)
......
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