diff options
author | Douwe Maan <douwe@gitlab.com> | 2017-06-07 18:05:37 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2017-06-07 18:05:37 +0300 |
commit | 0bcb1d35ecb7db43a075c0a4ae9782991f724f1a (patch) | |
tree | 5ef82ca038eb3cb97e0eb351f33eb58261c3c536 /app/assets/javascripts/boards/stores/boards_store.js | |
parent | a5757c72d967acd82865f9f7cb288d5b61b0b35c (diff) | |
parent | 1633d3d7d8b8589a3d04358d6473cfd168633a10 (diff) |
Merge branch 'expand-backlog-closed-lists-issue-boards' into 'master'
Expand/collapse close & backlog lists in issue boards
Closes #23917
See merge request !11820
Diffstat (limited to 'app/assets/javascripts/boards/stores/boards_store.js')
-rw-r--r-- | app/assets/javascripts/boards/stores/boards_store.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/assets/javascripts/boards/stores/boards_store.js b/app/assets/javascripts/boards/stores/boards_store.js index 7bddcdc3c1d..1e12d4ca415 100644 --- a/app/assets/javascripts/boards/stores/boards_store.js +++ b/app/assets/javascripts/boards/stores/boards_store.js @@ -32,10 +32,14 @@ gl.issueBoards.BoardsStore = { }, new (listObj) { const list = this.addList(listObj); + const backlogList = this.findList('type', 'backlog', 'backlog'); list .save() .then(() => { + // Remove any new issues from the backlog + // as they will be visible in the new list + list.issues.forEach(backlogList.removeIssue.bind(backlogList)); this.state.lists = _.sortBy(this.state.lists, 'position'); }) .catch(() => { @@ -48,7 +52,7 @@ gl.issueBoards.BoardsStore = { }, shouldAddBlankState () { // Decide whether to add the blank state - return !(this.state.lists.filter(list => list.type !== 'closed')[0]); + return !(this.state.lists.filter(list => list.type !== 'backlog' && list.type !== 'closed')[0]); }, addBlankState () { if (!this.shouldAddBlankState() || this.welcomeIsHidden() || this.disabled) return; @@ -101,7 +105,7 @@ gl.issueBoards.BoardsStore = { issueTo.removeLabel(listFrom.label); } - if (listTo.type === 'closed') { + if (listTo.type === 'closed' && listFrom.type !== 'backlog') { issueLists.forEach((list) => { list.removeIssue(issue); }); |