diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 16:16:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 16:16:36 +0300 |
commit | 311b0269b4eb9839fa63f80c8d7a58f32b8138a0 (patch) | |
tree | 07e7870bca8aed6d61fdcc810731c50d2c40af47 /app/assets/javascripts/boards/mount_multiple_boards_switcher.js | |
parent | 27909cef6c4170ed9205afa7426b8d3de47cbb0c (diff) |
Add latest changes from gitlab-org/gitlab@14-5-stable-eev14.5.0-rc42
Diffstat (limited to 'app/assets/javascripts/boards/mount_multiple_boards_switcher.js')
-rw-r--r-- | app/assets/javascripts/boards/mount_multiple_boards_switcher.js | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/app/assets/javascripts/boards/mount_multiple_boards_switcher.js b/app/assets/javascripts/boards/mount_multiple_boards_switcher.js index a3a8ad06c43..ed32579a9c3 100644 --- a/app/assets/javascripts/boards/mount_multiple_boards_switcher.js +++ b/app/assets/javascripts/boards/mount_multiple_boards_switcher.js @@ -1,23 +1,32 @@ +import { IntrospectionFragmentMatcher } from 'apollo-cache-inmemory'; import Vue from 'vue'; import VueApollo from 'vue-apollo'; import BoardsSelector from 'ee_else_ce/boards/components/boards_selector.vue'; import store from '~/boards/stores'; import createDefaultClient from '~/lib/graphql'; import { parseBoolean } from '~/lib/utils/common_utils'; +import introspectionQueryResultData from '~/sidebar/fragmentTypes.json'; Vue.use(VueApollo); +const fragmentMatcher = new IntrospectionFragmentMatcher({ + introspectionQueryResultData, +}); + const apolloProvider = new VueApollo({ defaultClient: createDefaultClient( {}, { - assumeImmutableResults: true, + cacheConfig: { + fragmentMatcher, + }, }, ), }); export default (params = {}) => { const boardsSwitcherElement = document.getElementById('js-multiple-boards-switcher'); + const { dataset } = boardsSwitcherElement; return new Vue({ el: boardsSwitcherElement, components: { @@ -29,18 +38,16 @@ export default (params = {}) => { fullPath: params.fullPath, rootPath: params.rootPath, recentBoardsEndpoint: params.recentBoardsEndpoint, + allowScopedLabels: params.allowScopedLabels, + labelsManagePath: params.labelsManagePath, + allowLabelCreate: parseBoolean(dataset.canAdminBoard), }, data() { - const { dataset } = boardsSwitcherElement; - const boardsSelectorProps = { ...dataset, - currentBoard: JSON.parse(dataset.currentBoard), hasMissingBoards: parseBoolean(dataset.hasMissingBoards), canAdminBoard: parseBoolean(dataset.canAdminBoard), multipleIssueBoardsAvailable: parseBoolean(dataset.multipleIssueBoardsAvailable), - projectId: dataset.projectId ? Number(dataset.projectId) : 0, - groupId: Number(dataset.groupId), scopedIssueBoardFeatureEnabled: parseBoolean(dataset.scopedIssueBoardFeatureEnabled), weights: JSON.parse(dataset.weights), }; |