Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
X
xpub-faraday
Manage
Activity
Members
Labels
Plan
Issues
2
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container Registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
xpub
xpub-faraday
Commits
5670cdbd
Commit
5670cdbd
authored
6 years ago
by
Mihail Hagiu
Browse files
Options
Downloads
Patches
Plain Diff
fix(ReviewerEditorialComments): Reviewers can now see editorial comments
parent
b8cc767d
No related branches found
No related tags found
1 merge request
!121
Hin 1043 fix
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
packages/component-faraday-selectors/src/index.js
+7
-4
7 additions, 4 deletions
packages/component-faraday-selectors/src/index.js
with
7 additions
and
4 deletions
packages/component-faraday-selectors/src/index.js
+
7
−
4
View file @
5670cdbd
import
{
get
,
has
,
last
,
chain
}
from
'
lodash
'
import
{
get
,
has
,
last
,
chain
,
some
}
from
'
lodash
'
import
{
selectCurrentUser
}
from
'
xpub-selectors
'
export
const
isHEToManuscript
=
(
state
,
collectionId
=
''
)
=>
{
...
...
@@ -114,6 +114,7 @@ export const canEICViewEditorialComments = (state, collection = {}) => {
return
isEIC
&&
canEICViewEditorialCommentsStatuses
.
includes
(
status
)
}
const
decisionTakenStatuses
=
[
'
rejected
'
,
'
accepted
'
,
'
inQA
'
]
const
canReviewerViewEditorialCommentsStatuses
=
[
'
underReview
'
,
'
reviewCompleted
'
,
...
...
@@ -127,15 +128,17 @@ export const canReviewerViewEditorialComments = (
)
=>
{
const
status
=
get
(
collection
,
'
status
'
,
'
draft
'
)
const
isReviewer
=
currentUserIsReviewer
(
state
,
get
(
fragment
,
'
id
'
,
''
))
const
hasDecision
=
[
'
rejected
'
,
'
accepted
'
,
'
inQA
'
].
includes
(
status
)
const
hasRevision
=
get
(
fragment
,
'
revision
'
,
false
)
const
hasDecision
=
decisionTakenStatuses
.
includes
(
status
)
const
fragmentVersion
=
fragment
.
version
const
hasSubmission
=
some
(
state
.
fragments
,
f
=>
f
.
version
>
fragmentVersion
)
return
(
isReviewer
&&
(
hasDecision
||
(
has
Revi
sion
&&
(
has
Submis
sion
&&
canReviewerViewEditorialCommentsStatuses
.
includes
(
status
)))
)
}
const
cannotAuthorViewEditorialCommentsStatuses
=
[
'
draft
'
,
'
technicalChecks
'
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment