Commit 4a4adbe2 authored by Oswaldo Ferreira's avatar Oswaldo Ferreira

Update labels, weight and assignee when adding a issue to the board

parent 50a52111
...@@ -30,11 +30,15 @@ gl.issueBoards.ModalFooter = Vue.extend({ ...@@ -30,11 +30,15 @@ gl.issueBoards.ModalFooter = Vue.extend({
const list = this.modal.selectedList || this.state.lists[firstListIndex]; const list = this.modal.selectedList || this.state.lists[firstListIndex];
const selectedIssues = ModalStore.getSelectedIssues(); const selectedIssues = ModalStore.getSelectedIssues();
const issueIds = selectedIssues.map(issue => issue.id); const issueIds = selectedIssues.map(issue => issue.id);
const currentBoard = this.state.currentBoard;
const boardLabelIds = currentBoard.labels.map(label => label.id);
// Post the data to the backend // Post the data to the backend
gl.boardService.bulkUpdate(issueIds, { gl.boardService.bulkUpdate(issueIds, {
add_label_ids: [list.label.id], add_label_ids: [list.label.id, ...boardLabelIds],
milestone_id: this.state.currentBoard.milestone_id, milestone_id: currentBoard.milestone_id,
assignee_ids: [currentBoard.assignee_id],
weight: currentBoard.weight
}).catch(() => { }).catch(() => {
new Flash('Failed to update issues, please try again.', 'alert'); new Flash('Failed to update issues, please try again.', 'alert');
......
...@@ -75,9 +75,10 @@ module IssuableActions ...@@ -75,9 +75,10 @@ module IssuableActions
:milestone_id, :milestone_id,
:state_event, :state_event,
:subscription_event, :subscription_event,
:weight,
label_ids: [], label_ids: [],
add_label_ids: [], add_label_ids: [],
remove_label_ids: [] remove_label_ids: [],
] ]
if resource_name == 'issue' if resource_name == 'issue'
......
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