summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConstance Okoghenun <constanceokoghenun@gmail.com>2019-04-10 08:11:05 +0200
committerConstance Okoghenun <constanceokoghenun@gmail.com>2019-04-10 08:11:05 +0200
commit67c4f07db058af5290fb988beccd619477516665 (patch)
tree91b6cf8a1cd2cd6f5769179419f65538912e6664
parent9d7ff90d9a7bd9dbe9184c9588510f247877274f (diff)
downloadgitlab-ce-67c4f07db058af5290fb988beccd619477516665.tar.gz
-rw-r--r--app/assets/javascripts/boards/models/list.js19
1 files changed, 16 insertions, 3 deletions
diff --git a/app/assets/javascripts/boards/models/list.js b/app/assets/javascripts/boards/models/list.js
index 9f6d9a853da..6cf77705847 100644
--- a/app/assets/javascripts/boards/models/list.js
+++ b/app/assets/javascripts/boards/models/list.js
@@ -4,8 +4,9 @@
import { __ } from '~/locale';
import ListLabel from '~/vue_shared/models/label';
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 ListMilestone from './milestone';
const PER_PAGE = 20;
@@ -51,6 +52,9 @@ class List {
} else if (obj.user) {
this.assignee = new ListAssignee(obj.user);
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) {
@@ -69,12 +73,14 @@ class List {
}
save() {
- const entity = this.label || this.assignee;
+ const entity = this.label || this.assignee || this.milestone;
let entityType = '';
if (this.label) {
entityType = 'label_id';
- } else {
+ } else if (this.assignee) {
entityType = 'assignee_id';
+ } else if (isEE && this.milestone) {
+ entityType = 'milestone_id';
}
return gl.boardService
@@ -192,6 +198,13 @@ class List {
issue.addAssignee(this.assignee);
}
+ if (isEE && this.milestone) {
+ if (listFrom && listFrom.type === 'milestone') {
+ issue.removeMilestone(listFrom.milestone);
+ }
+ issue.addMilestone(this.milestone);
+ }
+
if (listFrom) {
this.issuesSize += 1;