diff options
author | Maksim Sukharev <antreesy.web@gmail.com> | 2024-06-26 14:57:58 +0200 |
---|---|---|
committer | Maksim Sukharev <antreesy.web@gmail.com> | 2024-06-26 19:20:40 +0200 |
commit | b3328512e71ac978c24386528169d49b1d500c78 (patch) | |
tree | cf625fa050f23f41a8bbcddefe9f91f606c4734b /src | |
parent | 4477b53034f63a9c74fce967df4adfca5b662757 (diff) |
fix(RightSidebar): remove unused actions/getters/computed
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/components/RightSidebar/RightSidebar.vue | 36 | ||||
-rw-r--r-- | src/store/sidebarStore.js | 32 | ||||
-rw-r--r-- | src/store/sidebarStore.spec.js | 35 |
3 files changed, 3 insertions, 100 deletions
diff --git a/src/components/RightSidebar/RightSidebar.vue b/src/components/RightSidebar/RightSidebar.vue index 972c52287..22b600e31 100644 --- a/src/components/RightSidebar/RightSidebar.vue +++ b/src/components/RightSidebar/RightSidebar.vue @@ -5,11 +5,10 @@ <template> <NcAppSidebar v-show="opened" - :name="name" - :title="name" - :active="activeTab" + :name="conversation.displayName" + :title="conversation.displayName" + :active.sync="activeTab" :class="'active-tab-' + activeTab" - @update:active="handleUpdateActive" @closed="handleClosed" @close="handleClose"> <template #description> @@ -190,10 +189,6 @@ export default { || (this.conversation.type === CONVERSATION.TYPE.PUBLIC && this.conversation.objectType !== CONVERSATION.OBJECT_TYPE.VIDEO_VERIFICATION)) }, - isSearching() { - return this.searchText !== '' - }, - participantType() { return this.conversation.participantType }, @@ -202,10 +197,6 @@ export default { return this.participantType === PARTICIPANT.TYPE.OWNER || this.participantType === PARTICIPANT.TYPE.MODERATOR }, - canModerate() { - return !this.isOneToOne && (this.canFullModerate || this.participantType === PARTICIPANT.TYPE.GUEST_MODERATOR) - }, - isModeratorOrUser() { return this.$store.getters.isModeratorOrUser }, @@ -214,23 +205,6 @@ export default { return this.$store.getters.isInLobby }, - /** - * The conversation name value passed into the NcAppSidebar component. - * - * @return {string} The conversation's name. - */ - name() { - if (this.isRenamingConversation) { - return this.conversationName - } else { - return this.conversation.displayName - } - }, - - isRenamingConversation() { - return this.$store.getters.isRenamingConversation - }, - showSIPSettings() { return this.conversation.sipEnabled !== WEBINAR.SIP.DISABLED && this.conversation.attendeePin @@ -287,10 +261,6 @@ export default { watch: { conversation(newConversation, oldConversation) { - if (!this.isRenamingConversation) { - this.conversationName = this.conversation.displayName - } - if (newConversation.token === oldConversation.token || !this.showParticipantsTab) { return } diff --git a/src/store/sidebarStore.js b/src/store/sidebarStore.js index 078a94b7c..97352a44d 100644 --- a/src/store/sidebarStore.js +++ b/src/store/sidebarStore.js @@ -5,18 +5,12 @@ const state = { show: true, - isRenamingConversation: false, - sidebarOpenBeforeEditing: null, - } const getters = { getSidebarStatus: (state) => { return state.show }, - isRenamingConversation: (state) => { - return state.isRenamingConversation - }, } const mutations = { @@ -36,23 +30,6 @@ const mutations = { hideSidebar(state) { state.show = false }, - /** - * Renaming state of the conversation - * - * @param {object} state current store state; - * @param {boolean} boolean the state of the renaming action; - */ - isRenamingConversation(state, boolean) { - if (boolean) { - // Record sidebar status before starting editing process - state.sidebarOpenBeforeEditing = state.show - state.isRenamingConversation = true - } else { - state.isRenamingConversation = false - // Go back to the previous sidebar state - state.show = state.sidebarOpenBeforeEditing - } - }, } const actions = { @@ -73,15 +50,6 @@ const actions = { hideSidebar(context) { context.commit('hideSidebar') }, - /** - * Renaming state of the conversation - * - * @param {object} context default store context; - * @param {boolean} boolean the state of the renaming action; - */ - isRenamingConversation(context, boolean) { - context.commit('isRenamingConversation', boolean) - }, } export default { state, mutations, getters, actions } diff --git a/src/store/sidebarStore.spec.js b/src/store/sidebarStore.spec.js index 993a09b2f..500fe1203 100644 --- a/src/store/sidebarStore.spec.js +++ b/src/store/sidebarStore.spec.js @@ -26,7 +26,6 @@ describe('sidebarStore', () => { test('defaults are off', () => { expect(store.getters.getSidebarStatus).toBe(true) - expect(store.getters.isRenamingConversation).toBe(false) }) test('toggle sidebar', () => { @@ -38,38 +37,4 @@ describe('sidebarStore', () => { expect(store.getters.getSidebarStatus).toBe(true) }) - - test('toggling renaming mode and remembers sidebar hidden state', () => { - store.dispatch('hideSidebar') - store.dispatch('isRenamingConversation', true) - - expect(store.getters.getSidebarStatus).toBe(false) - expect(store.getters.isRenamingConversation).toBe(true) - - store.dispatch('showSidebar') - - expect(store.getters.getSidebarStatus).toBe(true) - - store.dispatch('isRenamingConversation', false) - - expect(store.getters.getSidebarStatus).toBe(false) - expect(store.getters.isRenamingConversation).toBe(false) - }) - - test('toggling renaming mode and remembers sidebar shown state', () => { - store.dispatch('showSidebar') - store.dispatch('isRenamingConversation', true) - - expect(store.getters.getSidebarStatus).toBe(true) - expect(store.getters.isRenamingConversation).toBe(true) - - store.dispatch('hideSidebar') - - expect(store.getters.getSidebarStatus).toBe(false) - - store.dispatch('isRenamingConversation', false) - - expect(store.getters.getSidebarStatus).toBe(true) - expect(store.getters.isRenamingConversation).toBe(false) - }) }) |