Commit 5188058c authored by Oswaldo Ferreira's avatar Oswaldo Ferreira

Remove issue assignees according to board config

parent ca0b1d49
...@@ -36,16 +36,25 @@ gl.issueBoards.RemoveIssueBtn = Vue.extend({ ...@@ -36,16 +36,25 @@ gl.issueBoards.RemoveIssueBtn = Vue.extend({
const boardLabelIds = board.labels.map(label => label.id); const boardLabelIds = board.labels.map(label => label.id);
const listLabelIds = lists.map(list => list.label.id); const listLabelIds = lists.map(list => list.label.id);
let labelIds = this.issue.labels let labelIds = issue.labels
.map(label => label.id) .map(label => label.id)
.filter(id => !listLabelIds.includes(id)) .filter(id => !listLabelIds.includes(id))
.filter(id => !boardLabelIds.includes(id)); .filter(id => !boardLabelIds.includes(id));
if (labelIds.length === 0) { if (labelIds.length === 0) {
labelIds = ['']; labelIds = [''];
} }
let assigneeIds = issue.assignees
.map(assignee => assignee.id)
.filter(id => id != board.assignee_id);
if (assigneeIds.length === 0) {
assigneeIds = ['0'];
}
const data = { const data = {
issue: { issue: {
label_ids: labelIds, label_ids: labelIds,
assignee_ids: assigneeIds
}, },
}; };
......
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