Allow creating label lists with the same label name
This commit is contained in:
parent
0ec5edd5be
commit
cb5214f480
|
@ -37,7 +37,7 @@ export default function initNewListDropdown() {
|
|||
});
|
||||
},
|
||||
renderRow(label) {
|
||||
const active = boardsStore.findList('title', label.title);
|
||||
const active = boardsStore.findListByLabelId(label.id);
|
||||
const $li = $('<li />');
|
||||
const $a = $('<a />', {
|
||||
class: active ? `is-active js-board-list-${active.id}` : '',
|
||||
|
@ -63,7 +63,7 @@ export default function initNewListDropdown() {
|
|||
const label = options.selectedObj;
|
||||
e.preventDefault();
|
||||
|
||||
if (!boardsStore.findList('title', label.title)) {
|
||||
if (!boardsStore.findListByLabelId(label.id)) {
|
||||
boardsStore.new({
|
||||
title: label.title,
|
||||
position: boardsStore.state.lists.length - 2,
|
||||
|
|
|
@ -166,6 +166,11 @@ const boardsStore = {
|
|||
});
|
||||
return filteredList[0];
|
||||
},
|
||||
findListByLabelId(id) {
|
||||
return this.state.lists.find(list => {
|
||||
return list.type === 'label' && list.label.id === id;
|
||||
});
|
||||
},
|
||||
updateFiltersUrl() {
|
||||
window.history.pushState(null, null, `?${this.filter.path}`);
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue