Commit 5e0b2941 authored by Phil Hughes's avatar Phil Hughes

Removed if around board deleting

removed duplication
parent 9a425c3f
...@@ -40,13 +40,11 @@ class List { ...@@ -40,13 +40,11 @@ class List {
} }
destroy () { destroy () {
if (this.type !== 'blank') {
gl.issueBoards.BoardsStore.state.lists.$remove(this); gl.issueBoards.BoardsStore.state.lists.$remove(this);
gl.issueBoards.BoardsStore.updateNewListDropdown(this.id); gl.issueBoards.BoardsStore.updateNewListDropdown(this.id);
gl.boardService.destroyList(this.id); gl.boardService.destroyList(this.id);
} }
}
update () { update () {
gl.boardService.updateList(this.id, this.position); gl.boardService.updateList(this.id, this.position);
...@@ -93,17 +91,21 @@ class List { ...@@ -93,17 +91,21 @@ class List {
createIssues (data) { createIssues (data) {
data.forEach((issueObj) => { data.forEach((issueObj) => {
this.issues.push(new ListIssue(issueObj)); this.addIssue(new ListIssue(issueObj));
}); });
} }
addIssue (issue, listFrom) { addIssue (issue, listFrom) {
this.issues.push(issue); this.issues.push(issue);
if (this.label) {
issue.addLabel(this.label); issue.addLabel(this.label);
}
if (listFrom) {
gl.boardService.moveIssue(issue.id, listFrom.id, this.id); gl.boardService.moveIssue(issue.id, listFrom.id, this.id);
} }
}
findIssue (id) { findIssue (id) {
return this.issues.filter( issue => issue.id === id )[0]; return this.issues.filter( issue => issue.id === id )[0];
......
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