Skip to content
Snippets Groups Projects

fix(reviewerDetails): fix eic not seeing the reports

Merged Bogdan Cochior requested to merge hin-1003 into develop
4 files
+ 79
55
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -28,18 +28,34 @@ export const currentUserIs = ({ currentUser: { user } }, role) => {
}
}
const cannotInviteReviewersStatuses = ['draft', 'rejected', 'published']
const canInviteReviewersStatuses = [
'heAssigned',
'reviewersInvited',
'underReview',
'reviewCompleted',
]
export const canInviteReviewers = (state, collection) => {
if (
cannotInviteReviewersStatuses.includes(get(collection, 'status', 'draft'))
)
if (!canInviteReviewersStatuses.includes(get(collection, 'status', 'draft')))
return false
const user = selectCurrentUser(state)
const isStaff = currentUserIs(state, 'isAdmin')
const isAdmin = currentUserIs(state, 'isAdmin')
const { isAccepted, id: heId } = get(collection, 'handlingEditor', {})
return isAccepted && (user.id === heId || isStaff)
return isAccepted && (user.id === heId || isAdmin)
}
const cannotViewReviewersDetails = [
'draft',
'technicalChecks',
'submitted',
'heInvited',
]
export const canViewReviewersDetails = (state, collection = {}) => {
if (cannotViewReviewersDetails.includes(get(collection, 'status', 'draft'))) {
return false
}
return canViewReports(state, collection.id)
}
export const getUserToken = ({ currentUser }) =>