Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
U
ucp
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
4
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Coko Org
Products
ketty
ucp
Commits
cf7e4b13
Commit
cf7e4b13
authored
6 years ago
by
Giannis Kopanas
Committed by
Alexandros Georgantas
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix(seed): fix global teams script
parent
d3cd8295
No related branches found
No related tags found
2 merge requests
!15
File upload
,
!11
Move navigation to monorepo
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/seedGlobalTeams.js
+18
-13
18 additions, 13 deletions
scripts/seedGlobalTeams.js
with
18 additions
and
13 deletions
scripts/seedGlobalTeams.js
+
18
−
13
View file @
cf7e4b13
#!/usr/bin/env node
const
logger
=
require
(
'
@pubsweet/logger
'
)
const
{
model
}
=
require
(
'
@pubsweet/model-team
'
)
const
{
editoriaDataModel
:
{
models
:
{
Team
},
},
}
=
require
(
'
editoria-data-model
'
)
cons
t
Team
=
model
cons
ole
.
log
(
Team
)
const
makeTeam
=
async
type
=>
{
const
names
=
{
...
...
@@ -12,14 +16,17 @@ const makeTeam = async type => {
logger
.
info
(
`Create
${
names
[
type
]}
team`
)
const
team
=
new
Team
({
global
:
true
,
members
:
[],
name
:
names
[
type
],
teamType
:
type
,
})
await
team
.
save
()
await
Team
.
query
().
upsertGraphAndFetch
(
{
global
:
true
,
members
:
[],
name
:
names
[
type
],
role
:
type
,
},
{
relate
:
true
},
)
// await team.save()
logger
.
info
(
`
${
names
[
type
]}
team successfully created`
)
}
...
...
@@ -30,9 +37,7 @@ const seed = async () => {
try
{
const
teams
=
await
Team
.
findByField
({
global
:
true
})
const
productionEditorTeam
=
teams
.
find
(
t
=>
t
.
teamType
===
'
productionEditor
'
,
)
const
productionEditorTeam
=
teams
.
find
(
t
=>
t
.
role
===
'
productionEditor
'
)
if
(
productionEditorTeam
)
{
logger
.
info
(
'
All global teams found, exiting...
'
)
...
...
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