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
a3fbaaee
Commit
a3fbaaee
authored
Mar 01, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
43d2ce00
08470b70
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
32 deletions
+29
-32
app/assets/javascripts/gl_dropdown.js
app/assets/javascripts/gl_dropdown.js
+1
-17
app/assets/javascripts/labels_select.js
app/assets/javascripts/labels_select.js
+20
-12
changelogs/unreleased/57734-improve-label-dropdown-selection-performance.yml
...ed/57734-improve-label-dropdown-selection-performance.yml
+5
-0
doc/ci/yaml/README.md
doc/ci/yaml/README.md
+3
-3
No files found.
app/assets/javascripts/gl_dropdown.js
View file @
a3fbaaee
...
...
@@ -656,23 +656,7 @@ GitLabDropdown = (function() {
if
(
this
.
options
.
renderMenu
)
{
return
this
.
options
.
renderMenu
(
html
);
}
else
{
var
ul
=
document
.
createElement
(
'
ul
'
);
for
(
var
i
=
0
;
i
<
html
.
length
;
i
+=
1
)
{
var
el
=
html
[
i
];
if
(
el
instanceof
$
)
{
el
=
el
.
get
(
0
);
}
if
(
typeof
el
===
'
string
'
)
{
ul
.
innerHTML
+=
el
;
}
else
{
ul
.
appendChild
(
el
);
}
}
return
ul
;
return
$
(
'
<ul>
'
).
append
(
html
);
}
};
...
...
app/assets/javascripts/labels_select.js
View file @
a3fbaaee
...
...
@@ -199,8 +199,8 @@ export default class LabelsSelect {
.
catch
(()
=>
flash
(
__
(
'
Error fetching labels.
'
)));
},
renderRow
:
function
(
label
,
instance
)
{
var
$a
,
$li
,
var
linkEl
,
listItemEl
,
color
,
colorEl
,
indeterminate
,
...
...
@@ -209,12 +209,11 @@ export default class LabelsSelect {
spacing
,
i
,
marked
,
dropdownName
,
dropdownValue
;
$li
=
$
(
'
<li>
'
);
$a
=
$
(
'
<a href="#">
'
);
selectedClass
=
[];
removesAll
=
label
.
id
<=
0
||
label
.
id
==
null
;
if
(
$dropdown
.
hasClass
(
'
js-filter-bulk-update
'
))
{
indeterminate
=
$dropdown
.
data
(
'
indeterminate
'
)
||
[];
marked
=
$dropdown
.
data
(
'
marked
'
)
||
[];
...
...
@@ -233,7 +232,6 @@ export default class LabelsSelect {
}
}
else
{
if
(
this
.
id
(
label
))
{
dropdownName
=
$dropdown
.
data
(
'
fieldName
'
);
dropdownValue
=
this
.
id
(
label
)
.
toString
()
.
replace
(
/'/g
,
"
\\
'
"
);
...
...
@@ -241,7 +239,7 @@ export default class LabelsSelect {
if
(
$form
.
find
(
"
input[type='hidden'][name='
"
+
dropdown
Name
+
this
.
field
Name
+
"
'][value='
"
+
dropdownValue
+
"
']
"
,
...
...
@@ -251,24 +249,34 @@ export default class LabelsSelect {
}
}
if
(
$dropdown
.
hasClass
(
'
js-multiselect
'
)
&&
removesAll
)
{
if
(
this
.
multiSelect
&&
removesAll
)
{
selectedClass
.
push
(
'
dropdown-clear-active
'
);
}
}
if
(
label
.
color
)
{
colorEl
=
"
<span class='dropdown-label-box' style='background:
"
+
label
.
color
+
"
'></span>
"
;
}
else
{
colorEl
=
''
;
}
linkEl
=
document
.
createElement
(
'
a
'
);
linkEl
.
href
=
'
#
'
;
// We need to identify which items are actually labels
if
(
label
.
id
)
{
selectedClass
.
push
(
'
label-item
'
);
$a
.
attr
(
'
data-label-id
'
,
label
.
id
)
;
linkEl
.
dataset
.
labelId
=
label
.
id
;
}
$a
.
addClass
(
selectedClass
.
join
(
'
'
)).
html
(
`
${
colorEl
}
${
_
.
escape
(
label
.
title
)}
`
);
// Return generated html
return
$li
.
html
(
$a
).
prop
(
'
outerHTML
'
);
linkEl
.
className
=
selectedClass
.
join
(
'
'
);
linkEl
.
innerHTML
=
`
${
colorEl
}
${
_
.
escape
(
label
.
title
)}
`
;
listItemEl
=
document
.
createElement
(
'
li
'
);
listItemEl
.
appendChild
(
linkEl
);
return
listItemEl
;
},
search
:
{
fields
:
[
'
title
'
],
...
...
changelogs/unreleased/57734-improve-label-dropdown-selection-performance.yml
0 → 100644
View file @
a3fbaaee
---
title
:
Improve label select rendering
merge_request
:
25281
author
:
type
:
performance
doc/ci/yaml/README.md
View file @
a3fbaaee
...
...
@@ -620,9 +620,9 @@ action fails, the pipeline will eventually succeed.
Manual actions are considered to be write actions, so permissions for
[
protected branches
](
../../user/project/protected_branches.md
)
are used when
user wants to trigger an action. In other words, in order to trigger a manual
action assigned to a branch that the pipeline is running for, user needs to
have ability to merge to this branch.
a
user wants to trigger an action. In other words, in order to trigger a manual
action assigned to a branch that the pipeline is running for,
the
user needs to
have
the
ability to merge to this branch.
### `when:delayed`
...
...
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