Commit 16afcb55 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Disable duplicate label merging in other dropdowns

parent 212eb1bb
...@@ -7,7 +7,6 @@ import _ from 'underscore'; ...@@ -7,7 +7,6 @@ import _ from 'underscore';
import { sprintf, __ } from './locale'; import { sprintf, __ } from './locale';
import axios from './lib/utils/axios_utils'; import axios from './lib/utils/axios_utils';
import IssuableBulkUpdateActions from './issuable_bulk_update_actions'; import IssuableBulkUpdateActions from './issuable_bulk_update_actions';
import DropdownUtils from './filtered_search/dropdown_utils';
import CreateLabelDropdown from './create_label'; import CreateLabelDropdown from './create_label';
import flash from './flash'; import flash from './flash';
import ModalStore from './boards/stores/modal_store'; import ModalStore from './boards/stores/modal_store';
...@@ -171,23 +170,7 @@ export default class LabelsSelect { ...@@ -171,23 +170,7 @@ export default class LabelsSelect {
axios axios
.get(labelUrl) .get(labelUrl)
.then(res => { .then(res => {
let data = _.chain(res.data) let data = res.data;
.groupBy(function(label) {
return label.title;
})
.map(function(label) {
var color;
color = _.map(label, function(dup) {
return dup.color;
});
return {
id: label[0].id,
title: label[0].title,
color: color,
duplicate: color.length > 1,
};
})
.value();
if ($dropdown.hasClass('js-extra-options')) { if ($dropdown.hasClass('js-extra-options')) {
var extraData = []; var extraData = [];
if (showNo) { if (showNo) {
...@@ -272,15 +255,8 @@ export default class LabelsSelect { ...@@ -272,15 +255,8 @@ export default class LabelsSelect {
selectedClass.push('dropdown-clear-active'); selectedClass.push('dropdown-clear-active');
} }
} }
if (label.duplicate) { if (label.color) {
color = DropdownUtils.duplicateLabelColor(label.color); colorEl = "<span class='dropdown-label-box' style='background: " + label.color + "'></span>";
} else {
if (label.color != null) {
[color] = label.color;
}
}
if (color) {
colorEl = "<span class='dropdown-label-box' style='background: " + color + "'></span>";
} else { } else {
colorEl = ''; colorEl = '';
} }
...@@ -435,7 +411,7 @@ export default class LabelsSelect { ...@@ -435,7 +411,7 @@ export default class LabelsSelect {
new ListLabel({ new ListLabel({
id: label.id, id: label.id,
title: label.title, title: label.title,
color: label.color[0], color: label.color,
textColor: '#fff', textColor: '#fff',
}), }),
); );
......
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