diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-21 21:08:54 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-21 21:08:54 +0000 |
commit | 36e363d33d5f75aeb75c552d4b325ed8c2d6105f (patch) | |
tree | 1ca97e2e47c613eed6b6cd4682c36c92067cab46 /app/assets/javascripts/boards/stores/boards_store.js | |
parent | d91f5211693e913da5df110b8de841fad87e3653 (diff) | |
download | gitlab-ce-36e363d33d5f75aeb75c552d4b325ed8c2d6105f.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/boards/stores/boards_store.js')
-rw-r--r-- | app/assets/javascripts/boards/stores/boards_store.js | 25 |
1 files changed, 24 insertions, 1 deletions
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 => { |