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
c9a4bf06
Commit
c9a4bf06
authored
6 years ago
by
Sebastian Mihalache
Browse files
Options
Downloads
Patches
Plain Diff
fix(manuscript-manager): handle not found error
parent
f98b731a
No related branches found
No related tags found
1 merge request
!110
Sprint 21 Features
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/component-faraday-ui/src/contextualBoxes/AssignHE.js
+1
-0
1 addition, 0 deletions
...ages/component-faraday-ui/src/contextualBoxes/AssignHE.js
packages/xpub-faraday/config/authsome-helpers.js
+23
-16
23 additions, 16 deletions
packages/xpub-faraday/config/authsome-helpers.js
with
24 additions
and
16 deletions
packages/component-faraday-ui/src/contextualBoxes/AssignHE.js
+
1
−
0
View file @
c9a4bf06
...
...
@@ -75,6 +75,7 @@ const AssignHE = ({
<
OpenModal
confirmText
=
"
Invite
"
isFetching
=
{
isFetching
}
modalKey
=
{
`
${
he
.
id
}
-invitehe`
}
onConfirm
=
{
inviteHandlingEditor
(
he
)}
subtitle
=
{
he
.
name
}
title
=
"
Confirm Invitation
"
...
...
This diff is collapsed.
Click to expand it.
packages/xpub-faraday/config/authsome-helpers.js
+
23
−
16
View file @
c9a4bf06
const
{
omit
,
get
,
last
}
=
require
(
'
lodash
'
)
const
config
=
require
(
'
config
'
)
const
logger
=
require
(
'
@pubsweet/logger
'
)
const
statuses
=
config
.
get
(
'
statuses
'
)
...
...
@@ -206,23 +206,30 @@ const parseUser = ({ user }) => omit(user, sensitiveUserProperties)
const
getCollections
=
async
({
user
,
models
})
=>
{
const
userPermisssions
=
await
getUserPermissions
({
user
,
Team
:
models
.
Team
})
return
Promise
.
all
(
return
(
await
Promise
.
all
(
userPermisssions
.
map
(
async
up
=>
{
let
fragment
=
{}
let
collection
=
{}
if
(
up
.
objectType
===
'
collection
'
)
{
collection
=
await
models
.
Collection
.
find
(
up
.
objectId
)
const
latestFragmentId
=
collection
.
fragments
[
collection
.
fragments
.
length
-
1
]
collection
.
currentVersion
=
await
models
.
Fragment
.
find
(
latestFragmentId
)
}
else
{
fragment
=
await
models
.
Fragment
.
find
(
up
.
objectId
)
collection
=
await
models
.
Collection
.
find
(
fragment
.
collectionId
)
collection
.
currentVersion
=
stripeFragmentByRole
({
fragment
,
role
:
up
.
role
,
user
,
})
try
{
if
(
up
.
objectType
===
'
collection
'
)
{
collection
=
await
models
.
Collection
.
find
(
up
.
objectId
)
const
latestFragmentId
=
collection
.
fragments
[
collection
.
fragments
.
length
-
1
]
collection
.
currentVersion
=
await
models
.
Fragment
.
find
(
latestFragmentId
,
)
}
else
{
fragment
=
await
models
.
Fragment
.
find
(
up
.
objectId
)
collection
=
await
models
.
Collection
.
find
(
fragment
.
collectionId
)
collection
.
currentVersion
=
stripeFragmentByRole
({
fragment
,
role
:
up
.
role
,
user
,
})
}
}
catch
(
e
)
{
logger
.
error
(
`DB ERROR:
${
e
.
message
}
`
)
return
null
}
const
status
=
get
(
collection
,
'
status
'
,
'
draft
'
)
collection
.
visibleStatus
=
get
(
statuses
,
`
${
status
}
.
${
up
.
role
}
.label`
)
...
...
@@ -234,7 +241,7 @@ const getCollections = async ({ user, models }) => {
return
stripedColl
.
coll
}),
)
)
).
filter
(
Boolean
)
}
module
.
exports
=
{
...
...
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