Skip to content

Commit

Permalink
feat(LeftSidebar): add fast creating option for federated users
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 Mar 22, 2024
1 parent e4f1608 commit ee5211e
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/components/LeftSidebar/LeftSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,23 @@
</template>
</NcListItem>
</template>

<!-- New conversations: Federated users -->
<template v-if="searchResultsFederated.length !== 0">
<NcAppNavigationCaption :name="t('spreed', 'Federated users')" />
<NcListItem v-for="item of searchResultsFederated"
:key="`circle_${item.id}`"
:data-nav-id="`circle_${item.id}`"
:name="item.label"
@click="createAndJoinConversation(item)">
<template #icon>
<AvatarWrapper v-bind="iconData(item)" />
</template>
<template #subname>
{{ t('spreed', 'New group conversation') }}
</template>
</NcListItem>
</template>
</template>

<!-- Search results: no results (yet) -->
Expand Down Expand Up @@ -328,6 +345,7 @@ import ConversationsListVirtual from './ConversationsList/ConversationsListVirtu
import InvitationHandler from './InvitationHandler.vue'
import OpenConversationsList from './OpenConversationsList/OpenConversationsList.vue'
import SearchBox from './SearchBox/SearchBox.vue'
import AvatarWrapper from '../AvatarWrapper/AvatarWrapper.vue'
import ConversationIcon from '../ConversationIcon.vue'
import Hint from '../Hint.vue'
import NewConversationDialog from '../NewConversationDialog/NewConversationDialog.vue'
Expand Down Expand Up @@ -360,6 +378,7 @@ export default {
name: 'LeftSidebar',

components: {
AvatarWrapper,
CallPhoneDialog,
InvitationHandler,
NcAppNavigation,
Expand Down Expand Up @@ -424,6 +443,7 @@ export default {
searchResultsUsers: [],
searchResultsGroups: [],
searchResultsCircles: [],
searchResultsFederated: [],
searchResultsListedConversations: [],
contactsLoading: false,
listedConversationsLoading: false,
Expand Down Expand Up @@ -714,6 +734,10 @@ export default {
})
this.searchResultsGroups = this.searchResults.filter((match) => match.source === ATTENDEE.ACTOR_TYPE.GROUPS)
this.searchResultsCircles = this.searchResults.filter((match) => match.source === ATTENDEE.ACTOR_TYPE.CIRCLES)
this.searchResultsFederated = this.searchResults.filter((match) => match.source === ATTENDEE.ACTOR_TYPE.REMOTES)
.map((item) => {
return { ...item, source: ATTENDEE.ACTOR_TYPE.FEDERATED_USERS }
})
this.contactsLoading = false
} catch (exception) {
if (CancelableRequest.isCancel(exception)) {
Expand Down Expand Up @@ -978,6 +1002,16 @@ export default {
name: item.id,
}
}
if (item.source === ATTENDEE.ACTOR_TYPE.FEDERATED_USERS) {
return {
id: item.id,
name: item.label,
source: item.source,
disableMenu: true,
token: 'new',
showUserStatus: true,
}
}
return {
type: CONVERSATION.TYPE.GROUP,
objectType: item.source,
Expand Down

0 comments on commit ee5211e

Please sign in to comment.