From 61f993e498bdf378293a3f28ddf550141ed602b6 Mon Sep 17 00:00:00 2001 From: Maksim Sukharev Date: Wed, 24 Jan 2024 14:21:19 +0100 Subject: [PATCH] fixup! feat(participant): refactor ParticipantsSearchResults Signed-off-by: Maksim Sukharev --- .../NewConversationContactsPage.vue | 1 - .../NewConversationDialog.vue | 3 +++ .../ParticipantsList/Participant/Participant.vue | 16 ++++++---------- .../ParticipantsList/ParticipantsList.vue | 5 ----- .../ParticipantsSearchResults.vue | 9 --------- 5 files changed, 9 insertions(+), 25 deletions(-) diff --git a/src/components/NewConversationDialog/NewConversationContactsPage.vue b/src/components/NewConversationDialog/NewConversationContactsPage.vue index 413d8aacb08c..2c5dfcb39e22 100644 --- a/src/components/NewConversationDialog/NewConversationContactsPage.vue +++ b/src/components/NewConversationDialog/NewConversationContactsPage.vue @@ -66,7 +66,6 @@ :contacts-loading="contactsLoading" :no-results="noResults" scrollable - selectable show-search-hints @click="updateSelectedParticipants" @click-search-hint="focusInput" /> diff --git a/src/components/NewConversationDialog/NewConversationDialog.vue b/src/components/NewConversationDialog/NewConversationDialog.vue index b0a65515151e..56b750686cb0 100644 --- a/src/components/NewConversationDialog/NewConversationDialog.vue +++ b/src/components/NewConversationDialog/NewConversationDialog.vue @@ -184,6 +184,9 @@ export default { const selectedParticipants = ref([]) provide('selectedParticipants', selectedParticipants) + // Add a visual bulk selection state for Participant component + provide('bulkParticipantsSelection', true) + return { isInCall, selectedParticipants, diff --git a/src/components/RightSidebar/Participants/ParticipantsList/Participant/Participant.vue b/src/components/RightSidebar/Participants/ParticipantsList/Participant/Participant.vue index c665ddcb2fd9..1d5f85b57af8 100644 --- a/src/components/RightSidebar/Participants/ParticipantsList/Participant/Participant.vue +++ b/src/components/RightSidebar/Participants/ParticipantsList/Participant/Participant.vue @@ -397,14 +397,6 @@ export default { type: Boolean, default: true, }, - - /** - * Toggles the bulk selection state of this component - */ - selectable: { - type: Boolean, - default: false, - }, }, emits: ['click-participant'], @@ -413,9 +405,13 @@ export default { const isInCall = useIsInCall() const selectedParticipants = inject('selectedParticipants', []) + // Toggles the bulk selection state of this component + const isSelectable = inject('bulkParticipantsSelection', false) + return { isInCall, - selectedParticipants + selectedParticipants, + isSelectable, } }, @@ -542,7 +538,7 @@ export default { * @return {boolean} */ isSelected() { - return this.selectable + return this.isSelectable ? this.selectedParticipants.some(selected => { return selected.id === this.participant.id && selected.source === this.participant.source }) diff --git a/src/components/RightSidebar/Participants/ParticipantsList/ParticipantsList.vue b/src/components/RightSidebar/Participants/ParticipantsList/ParticipantsList.vue index 20cba3df6602..d764607715d4 100644 --- a/src/components/RightSidebar/Participants/ParticipantsList/ParticipantsList.vue +++ b/src/components/RightSidebar/Participants/ParticipantsList/ParticipantsList.vue @@ -24,7 +24,6 @@ @@ -56,10 +55,6 @@ export default { type: Boolean, default: false, }, - selectable: { - type: Boolean, - default: false, - }, }, emits: ['click'], diff --git a/src/components/RightSidebar/Participants/ParticipantsSearchResults/ParticipantsSearchResults.vue b/src/components/RightSidebar/Participants/ParticipantsSearchResults/ParticipantsSearchResults.vue index 99cc4b853277..1b8199629fc6 100644 --- a/src/components/RightSidebar/Participants/ParticipantsSearchResults/ParticipantsSearchResults.vue +++ b/src/components/RightSidebar/Participants/ParticipantsSearchResults/ParticipantsSearchResults.vue @@ -24,28 +24,24 @@ @@ -69,7 +65,6 @@ @@ -153,10 +148,6 @@ export default { type: Boolean, default: false, }, - selectable: { - type: Boolean, - default: false, - }, showSearchHints: { type: Boolean, default: false,