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
c6e91b85
Commit
c6e91b85
authored
6 years ago
by
Sebastian Mihalache
Browse files
Options
Downloads
Patches
Plain Diff
fix(submitRevision): create author team when submitting revision
parent
81cd2b3b
No related branches found
No related tags found
3 merge requests
!196
S25 - EiC submit revision
,
!189
S25
,
!177
Hin 230 eic request revision
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
packages/component-manuscript-manager/src/routes/fragments/strategies/eicRequestRevision.js
+29
-1
29 additions, 1 deletion
...ger/src/routes/fragments/strategies/eicRequestRevision.js
with
29 additions
and
1 deletion
packages/component-manuscript-manager/src/routes/fragments/strategies/eicRequestRevision.js
+
29
−
1
View file @
c6e91b85
const
{
union
}
=
require
(
'
lodash
'
)
module
.
exports
=
{
module
.
exports
=
{
execute
:
async
({
models
,
fragmentHelper
,
collectionHelper
})
=>
{
execute
:
async
({
models
,
TeamHelper
,
fragmentHelper
,
collectionHelper
})
=>
{
const
eicRequestToRevision
=
fragmentHelper
.
getLatestEiCRequestToRevision
()
const
eicRequestToRevision
=
fragmentHelper
.
getLatestEiCRequestToRevision
()
if
(
!
eicRequestToRevision
)
{
if
(
!
eicRequestToRevision
)
{
throw
new
Error
(
'
No Editor in Chief request to revision has been found.
'
)
throw
new
Error
(
'
No Editor in Chief request to revision has been found.
'
)
...
@@ -11,6 +13,32 @@ module.exports = {
...
@@ -11,6 +13,32 @@ module.exports = {
await
fragmentHelper
.
removeRevision
()
await
fragmentHelper
.
removeRevision
()
const
teamHelper
=
new
TeamHelper
({
TeamModel
:
models
.
Team
,
fragmentId
:
newFragment
.
id
,
})
const
authorIds
=
newFragment
.
authors
.
map
(
auth
=>
{
const
{
id
}
=
auth
return
id
})
let
authorsTeam
=
await
teamHelper
.
getTeam
({
role
:
'
author
'
,
objectType
:
'
fragment
'
,
})
if
(
!
authorsTeam
)
{
authorsTeam
=
await
teamHelper
.
createTeam
({
role
:
'
author
'
,
members
:
authorIds
,
objectType
:
'
fragment
'
,
})
}
else
{
authorsTeam
.
members
=
union
(
authorsTeam
.
members
,
authorIds
)
await
authorsTeam
.
save
()
}
await
collectionHelper
.
updateStatus
({
newStatus
:
'
submitted
'
})
await
collectionHelper
.
updateStatus
({
newStatus
:
'
submitted
'
})
newFragment
.
submitted
=
Date
.
now
()
newFragment
.
submitted
=
Date
.
now
()
...
...
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