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
81c6ed32
Commit
81c6ed32
authored
6 years ago
by
Sebastian Mihalache
Browse files
Options
Downloads
Patches
Plain Diff
fix(fragment-helper): add fitlter before map
parent
7da2f4c2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!160
Update staging with master features
,
!156
Develop
,
!153
fix(mts-package): remove recommendations that have not been submitted
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
packages/component-helper-service/src/services/Fragment.js
+45
-45
45 additions, 45 deletions
packages/component-helper-service/src/services/Fragment.js
with
45 additions
and
45 deletions
packages/component-helper-service/src/services/Fragment.js
+
45
−
45
View file @
81c6ed32
...
@@ -158,57 +158,57 @@ class Fragment {
...
@@ -158,57 +158,57 @@ class Fragment {
}
=
this
.
fragment
}
=
this
.
fragment
const
revAndEditorData
=
await
Promise
.
all
(
const
revAndEditorData
=
await
Promise
.
all
(
recommendations
.
map
(
async
rec
=>
{
recommendations
if
(
.
filter
(
rec
.
recommendationType
===
configRecommendations
.
type
.
review
&&
rec
=>
!
rec
.
submittedOn
rec
.
recommendationType
===
configRecommendations
.
type
.
editor
||
)
{
(
rec
.
recommendationType
===
configRecommendations
.
type
.
review
&&
return
null
rec
.
submittedOn
),
}
)
.
map
(
async
rec
=>
{
const
user
=
await
UserModel
.
find
(
rec
.
userId
)
const
user
=
await
UserModel
.
find
(
rec
.
userId
)
let
assignmentDate
,
isReviewer
let
assignmentDate
,
isReviewer
if
(
rec
.
recommendationType
===
configRecommendations
.
type
.
editor
)
{
if
(
rec
.
recommendationType
===
configRecommendations
.
type
.
editor
)
{
if
(
!
collection
.
handlingEditor
)
{
if
(
!
collection
.
handlingEditor
)
{
throw
new
Error
(
throw
new
Error
(
`Collection
${
collection
.
id
}
does not have a Handling Editor`
,
`Collection
${
collection
.
id
}
does not have a Handling Editor`
,
)
)
}
}
if
(
user
.
id
===
collection
.
handlingEditor
.
id
)
{
if
(
user
.
id
===
collection
.
handlingEditor
.
id
)
{
const
editorInvitation
=
collection
.
invitations
.
find
(
const
editorInvitation
=
collection
.
invitations
.
find
(
inv
=>
inv
.
userId
===
user
.
id
,
)
assignmentDate
=
editorInvitation
.
respondedOn
}
else
{
assignmentDate
=
submitted
}
isReviewer
=
false
}
else
{
const
reviewerInvitation
=
invitations
.
find
(
inv
=>
inv
.
userId
===
user
.
id
,
inv
=>
inv
.
userId
===
user
.
id
,
)
)
assignmentDate
=
editorInvitation
.
respondedOn
assignmentDate
=
reviewerInvitation
.
respondedOn
}
else
{
isReviewer
=
true
assignmentDate
=
submitted
}
}
isReviewer
=
false
return
{
}
else
{
isReviewer
,
const
reviewerInvitation
=
invitations
.
find
(
assignmentDate
,
inv
=>
inv
.
userId
===
user
.
id
,
email
:
user
.
email
,
)
title
:
user
.
title
,
assignmentDate
=
reviewerInvitation
.
respondedOn
recommendation
:
rec
,
isReviewer
=
true
country
:
user
.
country
,
}
lastName
:
user
.
lastName
,
firstName
:
user
.
firstName
,
return
{
affiliation
:
user
.
affiliation
,
isReviewer
,
submissionDate
:
rec
.
createdOn
,
assignmentDate
,
}
email
:
user
.
email
,
}),
title
:
user
.
title
,
recommendation
:
rec
,
country
:
user
.
country
,
lastName
:
user
.
lastName
,
firstName
:
user
.
firstName
,
affiliation
:
user
.
affiliation
,
submissionDate
:
rec
.
createdOn
,
}
}),
)
)
return
revAndEditorData
.
filter
(
Boolean
)
return
revAndEditorData
}
}
}
}
...
...
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