diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/boards/models/list.js.es6 | 12 | ||||
-rw-r--r-- | app/assets/javascripts/boards/stores/boards_store.js.es6 | 5 |
2 files changed, 12 insertions, 5 deletions
diff --git a/app/assets/javascripts/boards/models/list.js.es6 b/app/assets/javascripts/boards/models/list.js.es6 index 5152be56b66..8158ed4ec2c 100644 --- a/app/assets/javascripts/boards/models/list.js.es6 +++ b/app/assets/javascripts/boards/models/list.js.es6 @@ -123,14 +123,18 @@ class List { if (listFrom) { this.issuesSize += 1; - gl.boardService.moveIssue(issue.id, listFrom.id, this.id) - .then(() => { - listFrom.getIssues(false); - }); + this.updateIssueLabel(issue, listFrom); } } } + updateIssueLabel(issue, listFrom) { + gl.boardService.moveIssue(issue.id, listFrom.id, this.id) + .then(() => { + listFrom.getIssues(false); + }); + } + findIssue (id) { return this.issues.filter(issue => issue.id === id)[0]; } diff --git a/app/assets/javascripts/boards/stores/boards_store.js.es6 b/app/assets/javascripts/boards/stores/boards_store.js.es6 index 50842ecbaaa..56436c8fdc7 100644 --- a/app/assets/javascripts/boards/stores/boards_store.js.es6 +++ b/app/assets/javascripts/boards/stores/boards_store.js.es6 @@ -92,9 +92,12 @@ const issueLists = issue.getLists(); const listLabels = issueLists.map(listIssue => listIssue.label); - // Add to new lists issues if it doesn't already exist if (!issueTo) { + // Add to new lists issues if it doesn't already exist listTo.addIssue(issue, listFrom, newIndex); + } else { + listTo.updateIssueLabel(issue, listFrom); + issueTo.removeLabel(listFrom.label); } if (listTo.type === 'done') { |