提交 87cab11c 编写于 作者: P Phil Hughes

Test added a mock list

上级 99915931
......@@ -26,6 +26,17 @@ $(() => {
selectable: true,
clicked: (label, $el, e) => {
e.preventDefault();
BoardsStore.new({
id: BoardsStore.state.lists.length - 1,
title: label.title,
index: BoardsStore.state.lists.length - 1,
label: {
title: label.title,
backgroundColor: label.color,
color: '#fff'
},
issues: []
});
}
});
});
......
......@@ -10,13 +10,27 @@
}
},
new: function (board) {
// Move the done list index
const doneList = this.getDoneList();
if (doneList) {
doneList.index = board.index + 1;
}
const list = new List(board);
this.state.lists.push(list);
},
getDoneList: function () {
return _.find(this.state.lists, (list) => {
return list.id === 'done';
});
},
removeList: function (id) {
this.state.lists = _.reject(this.state.lists, (list) => {
return list.id === id;
});
this.getDoneList().index = this.state.lists.length - 1;
},
moveList: function (oldIndex, newIndex) {
const listFrom = _.find(this.state.lists, (list) => {
......@@ -48,7 +62,7 @@
const issueLists = this.getListsForIssue(issue);
listFrom.removeIssue(issue);
// Add to new boards issues if it doesn't already exist
// Add to new lists issues if it doesn't already exist
if (issueTo) {
issue = issueTo;
issue.removeLabel(listFrom.label);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册