summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKushal Pandya <kushalspandya@gmail.com>2019-04-11 06:59:30 +0000
committerKushal Pandya <kushalspandya@gmail.com>2019-04-11 06:59:30 +0000
commita4262919f76d7d2f82754753dc03b6d2bf310905 (patch)
treee37998f66a6a705fd291b88ded841acda8c699f7
parent6643b1c92d3468b84289720c069632df7266fa18 (diff)
parentb3ac7a2c19f50a56d64ec2f49974057c67207905 (diff)
downloadgitlab-ce-a4262919f76d7d2f82754753dc03b6d2bf310905.tar.gz
Merge branch '10016-move-ee-differences-for-app-assets-javascripts-boards-models-issue-js' into 'master'
Backport of "Move EE differences for `app/assets/javascripts/boards/models/issue.js`" See merge request gitlab-org/gitlab-ce!27197
-rw-r--r--app/assets/javascripts/boards/models/issue.js16
1 files changed, 15 insertions, 1 deletions
diff --git a/app/assets/javascripts/boards/models/issue.js b/app/assets/javascripts/boards/models/issue.js
index 2edb6723ada..b4d913f5d69 100644
--- a/app/assets/javascripts/boards/models/issue.js
+++ b/app/assets/javascripts/boards/models/issue.js
@@ -5,6 +5,7 @@
import Vue from 'vue';
import '~/vue_shared/models/label';
+import { isEE } from '~/lib/utils/common_utils';
import IssueProject from './project';
import boardsStore from '../stores/boards_store';
@@ -28,7 +29,6 @@ class ListIssue {
this.referencePath = obj.reference_path;
this.path = obj.real_path;
this.toggleSubscriptionEndpoint = obj.toggle_subscription_endpoint;
- this.milestone_id = obj.milestone_id;
this.project_id = obj.project_id;
this.timeEstimate = obj.time_estimate;
this.assignableLabelsEndpoint = obj.assignable_labels_endpoint;
@@ -39,6 +39,7 @@ class ListIssue {
if (obj.milestone) {
this.milestone = new ListMilestone(obj.milestone);
+ this.milestone_id = obj.milestone.id;
}
obj.labels.forEach(label => {
@@ -88,6 +89,19 @@ class ListIssue {
this.assignees = [];
}
+ addMilestone(milestone) {
+ const miletoneId = this.milestone ? this.milestone.id : null;
+ if (isEE && milestone.id !== miletoneId) {
+ this.milestone = new ListMilestone(milestone);
+ }
+ }
+
+ removeMilestone(removeMilestone) {
+ if (isEE && removeMilestone && removeMilestone.id === this.milestone.id) {
+ this.milestone = {};
+ }
+ }
+
getLists() {
return boardsStore.state.lists.filter(list => list.findIssue(this.id));
}