Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
73c4cfb7
Commit
73c4cfb7
authored
Jun 01, 2017
by
kushalpandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor users list build up, fix isActive class for highlighting
parent
59f08f99
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
20 deletions
+15
-20
app/assets/javascripts/protected_tags/protected_tag_access_dropdown.js
...vascripts/protected_tags/protected_tag_access_dropdown.js
+15
-20
No files found.
app/assets/javascripts/protected_tags/protected_tag_access_dropdown.js
View file @
73c4cfb7
...
@@ -309,23 +309,18 @@ export default class ProtectedTagAccessDropdown {
...
@@ -309,23 +309,18 @@ export default class ProtectedTagAccessDropdown {
/*
/*
* Build users
* Build users
*/
*/
const
users
=
selectedItems
.
map
((
item
)
=>
{
const
users
=
selectedItems
.
filter
(
item
=>
item
.
type
===
LEVEL_TYPES
.
USER
).
map
((
item
)
=>
{
let
user
=
null
;
// Save identifiers for easy-checking more later
if
(
item
.
type
===
LEVEL_TYPES
.
USER
)
{
map
.
push
(
LEVEL_TYPES
.
USER
+
item
.
user_id
);
user
=
{
id
:
item
.
user_id
,
return
{
name
:
item
.
name
,
id
:
item
.
user_id
,
username
:
item
.
username
,
name
:
item
.
name
,
avatar_url
:
item
.
avatar_url
,
username
:
item
.
username
,
type
:
LEVEL_TYPES
.
USER
,
avatar_url
:
item
.
avatar_url
,
};
type
:
LEVEL_TYPES
.
USER
,
};
// Save identifiers for easy-checking more later
});
map
.
push
(
LEVEL_TYPES
.
USER
+
item
.
user_id
);
}
return
user
;
}).
filter
(
item
=>
item
!==
null
);
// Has to be checked against server response
// Has to be checked against server response
// because the selected item can be in filter results
// because the selected item can be in filter results
...
@@ -430,7 +425,7 @@ export default class ProtectedTagAccessDropdown {
...
@@ -430,7 +425,7 @@ export default class ProtectedTagAccessDropdown {
}
}
userRowHtml
(
user
,
isActive
)
{
userRowHtml
(
user
,
isActive
)
{
const
isActiveClass
=
isActive
?
'
isActive
'
:
''
;
const
isActiveClass
=
isActive
||
''
;
return
`
return
`
<li>
<li>
...
@@ -444,7 +439,7 @@ export default class ProtectedTagAccessDropdown {
...
@@ -444,7 +439,7 @@ export default class ProtectedTagAccessDropdown {
}
}
groupRowHtml
(
group
,
isActive
)
{
groupRowHtml
(
group
,
isActive
)
{
const
isActiveClass
=
isActive
?
'
isActive
'
:
''
;
const
isActiveClass
=
isActive
||
''
;
const
avatarEl
=
group
.
avatar_url
?
`<img src='
${
group
.
avatar_url
}
' class='avatar avatar-inline' width='30'>`
:
''
;
const
avatarEl
=
group
.
avatar_url
?
`<img src='
${
group
.
avatar_url
}
' class='avatar avatar-inline' width='30'>`
:
''
;
return
`
return
`
...
@@ -458,7 +453,7 @@ export default class ProtectedTagAccessDropdown {
...
@@ -458,7 +453,7 @@ export default class ProtectedTagAccessDropdown {
}
}
roleRowHtml
(
role
,
isActive
)
{
roleRowHtml
(
role
,
isActive
)
{
const
isActiveClass
=
isActive
?
'
isActive
'
:
''
;
const
isActiveClass
=
isActive
||
''
;
return
`
return
`
<li>
<li>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment