Commit 63ac5f1f authored by Simon Knox's avatar Simon Knox

simplify and clarify some assignments

parent 855966c5
...@@ -41,14 +41,10 @@ export default { ...@@ -41,14 +41,10 @@ export default {
}, },
methods: { methods: {
labelStyle(label) { labelStyle(label) {
let style = ''; return {
if (label.textColor) { color: label.textColor,
style += `color: ${label.textColor};` backgroundColor: label.color,
} };
if (label.color) {
style += `background-color: ${label.color};`
}
return style;
}, },
}, },
}; };
......
...@@ -46,14 +46,17 @@ export default { ...@@ -46,14 +46,17 @@ export default {
}, },
methods: { methods: {
selectMilestone(milestone) { selectMilestone(milestone) {
let id = milestone.id;
// swap the IDs of 'Any' and 'No' milestone to what backend requires // swap the IDs of 'Any' and 'No' milestone to what backend requires
if (milestone.title === ANY_MILESTONE) { if (milestone.title === ANY_MILESTONE) {
milestone.id = -1; id = -1;
} else if (milestone.title === NO_MILESTONE) { } else if (milestone.title === NO_MILESTONE) {
milestone.id = 0; id = 0;
} }
this.$set(this.board, 'milestone_id', milestone.id); this.board.milestone = {
this.$set(this.board, 'milestone', milestone); ...milestone,
id,
};
}, },
}, },
mounted() { mounted() {
......
...@@ -48,13 +48,14 @@ gl.issueBoards.RemoveIssueBtn = Vue.extend({ ...@@ -48,13 +48,14 @@ gl.issueBoards.RemoveIssueBtn = Vue.extend({
.map(assignee => assignee.id) .map(assignee => assignee.id)
.filter(id => id !== board.assignee_id); .filter(id => id !== board.assignee_id);
if (assigneeIds.length === 0) { if (assigneeIds.length === 0) {
// for backend to explicitly set No Assignee
assigneeIds = ['0']; assigneeIds = ['0'];
} }
const data = { const data = {
issue: { issue: {
label_ids: labelIds, label_ids: labelIds,
assignee_ids: assigneeIds assignee_ids: assigneeIds,
}, },
}; };
......
...@@ -60,11 +60,9 @@ gl.issueBoards.BoardsStore = { ...@@ -60,11 +60,9 @@ gl.issueBoards.BoardsStore = {
this.boardConfig.id = board.id; this.boardConfig.id = board.id;
this.boardConfig.name = board.name; this.boardConfig.name = board.name;
this.boardConfig.milestone = board.milestone; this.boardConfig.milestone = board.milestone;
this.boardConfig.milestone_id = board.milestone_id;
this.boardConfig.weight = board.weight;
this.boardConfig.labels = board.labels || []; this.boardConfig.labels = board.labels || [];
this.boardConfig.assignee_id = board.assignee_id;
this.boardConfig.assignee = board.assignee || {}; this.boardConfig.assignee = board.assignee || {};
this.boardConfig.weight = board.weight;
}, },
addList (listObj, defaultAvatar) { addList (listObj, defaultAvatar) {
const list = new List(listObj, defaultAvatar); const list = new List(listObj, defaultAvatar);
......
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