Skip to content
Snippets Groups Projects
Commit dabaa790 authored by Iosif Boanca's avatar Iosif Boanca
Browse files

canAuthorViewEditorialComments added

parent 9e4e9966
No related branches found
No related tags found
1 merge request!96Hin 1006
...@@ -108,6 +108,29 @@ export const canEICViewEditorialComments = (state, collection = {}) => { ...@@ -108,6 +108,29 @@ export const canEICViewEditorialComments = (state, collection = {}) => {
return isEIC && canEICViewEditorialCommentsStatuses.includes(status) return isEIC && canEICViewEditorialCommentsStatuses.includes(status)
} }
const cannotAuthorViewEditorialCommentsStatuses = [
'draft',
'technicalChecks',
'submitted',
'heInvited',
'heAssigned',
'reviewersInvited',
]
export const canAuthorViewEditorialComments = (
state,
collection = {},
fragmentId,
) => {
const isAuthor = currentUserIsAuthor(state, fragmentId)
return (
isAuthor &&
!cannotAuthorViewEditorialCommentsStatuses.includes(
get(collection, 'status', 'draft'),
)
)
}
export const canViewEditorialComments = ( export const canViewEditorialComments = (
state, state,
collection = {}, collection = {},
......
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