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
678816e3
Commit
678816e3
authored
6 years ago
by
Alexandru Munteanu
Browse files
Options
Downloads
Patches
Plain Diff
feat(eic-decision): show make decision only to admin and eic
parent
2d5346bc
No related branches found
No related tags found
1 merge request
!10
Sprint #12
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/component-faraday-selectors/src/index.js
+16
-0
16 additions, 0 deletions
packages/component-faraday-selectors/src/index.js
packages/components-faraday/src/components/Dashboard/DashboardCard.js
+15
-9
15 additions, 9 deletions
...ponents-faraday/src/components/Dashboard/DashboardCard.js
with
31 additions
and
9 deletions
packages/component-faraday-selectors/src/index.js
+
16
−
0
View file @
678816e3
...
...
@@ -16,3 +16,19 @@ export const canMakeRecommendation = (state, project) => {
const
isHE
=
isHEToManuscript
(
state
,
project
.
id
)
return
isHE
&&
get
(
project
,
'
status
'
)
===
'
reviewCompleted
'
}
export
const
currentUserIs
=
({
currentUser
},
role
)
=>
{
const
isAdmin
=
get
(
currentUser
,
'
admin
'
)
const
isEic
=
get
(
currentUser
,
'
editorInChief
'
)
const
isHe
=
get
(
currentUser
,
'
handlingEditor
'
)
switch
(
role
)
{
case
'
isHE
'
:
return
isHe
case
'
staff
'
:
return
isAdmin
||
isEic
||
isHe
case
'
adminEiC
'
:
return
isAdmin
||
isEic
default
:
return
false
}
}
This diff is collapsed.
Click to expand it.
packages/components-faraday/src/components/Dashboard/DashboardCard.js
+
15
−
9
View file @
678816e3
...
...
@@ -14,11 +14,13 @@ import { AuthorsWithTooltip } from 'pubsweet-component-manuscript/src/molecules'
import
ZipFiles
from
'
../Files/ZipFiles
'
import
{
InviteReviewers
}
from
'
../Reviewers/
'
import
{
currentUserIs
}
from
'
../../redux/users
'
import
{
selectInvitation
}
from
'
../../redux/reviewers
'
import
{
ReviewerDecision
,
HandlingEditorSection
}
from
'
./
'
import
{
parseVersion
,
parseJournalIssue
,
mapStatusToLabel
}
from
'
./../utils
'
import
{
canMakeRecommendation
}
from
'
../../../../component-faraday-selectors/src
'
import
{
currentUserIs
,
canMakeRecommendation
,
}
from
'
../../../../component-faraday-selectors/src
'
import
{
Decision
}
from
'
../MakeDecision
'
import
{
ReviewerBreakdown
}
from
'
../Invitations
'
...
...
@@ -26,6 +28,7 @@ import { Recommendation } from '../MakeRecommendation'
const
DashboardCard
=
({
isHE
,
isEIC
,
theme
,
journal
,
history
,
...
...
@@ -63,12 +66,14 @@ const DashboardCard = ({
/
>
<
/LeftDetails
>
<
RightDetails
flex
=
{
2
}
>
<
Decision
collectionId
=
{
project
.
id
}
fragmentId
=
{
version
.
id
}
heRecommendation
=
{
heRecommendation
}
modalKey
=
{
`decide-
${
version
.
id
}
`
}
/
>
{
isEIC
&&
(
<
Decision
collectionId
=
{
project
.
id
}
fragmentId
=
{
version
.
id
}
heRecommendation
=
{
heRecommendation
}
modalKey
=
{
`decide-
${
version
.
id
}
`
}
/
>
)}
{
canMakeRecommendation
&&
(
<
Recommendation
collectionId
=
{
project
.
id
}
...
...
@@ -125,7 +130,7 @@ const DashboardCard = ({
}
>
Details
<
Icon
color
=
{
theme
.
colorP
rimary
}
>
chevron
-
right
<
/Icon
>
<
Icon
p
rimary
>
chevron
-
right
<
/Icon
>
<
/Details
>
)
:
(
<
Details
...
...
@@ -189,6 +194,7 @@ export default compose(
modalComponent
:
ConfirmationModal
,
}),
connect
((
state
,
{
project
})
=>
({
isEIC
:
currentUserIs
(
state
,
'
adminEiC
'
),
isHE
:
currentUserIs
(
state
,
'
handlingEditor
'
),
invitation
:
selectInvitation
(
state
,
project
.
id
),
canMakeRecommendation
:
canMakeRecommendation
(
state
,
project
),
...
...
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