Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable29] fix(RightSidebar): refactor, add 'Participants' to 1-1 calls #12594

Merged
merged 2 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 4 additions & 34 deletions src/components/RightSidebar/RightSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,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>
Expand Down Expand Up @@ -208,10 +207,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
},
Expand All @@ -220,10 +215,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
},
Expand All @@ -232,23 +223,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
Expand Down Expand Up @@ -279,7 +253,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() {
Expand All @@ -301,10 +275,6 @@ export default {

watch: {
conversation(newConversation, oldConversation) {
if (!this.isRenamingConversation) {
this.conversationName = this.conversation.displayName
}

if (newConversation.token === oldConversation.token || !this.showParticipantsTab) {
return
}
Expand Down
32 changes: 0 additions & 32 deletions src/store/sidebarStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,12 @@

const state = {
show: true,
isRenamingConversation: false,
sidebarOpenBeforeEditing: null,

}

const getters = {
getSidebarStatus: (state) => {
return state.show
},
isRenamingConversation: (state) => {
return state.isRenamingConversation
},
}

const mutations = {
Expand All @@ -53,23 +47,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 = {
Expand All @@ -90,15 +67,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 }
35 changes: 0 additions & 35 deletions src/store/sidebarStore.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ describe('sidebarStore', () => {

test('defaults are off', () => {
expect(store.getters.getSidebarStatus).toBe(true)
expect(store.getters.isRenamingConversation).toBe(false)
})

test('toggle sidebar', () => {
Expand All @@ -34,38 +33,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)
})
})
Loading