Skip to content

Commit

Permalink
fixup! feat(participant): refactor ParticipantsSearchResults
Browse files Browse the repository at this point in the history
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
  • Loading branch information
Antreesy committed Jan 24, 2024
1 parent bb57b58 commit 61f993e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
:contacts-loading="contactsLoading"
:no-results="noResults"
scrollable
selectable
show-search-hints
@click="updateSelectedParticipants"
@click-search-hint="focusInput" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand All @@ -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,
}
},

Expand Down Expand Up @@ -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
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
<Participant v-for="item in items"
:key="generateKey(item)"
:participant="item"
:selectable="selectable"
:show-user-status="showUserStatus"
@click-participant="handleClickParticipant" />
<LoadingPlaceholder v-if="loading" type="participants" :count="dummyParticipants" />
Expand Down Expand Up @@ -56,10 +55,6 @@ export default {
type: Boolean,
default: false,
},
selectable: {
type: Boolean,
default: false,
},
},

emits: ['click'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,24 @@
<template v-if="addableUsers.length !== 0">
<NcAppNavigationCaption :name="t('spreed', 'Add users')" />
<ParticipantsList :items="addableUsers"
:selectable="selectable"
@click="handleClickParticipant" />
</template>

<template v-if="addableGroups.length !== 0">
<NcAppNavigationCaption :name="t('spreed', 'Add groups')" />
<ParticipantsList :items="addableGroups"
:selectable="selectable"
@click="handleClickParticipant" />
</template>

<template v-if="addableEmails.length !== 0">
<NcAppNavigationCaption :name="t('spreed', 'Add emails')" />
<ParticipantsList :items="addableEmails"
:selectable="selectable"
@click="handleClickParticipant" />
</template>

<template v-if="addableCircles.length !== 0">
<NcAppNavigationCaption :name="t('spreed', 'Add circles')" />
<ParticipantsList :items="addableCircles"
:selectable="selectable"
@click="handleClickParticipant" />
</template>

Expand All @@ -69,7 +65,6 @@
<template v-if="addableRemotes.length !== 0">
<NcAppNavigationCaption :name="t('spreed', 'Add federated users')" />
<ParticipantsList :items="addableRemotes"
:selectable="selectable"
@click="handleClickParticipant" />
</template>

Expand Down Expand Up @@ -153,10 +148,6 @@ export default {
type: Boolean,
default: false,
},
selectable: {
type: Boolean,
default: false,
},
showSearchHints: {
type: Boolean,
default: false,
Expand Down

0 comments on commit 61f993e

Please sign in to comment.