diff options
author | Simon Knox <psimyn@gmail.com> | 2017-09-06 15:02:30 +1000 |
---|---|---|
committer | Simon Knox <psimyn@gmail.com> | 2017-09-06 15:41:00 +1000 |
commit | c28d52a3a5e745d20981151b89bfcad07c68fa9c (patch) | |
tree | d51df26c80701f8e7b8a178119ffd09a895ad063 /app/assets/javascripts/boards/components/sidebar | |
parent | b9aa55e1ea2ba226bd9bf4c6fb08fdec30e046c5 (diff) | |
download | gitlab-ce-c28d52a3a5e745d20981151b89bfcad07c68fa9c.tar.gz |
FE backport of group boards to reduce CE conflicts
Diffstat (limited to 'app/assets/javascripts/boards/components/sidebar')
-rw-r--r-- | app/assets/javascripts/boards/components/sidebar/remove_issue.js | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/app/assets/javascripts/boards/components/sidebar/remove_issue.js b/app/assets/javascripts/boards/components/sidebar/remove_issue.js index 6a900d4abd0..b44e87b051d 100644 --- a/app/assets/javascripts/boards/components/sidebar/remove_issue.js +++ b/app/assets/javascripts/boards/components/sidebar/remove_issue.js @@ -18,17 +18,32 @@ gl.issueBoards.RemoveIssueBtn = Vue.extend({ type: Object, required: true, }, + issueUpdate: { + type: String, + required: true, + }, + }, + computed: { + updateUrl() { + return this.issueUpdate; + }, }, methods: { removeIssue() { const issue = this.issue; const lists = issue.getLists(); - const labelIds = lists.map(list => list.label.id); + const listLabelIds = lists.map(list => list.label.id); + const labelIds = this.issue.labels + .map(label => label.id) + .filter(id => !listLabelIds.includes(id)); // Post the remove data - gl.boardService.bulkUpdate([issue.globalId], { - remove_label_ids: labelIds, - }).catch(() => { + const data = { + issue: { + label_ids: labelIds, + }, + }; + Vue.http.patch(this.updateUrl, data).catch(() => { new Flash('Failed to remove issue from board, please try again.', 'alert'); lists.forEach((list) => { |