diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
commit | 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch) | |
tree | a77e7fe7a93de11213032ed4ab1f33a3db51b738 /app/assets/javascripts/boards/models/issue.js | |
parent | 00b35af3db1abfe813a778f643dad221aad51fca (diff) |
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'app/assets/javascripts/boards/models/issue.js')
-rw-r--r-- | app/assets/javascripts/boards/models/issue.js | 39 |
1 files changed, 13 insertions, 26 deletions
diff --git a/app/assets/javascripts/boards/models/issue.js b/app/assets/javascripts/boards/models/issue.js index 878f49cc6be..98eac35b2ed 100644 --- a/app/assets/javascripts/boards/models/issue.js +++ b/app/assets/javascripts/boards/models/issue.js @@ -30,56 +30,43 @@ class ListIssue { } addLabel(label) { - if (!this.findLabel(label)) { - this.labels.push(new ListLabel(label)); - } + boardsStore.addIssueLabel(this, label); } findLabel(findLabel) { - return this.labels.find(label => label.id === findLabel.id); + return boardsStore.findIssueLabel(this, findLabel); } removeLabel(removeLabel) { - if (removeLabel) { - this.labels = this.labels.filter(label => removeLabel.id !== label.id); - } + boardsStore.removeIssueLabel(this, removeLabel); } removeLabels(labels) { - labels.forEach(this.removeLabel.bind(this)); + boardsStore.removeIssueLabels(this, labels); } addAssignee(assignee) { - if (!this.findAssignee(assignee)) { - this.assignees.push(new ListAssignee(assignee)); - } + boardsStore.addIssueAssignee(this, assignee); } findAssignee(findAssignee) { - return this.assignees.find(assignee => assignee.id === findAssignee.id); + return boardsStore.findIssueAssignee(this, findAssignee); } removeAssignee(removeAssignee) { - if (removeAssignee) { - this.assignees = this.assignees.filter(assignee => assignee.id !== removeAssignee.id); - } + boardsStore.removeIssueAssignee(this, removeAssignee); } removeAllAssignees() { - this.assignees = []; + boardsStore.removeAllIssueAssignees(this); } addMilestone(milestone) { - const miletoneId = this.milestone ? this.milestone.id : null; - if (IS_EE && milestone.id !== miletoneId) { - this.milestone = new ListMilestone(milestone); - } + boardsStore.addIssueMilestone(this, milestone); } removeMilestone(removeMilestone) { - if (IS_EE && removeMilestone && removeMilestone.id === this.milestone.id) { - this.milestone = {}; - } + boardsStore.removeIssueMilestone(this, removeMilestone); } getLists() { @@ -87,15 +74,15 @@ class ListIssue { } updateData(newData) { - Object.assign(this, newData); + boardsStore.updateIssueData(this, newData); } setFetchingState(key, value) { - this.isFetching[key] = value; + boardsStore.setIssueFetchingState(this, key, value); } setLoadingState(key, value) { - this.isLoading[key] = value; + boardsStore.setIssueLoadingState(this, key, value); } update() { |