Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
editoria
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
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
Show more breadcrumbs
Yannis Barlas
editoria
Commits
08377509
Commit
08377509
authored
8 years ago
by
Yannis Barlas
Browse files
Options
Downloads
Patches
Plain Diff
guarantee team order in team manager modal
parent
b25856ac
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/components/BookBuilder/TeamManager/GroupList.jsx
+15
-20
15 additions, 20 deletions
app/components/BookBuilder/TeamManager/GroupList.jsx
with
15 additions
and
20 deletions
app/components/BookBuilder/TeamManager/GroupList.jsx
+
15
−
20
View file @
08377509
import
{
find
,
keys
}
from
'
lodash
'
import
React
from
'
react
'
import
React
from
'
react
'
import
Group
from
'
./Group
'
import
Group
from
'
./Group
'
...
@@ -27,11 +28,20 @@ export class GroupList extends React.Component {
...
@@ -27,11 +28,20 @@ export class GroupList extends React.Component {
render
()
{
render
()
{
const
{
teams
,
users
,
update
}
=
this
.
props
const
{
teams
,
users
,
update
}
=
this
.
props
const
self
=
thi
s
const
options
=
this
.
option
s
const
groups
=
teams
.
map
(
function
(
team
,
i
)
{
// TODO -- refactor
const
name
=
team
.
name
.
trim
()
// do it like this to guarantee order of groups
if
(
!
self
.
options
[
name
])
return
const
groups
=
keys
(
options
).
map
((
key
,
i
)
=>
{
let
name
// get team of this name
const
team
=
find
(
teams
,
(
team
)
=>
{
name
=
team
.
name
.
trim
()
return
name
===
key
})
if
(
!
team
)
return
return
(
return
(
<
div
key
=
{
i
}
>
<
div
key
=
{
i
}
>
...
@@ -39,7 +49,7 @@ export class GroupList extends React.Component {
...
@@ -39,7 +49,7 @@ export class GroupList extends React.Component {
team
=
{
team
}
team
=
{
team
}
users
=
{
users
}
users
=
{
users
}
update
=
{
update
}
update
=
{
update
}
options
=
{
self
.
options
[
name
]
}
options
=
{
options
[
name
]
}
/>
/>
<
div
className
=
{
styles
.
groupSeperator
}
/>
<
div
className
=
{
styles
.
groupSeperator
}
/>
</
div
>
</
div
>
...
@@ -61,18 +71,3 @@ GroupList.propTypes = {
...
@@ -61,18 +71,3 @@ GroupList.propTypes = {
}
}
export
default
GroupList
export
default
GroupList
/*
<TeamGroup
type="copyEditor"
/>
<div className={styles.groupSeperator} />
<TeamGroup
type="author"
/>
<div className={styles.groupSeperator} />
*/
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