summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/boards
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-21 21:08:54 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-21 21:08:54 +0000
commit36e363d33d5f75aeb75c552d4b325ed8c2d6105f (patch)
tree1ca97e2e47c613eed6b6cd4682c36c92067cab46 /app/assets/javascripts/boards
parentd91f5211693e913da5df110b8de841fad87e3653 (diff)
downloadgitlab-ce-36e363d33d5f75aeb75c552d4b325ed8c2d6105f.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/boards')
-rw-r--r--app/assets/javascripts/boards/models/list.js22
-rw-r--r--app/assets/javascripts/boards/stores/boards_store.js25
2 files changed, 25 insertions, 22 deletions
diff --git a/app/assets/javascripts/boards/models/list.js b/app/assets/javascripts/boards/models/list.js
index b232fea0882..299864c279b 100644
--- a/app/assets/javascripts/boards/models/list.js
+++ b/app/assets/javascripts/boards/models/list.js
@@ -83,27 +83,7 @@ class List {
}
save() {
- const entity = this.label || this.assignee || this.milestone;
- let entityType = '';
- if (this.label) {
- entityType = 'label_id';
- } else if (this.assignee) {
- entityType = 'assignee_id';
- } else if (IS_EE && this.milestone) {
- entityType = 'milestone_id';
- }
-
- return boardsStore
- .createList(entity.id, entityType)
- .then(res => res.data)
- .then(data => {
- this.id = data.id;
- this.type = data.list_type;
- this.position = data.position;
- this.label = data.label;
-
- return this.getIssues();
- });
+ return boardsStore.saveList(this);
}
destroy() {
diff --git a/app/assets/javascripts/boards/stores/boards_store.js b/app/assets/javascripts/boards/stores/boards_store.js
index 8b737d1dab0..df8b7a2df6c 100644
--- a/app/assets/javascripts/boards/stores/boards_store.js
+++ b/app/assets/javascripts/boards/stores/boards_store.js
@@ -1,4 +1,4 @@
-/* eslint-disable no-shadow */
+/* eslint-disable no-shadow, no-param-reassign */
/* global List */
import $ from 'jquery';
@@ -408,6 +408,29 @@ const boardsStore = {
return axios.delete(`${this.state.endpoints.listsEndpoint}/${id}`);
},
+ saveList(list) {
+ const entity = list.label || list.assignee || list.milestone;
+ let entityType = '';
+ if (list.label) {
+ entityType = 'label_id';
+ } else if (list.assignee) {
+ entityType = 'assignee_id';
+ } else if (IS_EE && list.milestone) {
+ entityType = 'milestone_id';
+ }
+
+ return this.createList(entity.id, entityType)
+ .then(res => res.data)
+ .then(data => {
+ list.id = data.id;
+ list.type = data.list_type;
+ list.position = data.position;
+ list.label = data.label;
+
+ return list.getIssues();
+ });
+ },
+
getIssuesForList(id, filter = {}) {
const data = { id };
Object.keys(filter).forEach(key => {