summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/boards/stores/boards_store.js
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-12 15:09:39 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-12 15:09:39 +0000
commitdc889678d1de8c09310b2f8f9742bb6c78a6f1a4 (patch)
tree70945aa6721a271fc8057efa13c3216a03fbac45 /app/assets/javascripts/boards/stores/boards_store.js
parentcd52759ee33051b8ad7b88b02ba7954e4fad7018 (diff)
downloadgitlab-ce-dc889678d1de8c09310b2f8f9742bb6c78a6f1a4.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.js12
1 files changed, 5 insertions, 7 deletions
diff --git a/app/assets/javascripts/boards/stores/boards_store.js b/app/assets/javascripts/boards/stores/boards_store.js
index 528dc4ed68e..e5447080e37 100644
--- a/app/assets/javascripts/boards/stores/boards_store.js
+++ b/app/assets/javascripts/boards/stores/boards_store.js
@@ -2,7 +2,7 @@
/* global List */
import $ from 'jquery';
-import _ from 'underscore';
+import { sortBy } from 'lodash';
import Vue from 'vue';
import Cookies from 'js-cookie';
import BoardsStoreEE from 'ee_else_ce/boards/stores/boards_store_ee';
@@ -76,8 +76,7 @@ const boardsStore = {
},
addList(listObj) {
const list = new List(listObj);
- this.state.lists = _.sortBy([...this.state.lists, list], 'position');
-
+ this.state.lists = sortBy([...this.state.lists, list], 'position');
return list;
},
new(listObj) {
@@ -90,7 +89,7 @@ const boardsStore = {
// Remove any new issues from the backlog
// as they will be visible in the new list
list.issues.forEach(backlogList.removeIssue.bind(backlogList));
- this.state.lists = _.sortBy(this.state.lists, 'position');
+ this.state.lists = sortBy(this.state.lists, 'position');
})
.catch(() => {
// https://gitlab.com/gitlab-org/gitlab-foss/issues/30821
@@ -194,10 +193,9 @@ const boardsStore = {
moveMultipleIssuesToList({ listFrom, listTo, issues, newIndex }) {
const issueTo = issues.map(issue => listTo.findIssue(issue.id));
- const issueLists = _.flatten(issues.map(issue => issue.getLists()));
+ const issueLists = issues.map(issue => issue.getLists()).flat();
const listLabels = issueLists.map(list => list.label);
-
- const hasMoveableIssues = _.compact(issueTo).length > 0;
+ const hasMoveableIssues = issueTo.filter(Boolean).length > 0;
if (!hasMoveableIssues) {
// Check if target list assignee is already present in this issue