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
fb27ec20
Commit
fb27ec20
authored
6 years ago
by
Mihail Hagiu
Browse files
Options
Downloads
Patches
Plain Diff
feat(GetCollections): Reviewer correctly sees manuscript versions
parent
17326d21
No related branches found
No related tags found
3 merge requests
!160
Update staging with master features
,
!150
Develop
,
!138
Hin 991
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/component-manuscript-manager/src/routes/collections/get.js
+1
-6
1 addition, 6 deletions
...omponent-manuscript-manager/src/routes/collections/get.js
packages/xpub-faraday/config/authsome-helpers.js
+11
-2
11 additions, 2 deletions
packages/xpub-faraday/config/authsome-helpers.js
with
12 additions
and
8 deletions
packages/component-manuscript-manager/src/routes/collections/get.js
+
1
−
6
View file @
fb27ec20
const
{
last
,
get
}
=
require
(
'
lodash
'
)
const
filterDuplicates
=
collection
=>
get
(
collection
,
'
currentVersion.id
'
)
===
last
(
collection
.
fragments
)
const
{
const
{
authsome
:
authsomeHelper
,
authsome
:
authsomeHelper
,
}
=
require
(
'
pubsweet-component-helper-service
'
)
}
=
require
(
'
pubsweet-component-helper-service
'
)
...
@@ -21,5 +16,5 @@ module.exports = models => async (req, res) => {
...
@@ -21,5 +16,5 @@ module.exports = models => async (req, res) => {
})
})
}
}
res
.
status
(
200
).
json
(
collections
.
filter
(
filterDuplicates
)
)
res
.
status
(
200
).
json
(
collections
)
}
}
This diff is collapsed.
Click to expand it.
packages/xpub-faraday/config/authsome-helpers.js
+
11
−
2
View file @
fb27ec20
const
{
omit
,
get
,
last
}
=
require
(
'
lodash
'
)
const
{
omit
,
get
,
last
,
chain
}
=
require
(
'
lodash
'
)
const
config
=
require
(
'
config
'
)
const
config
=
require
(
'
config
'
)
const
logger
=
require
(
'
@pubsweet/logger
'
)
const
logger
=
require
(
'
@pubsweet/logger
'
)
...
@@ -207,7 +207,7 @@ const parseUser = ({ user }) => omit(user, sensitiveUserProperties)
...
@@ -207,7 +207,7 @@ const parseUser = ({ user }) => omit(user, sensitiveUserProperties)
const
getCollections
=
async
({
user
,
models
})
=>
{
const
getCollections
=
async
({
user
,
models
})
=>
{
const
userPermisssions
=
await
getUserPermissions
({
user
,
Team
:
models
.
Team
})
const
userPermisssions
=
await
getUserPermissions
({
user
,
Team
:
models
.
Team
})
return
(
await
Promise
.
all
(
const
collections
=
(
await
Promise
.
all
(
userPermisssions
.
map
(
async
up
=>
{
userPermisssions
.
map
(
async
up
=>
{
let
fragment
=
{}
let
fragment
=
{}
let
collection
=
{}
let
collection
=
{}
...
@@ -253,6 +253,11 @@ const getCollections = async ({ user, models }) => {
...
@@ -253,6 +253,11 @@ const getCollections = async ({ user, models }) => {
}
}
}),
}),
)).
filter
(
Boolean
)
)).
filter
(
Boolean
)
return
chain
(
collections
)
.
sortBy
(
c
=>
c
.
currentVersion
.
version
)
.
reverse
()
.
uniqBy
(
'
id
'
)
.
value
()
}
}
async
function
updateReviewerVisibleStatusByInvitation
({
async
function
updateReviewerVisibleStatusByInvitation
({
...
@@ -278,6 +283,10 @@ async function updateReviewerVisibleStatusByInvitation({
...
@@ -278,6 +283,10 @@ async function updateReviewerVisibleStatusByInvitation({
return
get
(
statuses
,
`
${
collection
.
status
}
.reviewer.label`
)
return
get
(
statuses
,
`
${
collection
.
status
}
.reviewer.label`
)
}
}
if
(
!
invitation
)
{
return
get
(
statuses
,
`reviewCompleted.reviewer.label`
)
}
return
get
(
invitation
,
'
hasAnswer
'
,
false
)
&&
return
get
(
invitation
,
'
hasAnswer
'
,
false
)
&&
get
(
invitation
,
'
isAccepted
'
,
false
)
get
(
invitation
,
'
isAccepted
'
,
false
)
?
get
(
statuses
,
`underReview.reviewer.label`
)
?
get
(
statuses
,
`underReview.reviewer.label`
)
...
...
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