diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-12 15:09:39 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-12 15:09:39 +0000 |
commit | dc889678d1de8c09310b2f8f9742bb6c78a6f1a4 (patch) | |
tree | 70945aa6721a271fc8057efa13c3216a03fbac45 /app/assets/javascripts/boards | |
parent | cd52759ee33051b8ad7b88b02ba7954e4fad7018 (diff) | |
download | gitlab-ce-dc889678d1de8c09310b2f8f9742bb6c78a6f1a4.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/boards')
5 files changed, 14 insertions, 19 deletions
diff --git a/app/assets/javascripts/boards/components/board_list.vue b/app/assets/javascripts/boards/components/board_list.vue index 4a64d9e04f2..c4e2c398d45 100644 --- a/app/assets/javascripts/boards/components/board_list.vue +++ b/app/assets/javascripts/boards/components/board_list.vue @@ -1,7 +1,6 @@ <script> import { Sortable, MultiDrag } from 'sortablejs'; import { GlLoadingIcon } from '@gitlab/ui'; -import _ from 'underscore'; import boardNewIssue from './board_new_issue.vue'; import boardCard from './board_card.vue'; import eventHub from '../eventhub'; @@ -266,11 +265,12 @@ export default { * same list or the other list. Don't remove items if it's same list. */ const isSameList = toList && toList.id === this.list.id; - if (toList && !isSameList && boardsStore.shouldRemoveIssue(this.list, toList)) { const issues = items.map(item => this.list.findIssue(Number(item.dataset.issueId))); - - if (_.compact(issues).length && !boardsStore.issuesAreContiguous(this.list, issues)) { + if ( + issues.filter(Boolean).length && + !boardsStore.issuesAreContiguous(this.list, issues) + ) { const indexes = []; const ids = this.list.issues.map(i => i.id); issues.forEach(issue => { diff --git a/app/assets/javascripts/boards/components/boards_selector.vue b/app/assets/javascripts/boards/components/boards_selector.vue index 8b44ccfd276..fbf487357a5 100644 --- a/app/assets/javascripts/boards/components/boards_selector.vue +++ b/app/assets/javascripts/boards/components/boards_selector.vue @@ -1,5 +1,5 @@ <script> -import { throttle } from 'underscore'; +import { throttle } from 'lodash'; import { GlLoadingIcon, GlSearchBoxByType, diff --git a/app/assets/javascripts/boards/components/issue_card_inner.vue b/app/assets/javascripts/boards/components/issue_card_inner.vue index 00da039c235..daaa12c096b 100644 --- a/app/assets/javascripts/boards/components/issue_card_inner.vue +++ b/app/assets/javascripts/boards/components/issue_card_inner.vue @@ -1,5 +1,5 @@ <script> -import _ from 'underscore'; +import { sortBy } from 'lodash'; import { mapState } from 'vuex'; import { GlLabel, GlTooltipDirective } from '@gitlab/ui'; import issueCardInner from 'ee_else_ce/boards/mixins/issue_card_inner'; @@ -100,10 +100,7 @@ export default { return !groupId ? referencePath.split('#')[0] : null; }, orderedLabels() { - return _.chain(this.issue.labels) - .filter(this.isNonListLabel) - .sortBy('title') - .value(); + return sortBy(this.issue.labels.filter(this.isNonListLabel), 'title'); }, helpLink() { return boardsStore.scopedLabels.helpLink; diff --git a/app/assets/javascripts/boards/components/project_select.vue b/app/assets/javascripts/boards/components/project_select.vue index 4a50b1e2efc..30f1e843e7b 100644 --- a/app/assets/javascripts/boards/components/project_select.vue +++ b/app/assets/javascripts/boards/components/project_select.vue @@ -1,6 +1,6 @@ <script> import $ from 'jquery'; -import _ from 'underscore'; +import { escape } from 'lodash'; import { GlLoadingIcon } from '@gitlab/ui'; import Icon from '~/vue_shared/components/icon.vue'; import { __ } from '~/locale'; @@ -83,7 +83,7 @@ export default { }" data-project-name="${project.name}" data-project-name-with-namespace="${ project.name_with_namespace }"> - ${_.escape(project.name_with_namespace)} + ${escape(project.name_with_namespace)} </a> </li> `; 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 |