diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-26 21:09:18 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-26 21:09:18 +0300 |
commit | 08931747cc2092734a794980ef13ff67e89a9d8b (patch) | |
tree | 0ef1c5fd1e60201b52954c1c105b800930d92c90 /app/assets/javascripts/boards | |
parent | 2eaa60e4555bb11ad5c0af905217f0fa61cf7cc9 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/boards')
7 files changed, 24 insertions, 34 deletions
diff --git a/app/assets/javascripts/boards/components/board_content.vue b/app/assets/javascripts/boards/components/board_content.vue index 92976574efb..54ce736e26b 100644 --- a/app/assets/javascripts/boards/components/board_content.vue +++ b/app/assets/javascripts/boards/components/board_content.vue @@ -32,9 +32,9 @@ export default { ...mapState(['boardLists', 'error']), ...mapGetters(['isSwimlanesOn']), boardListsToUse() { - const lists = - this.glFeatures.graphqlBoardLists || this.isSwimlanesOn ? this.boardLists : this.lists; - return sortBy([...Object.values(lists)], 'position'); + return this.glFeatures.graphqlBoardLists || this.isSwimlanesOn + ? sortBy([...Object.values(this.boardLists)], 'position') + : this.lists; }, }, mounted() { @@ -53,11 +53,7 @@ export default { <gl-alert v-if="error" variant="danger" :dismissible="false"> {{ error }} </gl-alert> - <div - v-if="!isSwimlanesOn" - class="boards-list gl-w-full gl-py-5 gl-px-3 gl-white-space-nowrap" - data-qa-selector="boards_list" - > + <div v-if="!isSwimlanesOn" class="boards-list gl-w-full gl-py-5 gl-px-3 gl-white-space-nowrap"> <board-column v-for="list in boardListsToUse" :key="list.id" diff --git a/app/assets/javascripts/boards/components/board_list_header_new.vue b/app/assets/javascripts/boards/components/board_list_header_new.vue index 447fef4b49c..d74b5115214 100644 --- a/app/assets/javascripts/boards/components/board_list_header_new.vue +++ b/app/assets/javascripts/boards/components/board_list_header_new.vue @@ -278,7 +278,7 @@ export default { v-if="isSwimlanesHeader && !list.isExpanded" ref="collapsedInfo" aria-hidden="true" - class="board-header-collapsed-info-icon gl-mt-2 gl-cursor-pointer gl-text-gray-500" + class="board-header-collapsed-info-icon gl-cursor-pointer gl-text-gray-500" > <gl-icon name="information" /> </span> diff --git a/app/assets/javascripts/boards/components/modal/filters.js b/app/assets/javascripts/boards/components/modal/filters.js index 56a0fde5a91..41f09a1895f 100644 --- a/app/assets/javascripts/boards/components/modal/filters.js +++ b/app/assets/javascripts/boards/components/modal/filters.js @@ -1,5 +1,6 @@ import FilteredSearchBoards from '../../filtered_search_boards'; import FilteredSearchContainer from '../../../filtered_search/container'; +import vuexstore from '~/boards/stores'; export default { name: 'modal-filters', @@ -12,7 +13,7 @@ export default { mounted() { FilteredSearchContainer.container = this.$el; - this.filteredSearch = new FilteredSearchBoards(this.store); + this.filteredSearch = new FilteredSearchBoards(this.store, vuexstore); this.filteredSearch.setup(); this.filteredSearch.removeTokens(); this.filteredSearch.handleInputPlaceholder(); diff --git a/app/assets/javascripts/boards/filtered_search_boards.js b/app/assets/javascripts/boards/filtered_search_boards.js index 4fa78ecd5a4..9e857bbfad2 100644 --- a/app/assets/javascripts/boards/filtered_search_boards.js +++ b/app/assets/javascripts/boards/filtered_search_boards.js @@ -4,7 +4,7 @@ import FilteredSearchContainer from '../filtered_search/container'; import boardsStore from './stores/boards_store'; export default class FilteredSearchBoards extends FilteredSearchManager { - constructor(store, updateUrl = false, cantEdit = []) { + constructor(store, vuexstore, updateUrl = false, cantEdit = []) { super({ page: 'boards', isGroupDecendent: true, @@ -22,18 +22,18 @@ export default class FilteredSearchBoards extends FilteredSearchManager { this.isHandledAsync = true; this.cantEdit = cantEdit.filter(i => typeof i === 'string'); this.cantEditWithValue = cantEdit.filter(i => typeof i === 'object'); + + this.vuexstore = vuexstore; } updateObject(path) { const groupByParam = new URLSearchParams(window.location.search).get('group_by'); this.store.path = `${path.substr(1)}${groupByParam ? `&group_by=${groupByParam}` : ''}`; - if (gon.features.boardsWithSwimlanes || gon.features.graphqlBoardLists) { + if (this.vuexstore.getters.shouldUseGraphQL) { boardsStore.updateFiltersUrl(); boardsStore.performSearch(); - } - - if (this.updateUrl) { + } else if (this.updateUrl) { boardsStore.updateFiltersUrl(); } } diff --git a/app/assets/javascripts/boards/index.js b/app/assets/javascripts/boards/index.js index d3e40299d8d..bda581f5a4d 100644 --- a/app/assets/javascripts/boards/index.js +++ b/app/assets/javascripts/boards/index.js @@ -1,5 +1,5 @@ import Vue from 'vue'; -import { mapActions, mapGetters, mapState } from 'vuex'; +import { mapActions, mapGetters } from 'vuex'; import 'ee_else_ce/boards/models/issue'; import 'ee_else_ce/boards/models/list'; @@ -77,7 +77,6 @@ export default () => { el: $boardApp, components: { BoardContent, - Board: () => import('ee_else_ce/boards/components/board_column.vue'), BoardSidebar, BoardAddIssuesModal, BoardSettingsSidebar: () => import('~/boards/components/board_settings_sidebar.vue'), @@ -114,8 +113,7 @@ export default () => { }; }, computed: { - ...mapState(['isShowingEpicsSwimlanes']), - ...mapGetters(['shouldUseGraphQL']), + ...mapGetters(['isSwimlanesOn', 'shouldUseGraphQL']), detailIssueVisible() { return Object.keys(this.detailIssue.issue).length; }, @@ -154,7 +152,12 @@ export default () => { eventHub.$off('initialBoardLoad', this.initialBoardLoad); }, mounted() { - this.filterManager = new FilteredSearchBoards(boardsStore.filter, true, boardsStore.cantEdit); + this.filterManager = new FilteredSearchBoards( + boardsStore.filter, + store, + true, + boardsStore.cantEdit, + ); this.filterManager.setup(); this.performSearch(); @@ -193,11 +196,11 @@ export default () => { }, performSearch() { this.setFilters(convertObjectPropsToCamelCase(urlParamsToObject(window.location.search))); - if (gon.features.boardsWithSwimlanes && this.isShowingEpicsSwimlanes) { + if (this.isSwimlanesOn) { this.resetEpics(); this.resetIssues(); this.fetchEpicsSwimlanes({}); - } else if (gon.features.graphqlBoardLists && !this.isShowingEpicsSwimlanes) { + } else if (gon.features.graphqlBoardLists) { this.fetchLists(); this.resetIssues(); } diff --git a/app/assets/javascripts/boards/stores/boards_store.js b/app/assets/javascripts/boards/stores/boards_store.js index 337b2897fe9..2a4bf7c7288 100644 --- a/app/assets/javascripts/boards/stores/boards_store.js +++ b/app/assets/javascripts/boards/stores/boards_store.js @@ -302,11 +302,7 @@ const boardsStore = { onNewListIssueResponse(list, issue, data) { issue.refreshData(data); - if ( - !gon.features.boardsWithSwimlanes && - !gon.features.graphqlBoardLists && - list.issues.length > 1 - ) { + if (list.issues.length > 1) { const moveBeforeId = list.issues[1].id; this.moveIssue(issue.id, null, null, null, moveBeforeId); } diff --git a/app/assets/javascripts/boards/stores/getters.js b/app/assets/javascripts/boards/stores/getters.js index cd28b4a0ff7..d2517fd2cfc 100644 --- a/app/assets/javascripts/boards/stores/getters.js +++ b/app/assets/javascripts/boards/stores/getters.js @@ -4,13 +4,7 @@ import { inactiveId } from '../constants'; export default { labelToggleState: state => (state.isShowingLabels ? 'on' : 'off'), isSidebarOpen: state => state.activeId !== inactiveId, - isSwimlanesOn: state => { - if (!gon?.features?.boardsWithSwimlanes && !gon?.features?.swimlanes) { - return false; - } - - return state.isShowingEpicsSwimlanes; - }, + isSwimlanesOn: () => false, getIssueById: state => id => { return state.issues[id] || {}; }, |