Skip to content
Snippets Groups Projects

Hin 1013

Merged Tania Fecheta requested to merge HIN-1013 into develop
All threads resolved!
Files
7
@@ -61,6 +61,32 @@ export const canViewReviewersDetails = (state, collection = {}) => {
return canViewReports(state, collection.id)
}
const canAuthorViewEditorialCommentsStatuses = [
'accepted',
'rejected',
'revisionRequested',
]
export const canAuthorViewEditorialComments = (
state,
collection = {},
fragmentId,
) => {
const isAuthor = currentUserIsAuthor(state, fragmentId)
return (
isAuthor &&
canAuthorViewEditorialCommentsStatuses.includes(
get(collection, 'status', 'draft'),
)
)
}
const hideEditorNameStatuses = 'revisionRequested'
export const hideEditorName = (collection = {}) => {
const status = get(collection, 'status', 'draft')
return hideEditorNameStatuses.includes(status)
}
const canHeViewEditorialCommentsStatuses = [
'revisionRequested',
'rejected',
@@ -92,7 +118,8 @@ export const canViewEditorialComments = (
)
return (
(canHeViewEditorialComments(state, collection) ||
canEICViewEditorialComments(state, collection)) &&
canEICViewEditorialComments(state, collection) ||
canAuthorViewEditorialComments(state, collection, fragmentId)) &&
editorialRecommentations.length > 0
)
}