From 976f67921c09848e0780cd8c1b70b663cf587c50 Mon Sep 17 00:00:00 2001 From: Maksim Sukharev Date: Thu, 19 Sep 2024 06:43:23 +0200 Subject: [PATCH] fix: remove container getters, setters and store Signed-off-by: Maksim Sukharev --- src/collections.js | 7 +-- .../BreakoutRoomsParticipantsEditor.vue | 4 -- .../Matterbridge/MatterbridgeSettings.vue | 3 -- src/components/TopBar/TopBar.vue | 4 -- src/main.js | 5 --- src/mainFilesSidebar.js | 2 - src/mainPublicShareAuthSidebar.js | 1 - src/mainPublicShareSidebar.js | 2 - src/mainRecording.js | 5 --- src/store/storeConfig.js | 2 - src/store/uiModeStore.js | 43 ------------------- 11 files changed, 1 insertion(+), 77 deletions(-) delete mode 100644 src/store/uiModeStore.js diff --git a/src/collections.js b/src/collections.js index 28c90820715..b9b51606430 100644 --- a/src/collections.js +++ b/src/collections.js @@ -14,12 +14,7 @@ __webpack_public_path__ = OC.linkTo('spreed', 'js/') window.OCP.Collaboration.registerType('room', { action: async () => { - const conversation = await requestRoomSelection('spreed-room-select', { - // Even if it is used from Talk the Collections menu is - // independently loaded, so the properties that depend - // on the store need to be explicitly injected. - container: window.store ? window.store.getters.getMainContainerSelector() : undefined, - }) + const conversation = await requestRoomSelection('spreed-room-select', {}) if (!conversation) { throw new Error('User cancelled resource selection') } diff --git a/src/components/BreakoutRoomsEditor/BreakoutRoomsParticipantsEditor.vue b/src/components/BreakoutRoomsEditor/BreakoutRoomsParticipantsEditor.vue index 2050f96235c..5122a6a2370 100644 --- a/src/components/BreakoutRoomsEditor/BreakoutRoomsParticipantsEditor.vue +++ b/src/components/BreakoutRoomsEditor/BreakoutRoomsParticipantsEditor.vue @@ -163,10 +163,6 @@ export default { }, computed: { - container() { - return this.$store.getters.getMainContainerSelector() - }, - participants() { return this.$store.getters.participantsList(this.token).filter(participant => { return (participant.participantType === PARTICIPANT.TYPE.USER diff --git a/src/components/ConversationSettings/Matterbridge/MatterbridgeSettings.vue b/src/components/ConversationSettings/Matterbridge/MatterbridgeSettings.vue index 452f144d843..a95c4dba20d 100644 --- a/src/components/ConversationSettings/Matterbridge/MatterbridgeSettings.vue +++ b/src/components/ConversationSettings/Matterbridge/MatterbridgeSettings.vue @@ -533,9 +533,6 @@ export default { ? t('spreed', 'not running, check Matterbridge log') : t('spreed', 'not running') }, - container() { - return this.$store.getters.getMainContainerSelector() - }, }, beforeMount() { diff --git a/src/components/TopBar/TopBar.vue b/src/components/TopBar/TopBar.vue index e504ff2cf71..462b1acbc6f 100644 --- a/src/components/TopBar/TopBar.vue +++ b/src/components/TopBar/TopBar.vue @@ -212,10 +212,6 @@ export default { }, computed: { - container() { - return this.$store.getters.getMainContainerSelector() - }, - isOneToOneConversation() { return this.conversation.type === CONVERSATION.TYPE.ONE_TO_ONE || this.conversation.type === CONVERSATION.TYPE.ONE_TO_ONE_FORMER diff --git a/src/main.js b/src/main.js index 0f6ac58d766..b3e9db0320c 100644 --- a/src/main.js +++ b/src/main.js @@ -12,8 +12,6 @@ import { getRequestToken } from '@nextcloud/auth' import { emit } from '@nextcloud/event-bus' import { generateFilePath } from '@nextcloud/router' -import { options as TooltipOptions } from '@nextcloud/vue/dist/Directives/Tooltip.js' - import App from './App.vue' import './init.js' @@ -51,9 +49,6 @@ Vue.use(VueRouter) const pinia = createPinia() -TooltipOptions.container = 'body' -store.dispatch('setMainContainerSelector', 'body') - const instance = new Vue({ el: '#content', store, diff --git a/src/mainFilesSidebar.js b/src/mainFilesSidebar.js index 23fd88626a1..06b9049470e 100644 --- a/src/mainFilesSidebar.js +++ b/src/mainFilesSidebar.js @@ -42,8 +42,6 @@ Vue.use(Vuex) const pinia = createPinia() -store.dispatch('setMainContainerSelector', 'body') - const newCallView = () => new Vue({ store, pinia, diff --git a/src/mainPublicShareAuthSidebar.js b/src/mainPublicShareAuthSidebar.js index a1b307a50c1..833bea9082a 100644 --- a/src/mainPublicShareAuthSidebar.js +++ b/src/mainPublicShareAuthSidebar.js @@ -41,7 +41,6 @@ Vue.use(PiniaVuePlugin) Vue.use(Vuex) const pinia = createPinia() -store.dispatch('setMainContainerSelector', 'body') /** * Wraps all the body contents in its own container. diff --git a/src/mainPublicShareSidebar.js b/src/mainPublicShareSidebar.js index 5f93a8e5fea..ccd6a34c960 100644 --- a/src/mainPublicShareSidebar.js +++ b/src/mainPublicShareSidebar.js @@ -42,8 +42,6 @@ Vue.use(Vuex) const pinia = createPinia() -store.dispatch('setMainContainerSelector', 'body') - /** * */ diff --git a/src/mainRecording.js b/src/mainRecording.js index c17f4d5e118..e73a5483d56 100644 --- a/src/mainRecording.js +++ b/src/mainRecording.js @@ -12,8 +12,6 @@ import Vuex from 'vuex' import { getRequestToken } from '@nextcloud/auth' import { generateFilePath } from '@nextcloud/router' -import { options as TooltipOptions } from '@nextcloud/vue/dist/Directives/Tooltip.js' - import Recording from './Recording.vue' import router from './router/router.js' @@ -52,9 +50,6 @@ Vue.use(VueRouter) const pinia = createPinia() -TooltipOptions.container = 'body' -store.dispatch('setMainContainerSelector', 'body') - window.store = store if (!window.OCA.Talk) { diff --git a/src/store/storeConfig.js b/src/store/storeConfig.js index 8c35643e669..b0c818175a2 100644 --- a/src/store/storeConfig.js +++ b/src/store/storeConfig.js @@ -12,7 +12,6 @@ import messagesStore from './messagesStore.js' import participantsStore from './participantsStore.js' import soundsStore from './soundsStore.js' import tokenStore from './tokenStore.js' -import uiModeStore from './uiModeStore.js' export default { modules: { @@ -25,7 +24,6 @@ export default { participantsStore, soundsStore, tokenStore, - uiModeStore, }, mutations: {}, diff --git a/src/store/uiModeStore.js b/src/store/uiModeStore.js deleted file mode 100644 index 03eb69fa265..00000000000 --- a/src/store/uiModeStore.js +++ /dev/null @@ -1,43 +0,0 @@ -/** - * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -/** - * This store handles the values that need to be customized depending on the - * current UI mode of Talk (main UI, embedded in Files sidebar, video - * verification page...). - */ - -const state = { - mainContainerSelector: undefined, -} - -const getters = { - getMainContainerSelector: (state, getters, rootState, rootGetters) => () => { - return state.mainContainerSelector - }, -} - -const mutations = { - setMainContainerSelector(state, mainContainerSelector) { - state.mainContainerSelector = mainContainerSelector - }, -} - -const actions = { - /** - * Set the main container selector. - * - * By default the container selector is undefined, which in practice will - * cause the components to use "body" as the selector. - * - * @param {object} context default store context - * @param {string} mainContainerSelector the selector for the container - */ - setMainContainerSelector(context, mainContainerSelector) { - context.commit('setMainContainerSelector', mainContainerSelector) - }, -} - -export default { state, mutations, getters, actions }