From 09ac0510251062e8938c2464d7b55c163b18a0a2 Mon Sep 17 00:00:00 2001 From: Anca Ursachi <anca.ursachi@thinslices.com> Date: Wed, 17 Oct 2018 09:19:32 +0300 Subject: [PATCH] fix(deleteHideEditorNameConstant): --- .../component-faraday-selectors/src/index.js | 6 --- .../src/EditorialReportCard.js | 3 +- .../src/EditorialReportCard.md | 42 ++++++++----------- .../src/manuscriptDetails/ManuscriptHeader.js | 4 -- .../src/components/EditorialCommentCard.js | 11 +---- .../src/components/ManuscriptLayout.js | 4 -- .../src/components/ManuscriptPage.js | 2 - 7 files changed, 20 insertions(+), 52 deletions(-) diff --git a/packages/component-faraday-selectors/src/index.js b/packages/component-faraday-selectors/src/index.js index a6f10f0e7..29dcce108 100644 --- a/packages/component-faraday-selectors/src/index.js +++ b/packages/component-faraday-selectors/src/index.js @@ -81,12 +81,6 @@ export const canAuthorViewEditorialComments = ( ) } -const hideEditorNameStatuses = 'revisionRequested' -export const hideEditorName = (collection = {}) => { - const status = get(collection, 'status', 'draft') - return hideEditorNameStatuses.includes(status) -} - const canHeViewEditorialCommentsStatuses = [ 'revisionRequested', 'rejected', diff --git a/packages/component-faraday-ui/src/EditorialReportCard.js b/packages/component-faraday-ui/src/EditorialReportCard.js index 8d0c31657..a89ca7749 100644 --- a/packages/component-faraday-ui/src/EditorialReportCard.js +++ b/packages/component-faraday-ui/src/EditorialReportCard.js @@ -15,7 +15,6 @@ const EditorialReportCard = ({ publicReport, privateReport, recommendation, - hideEditorName, editorName, editorRole, report: { createdOn, reviewer }, @@ -34,7 +33,7 @@ const EditorialReportCard = ({ <Item justify="flex-end"> {reviewer && ( <Fragment> - <Text mr={1 / 2}>{hideEditorName ? '' : editorName}</Text> + <Text mr={1 / 2}>{editorName}</Text> <Tag mr={2}>{editorRole}</Tag> </Fragment> )} diff --git a/packages/component-faraday-ui/src/EditorialReportCard.md b/packages/component-faraday-ui/src/EditorialReportCard.md index d663f8d9a..4d62d34b5 100644 --- a/packages/component-faraday-ui/src/EditorialReportCard.md +++ b/packages/component-faraday-ui/src/EditorialReportCard.md @@ -47,14 +47,12 @@ const journal = { }, ], } -const hideEditorName = true -;<EditorialReportCard - report={report} - journal={journal} - publicLabel="Message For Author" - privateLabel="Message For Editorial Team" - hideEditorName={hideEditorName} - /> +;<EditorialReportCard + report={report} + journal={journal} + publicLabel="Message For Author" + privateLabel="Message For Editorial Team" +/> ``` Card with message for the editorial team @@ -104,13 +102,12 @@ const journal = { }, ], } -;<EditorialReportCard - report={report} - journal={journal} - publicLabel="Message For Author" - privateLabel="Message For Editorial Team" - hideEditorName={hideEditorName} - /> +;<EditorialReportCard + report={report} + journal={journal} + publicLabel="Message For Author" + privateLabel="Message For Editorial Team" +/> ``` Card with message for the editorial team and for the author @@ -144,7 +141,6 @@ const report = { editorInChief: false, handlingEditor: true, }, - } const journal = { recommendations: [ @@ -166,12 +162,10 @@ const journal = { }, ], } - -;<EditorialReportCard - report={report} - journal={journal} - publicLabel="Message For Author" - privateLabel="Message For Editorial Team" - hideEditorName={hideEditorName} - /> +;<EditorialReportCard + report={report} + journal={journal} + publicLabel="Message For Author" + privateLabel="Message For Editorial Team" +/> ``` diff --git a/packages/component-faraday-ui/src/manuscriptDetails/ManuscriptHeader.js b/packages/component-faraday-ui/src/manuscriptDetails/ManuscriptHeader.js index 2a47ec298..cc7976660 100644 --- a/packages/component-faraday-ui/src/manuscriptDetails/ManuscriptHeader.js +++ b/packages/component-faraday-ui/src/manuscriptDetails/ManuscriptHeader.js @@ -97,7 +97,6 @@ export default compose( inviteHE, isFetching, heInvitation, - hideEditorName, resendInvitation, revokeInvitation, pendingInvitation = {}, @@ -126,9 +125,6 @@ export default compose( /> ) } - if (hideEditorName) { - return <Text ml={1}>Assigned</Text> - } if (heInvitation) { return <Text ml={1}>{handlingEditor.name}</Text> } diff --git a/packages/component-manuscript/src/components/EditorialCommentCard.js b/packages/component-manuscript/src/components/EditorialCommentCard.js index 490601d87..366200e4f 100644 --- a/packages/component-manuscript/src/components/EditorialCommentCard.js +++ b/packages/component-manuscript/src/components/EditorialCommentCard.js @@ -6,15 +6,7 @@ import { withFileDownload, } from 'pubsweet-component-faraday-ui' -// const EditorialCommentCard = ({ journal, reports = [], hideEditorName }) => ( -// <ContextualBox label="Editorial Comments" mb={2}> -const EditorialCommentCard = ({ - journal, - reports = [], - toggle, - expanded, - hideEditorName, -}) => ( +const EditorialCommentCard = ({ journal, reports = [], toggle, expanded }) => ( <ContextualBox expanded={expanded} label="Editorial Comments" @@ -24,7 +16,6 @@ const EditorialCommentCard = ({ > {reports.map(report => ( <EditorialReportCard - hideEditorName={hideEditorName} journal={journal} key={report.id} privateLabel="Message For Editorial Team" diff --git a/packages/component-manuscript/src/components/ManuscriptLayout.js b/packages/component-manuscript/src/components/ManuscriptLayout.js index 587a37394..ff41d40a2 100644 --- a/packages/component-manuscript/src/components/ManuscriptLayout.js +++ b/packages/component-manuscript/src/components/ManuscriptLayout.js @@ -31,7 +31,6 @@ const ManuscriptLayout = ({ getSignedUrl, editorInChief, handlingEditors, - hideEditorName, createRecommendation, editorialRecommendations, journal = {}, @@ -84,8 +83,6 @@ const ManuscriptLayout = ({ currentUser={currentUser} editorInChief={editorInChief} fragment={fragment} - handlingEditors={handlingEditors} - hideEditorName={hideEditorName} inviteHE={toggleAssignHE} isFetching={isFetching.editorsFetching} journal={journal} @@ -102,7 +99,6 @@ const ManuscriptLayout = ({ {get(currentUser, 'permissions.canViewEditorialComments', true) && ( <EditorialCommentCard expanded={heRecommendationExpanded} - hideEditorName={hideEditorName} journal={journal} reports={editorialRecommendations} toggle={toggleHeRecommendation} diff --git a/packages/component-manuscript/src/components/ManuscriptPage.js b/packages/component-manuscript/src/components/ManuscriptPage.js index ceb047359..3d1ce6f06 100644 --- a/packages/component-manuscript/src/components/ManuscriptPage.js +++ b/packages/component-manuscript/src/components/ManuscriptPage.js @@ -57,7 +57,6 @@ import { canAuthorViewEditorialComments, getFragmentReviewerRecommendations, getInvitationsWithReviewersForFragment, - hideEditorName, } from 'pubsweet-component-faraday-selectors' import { RemoteOpener, @@ -188,7 +187,6 @@ export default compose( ), }, }, - hideEditorName: hideEditorName(collection), isFetching: { editorsFetching: selectFetching(state), publonsFetching: isFetching, -- GitLab