Commit d6db1c5a authored by Clement Ho's avatar Clement Ho

[skip ci] add assignee(s) dropdown header

parent 7e1d5068
......@@ -173,7 +173,7 @@
}
if (showDivider) {
users.splice(showDivider, 0, "divider");
users.splice(showDivider, 0, 'divider');
}
if ($dropdown.hasClass('js-multiselect')) {
......@@ -186,6 +186,11 @@
.filter((i) => i !== 0);
if (selected.length > 0) {
showDivider += 1;
users.splice(showDivider, 0, {
header: $dropdown.data('dropdown-header') || 'Assignee(s)',
});
const selectedUsers = users
.filter((u) => selected.indexOf(u.id) !== -1)
.sort((a, b) => a.name > b.name);
......@@ -220,7 +225,9 @@
if (this.multiSelect && inputValue === '') {
const users = glDropdown.fullData.filter((r) => {
return typeof r === 'object' && !Object.prototype.hasOwnProperty.call(r, 'beforeDivider');
return typeof r === 'object'
&& !Object.prototype.hasOwnProperty.call(r, 'beforeDivider')
&& !Object.prototype.hasOwnProperty.call(r, 'header');
});
const callback = glDropdown.parseData.bind(glDropdown);
......
......@@ -222,11 +222,9 @@
}
.dropdown-header {
color: $gl-text-color;
color: $gl-text-color-secondary;
font-size: 13px;
font-weight: 600;
line-height: 22px;
text-transform: capitalize;
padding: 0 16px;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment