summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMaksim Sukharev <antreesy.web@gmail.com>2024-06-27 09:15:51 +0200
committerGitHub <noreply@github.com>2024-06-27 09:15:51 +0200
commit2dbce993a7c50725b1c2d27b11b32e804705b729 (patch)
tree5288d4ac6901704501dcc4377a92e85965d86166 /src
parent20fcddb66adae10b839c7a9d418e530bfa7abf5f (diff)
parenta62e61a94dea569438dc7f2c28fbc3e887e3caee (diff)
Merge pull request #12585 from nextcloud/feat/noid/informative-sidebar
fix(RightSidebar): refactor, add 'Participants' to 1-1 calls
Diffstat (limited to 'src')
-rw-r--r--src/components/RightSidebar/RightSidebar.vue38
-rw-r--r--src/store/sidebarStore.js32
-rw-r--r--src/store/sidebarStore.spec.js35
3 files changed, 4 insertions, 101 deletions
diff --git a/src/components/RightSidebar/RightSidebar.vue b/src/components/RightSidebar/RightSidebar.vue
index 972c52287..435240cd6 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
@@ -265,7 +239,7 @@ export default {
},
showParticipantsTab() {
- return (this.getUserId || this.isModeratorOrUser) && !this.isOneToOne && !this.isNoteToSelf
+ return (this.getUserId || this.isModeratorOrUser) && (!this.isOneToOne || this.isInCall) && !this.isNoteToSelf
},
showSharedItemsTab() {
@@ -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)
- })
})