Commit 67c4f07d authored by Constance Okoghenun's avatar Constance Okoghenun

Backported changes from EE for board list model

parent 9d7ff90d
...@@ -4,8 +4,9 @@ ...@@ -4,8 +4,9 @@
import { __ } from '~/locale'; import { __ } from '~/locale';
import ListLabel from '~/vue_shared/models/label'; import ListLabel from '~/vue_shared/models/label';
import ListAssignee from '~/vue_shared/models/assignee'; import ListAssignee from '~/vue_shared/models/assignee';
import { urlParamsToObject } from '~/lib/utils/common_utils'; import { isEE, urlParamsToObject } from '~/lib/utils/common_utils';
import boardsStore from '../stores/boards_store'; import boardsStore from '../stores/boards_store';
import ListMilestone from './milestone';
const PER_PAGE = 20; const PER_PAGE = 20;
...@@ -51,6 +52,9 @@ class List { ...@@ -51,6 +52,9 @@ class List {
} else if (obj.user) { } else if (obj.user) {
this.assignee = new ListAssignee(obj.user); this.assignee = new ListAssignee(obj.user);
this.title = this.assignee.name; this.title = this.assignee.name;
} else if (isEE && obj.milestone) {
this.milestone = new ListMilestone(obj.milestone);
this.title = this.milestone.title;
} }
if (!typeInfo.isBlank && this.id) { if (!typeInfo.isBlank && this.id) {
...@@ -69,12 +73,14 @@ class List { ...@@ -69,12 +73,14 @@ class List {
} }
save() { save() {
const entity = this.label || this.assignee; const entity = this.label || this.assignee || this.milestone;
let entityType = ''; let entityType = '';
if (this.label) { if (this.label) {
entityType = 'label_id'; entityType = 'label_id';
} else { } else if (this.assignee) {
entityType = 'assignee_id'; entityType = 'assignee_id';
} else if (isEE && this.milestone) {
entityType = 'milestone_id';
} }
return gl.boardService return gl.boardService
...@@ -192,6 +198,13 @@ class List { ...@@ -192,6 +198,13 @@ class List {
issue.addAssignee(this.assignee); issue.addAssignee(this.assignee);
} }
if (isEE && this.milestone) {
if (listFrom && listFrom.type === 'milestone') {
issue.removeMilestone(listFrom.milestone);
}
issue.addMilestone(this.milestone);
}
if (listFrom) { if (listFrom) {
this.issuesSize += 1; this.issuesSize += 1;
......
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