diff --git a/packages/component-faraday-ui/src/EditorialReportCard.js b/packages/component-faraday-ui/src/EditorialReportCard.js index 9f326c34063697f2aa29ed40f35047d22e86f605..a43986b4f6648e98b674c47863440594a311bc18 100644 --- a/packages/component-faraday-ui/src/EditorialReportCard.js +++ b/packages/component-faraday-ui/src/EditorialReportCard.js @@ -17,7 +17,6 @@ const EditorialReportCard = ({ recommendation, editorName, editorRole, - handlingEditorName, collection, report: { createdOn, reviewer }, }) => ( @@ -36,7 +35,7 @@ const EditorialReportCard = ({ {reviewer && ( <Fragment> <Text mr={1 / 2}> - {handlingEditorName !== 'Assigned' ? editorName : ''} + {editorName !== 'Assigned' ? editorName : ''} </Text> <Tag mr={2}>{editorRole}</Tag> </Fragment> @@ -81,8 +80,6 @@ export default compose( 'reviewer.lastName', '', )}`, - getHandlingEditorName: ({ collection }) => () => - `${get(collection, 'handlingEditor.name', '')}`, getRecommendationLabel: ({ report, journal: { recommendations = [] }, @@ -94,17 +91,10 @@ export default compose( ), }), withProps( - ({ - report, - getReviewerRole, - getReviewerName, - getHandlingEditorName, - getRecommendationLabel, - }) => ({ + ({ report, getReviewerRole, getReviewerName, getRecommendationLabel }) => ({ recommendation: getRecommendationLabel(), publicReport: getReportComments({ report, isPublic: true }), privateReport: getReportComments({ report, isPublic: false }), - handlingEditorName: getHandlingEditorName(), editorName: getReviewerName(), editorRole: getReviewerRole(), }), diff --git a/packages/component-faraday-ui/src/contextualBoxes/AuthorReviews.js b/packages/component-faraday-ui/src/contextualBoxes/AuthorReviews.js index 447a7614b1a06bf362b4d03db9d0d4a6244a571e..1bd5ca285bd9e16c2af76402abe6689c3bf2738a 100644 --- a/packages/component-faraday-ui/src/contextualBoxes/AuthorReviews.js +++ b/packages/component-faraday-ui/src/contextualBoxes/AuthorReviews.js @@ -16,7 +16,7 @@ const SubmittedReportsNumberForAuthorReviews = ({ reports }) => ( ) const AuthorReviews = ({ invitations, journal, reports, fragment }) => - reports.length && ( + reports.length > 0 && ( <ContextualBox label="Review Reports" rightChildren={ diff --git a/packages/xpub-faraday/config/authsome-helpers.js b/packages/xpub-faraday/config/authsome-helpers.js index 0d990961263d0d0ff397c1deb7786c6b2e39b2a5..c65fa8ca67385ccd3a5e97c91846fd925a2b5c60 100644 --- a/packages/xpub-faraday/config/authsome-helpers.js +++ b/packages/xpub-faraday/config/authsome-helpers.js @@ -138,24 +138,6 @@ const filterAuthorRecommendations = (recommendations, status, isLast) => { return [] } -const stripeCollectionByRole = ({ collection = {}, role = '' }) => { - if (role === 'author') { - const { handlingEditor } = collection - - if (!authorCanViewHENameStatuses.includes(collection.status)) { - return { - ...collection, - handlingEditor: handlingEditor && - handlingEditor.isAccepted && { - ...omit(handlingEditor, keysToOmit), - name: 'Assigned', - }, - } - } - } - return collection -} - const stripeFragmentByRole = ({ fragment = {}, role = '', @@ -246,11 +228,6 @@ const getCollections = async ({ user, models }) => { const status = get(collection, 'status', 'draft') collection.visibleStatus = get(statuses, `${status}.${up.role}.label`) - const stripedColl = stripeCollectionByRole({ - collection, - role: up.role, - }) - const role = get(up, 'role', 'author') let visibleStatus = get(statuses, `${status}.${role}.label`) @@ -263,7 +240,7 @@ const getCollections = async ({ user, models }) => { }) } - return { ...stripedColl, visibleStatus } + return { ...collection, visibleStatus } }), )).filter(Boolean) } @@ -307,7 +284,6 @@ module.exports = { hasPermissionForObject, isInDraft, hasFragmentInDraft, - stripeCollectionByRole, stripeFragmentByRole, getUsersList, parseUser, diff --git a/packages/xpub-faraday/config/authsome-mode.js b/packages/xpub-faraday/config/authsome-mode.js index e480663e8f3c835340f53bf92251dd3a679d04d8..7b269f3855277ae6aea96a9afca4043f647af6f2 100644 --- a/packages/xpub-faraday/config/authsome-mode.js +++ b/packages/xpub-faraday/config/authsome-mode.js @@ -96,13 +96,8 @@ async function applyAuthenticatedUserPolicy(user, operation, object, context) { ) } - const parsedCollection = helpers.stripeCollectionByRole({ - collection, - role, - }) - return { - ...parsedCollection, + ...collection, visibleStatus, } },