Skip to content
Open
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
26 changes: 25 additions & 1 deletion src/components/EntityPicker/EntityBubble.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
class="entity-picker__bubble"
:margin="0"
:size="22"
:display-name="label">
:display-name="label"
:user="shareType === ShareType.User ? user : undefined">
<template #name>
<a
href="#"
Expand All @@ -19,6 +20,7 @@
</template>

<script>
import { ShareType } from '@nextcloud/sharing'
import { NcUserBubble as UserBubble } from '@nextcloud/vue'

export default {
Expand Down Expand Up @@ -52,6 +54,28 @@ export default {
type: String,
required: true,
},

/**
* Share type of the entity. e.g user, group, email, remote...
*/
shareType: {
type: Number,
default: undefined,
},

/**
* User identifier (for user-type entities)
*/
user: {
type: String,
default: undefined,
},
},

setup() {
return {
ShareType,
}
},

methods: {
Expand Down
9 changes: 8 additions & 1 deletion src/components/EntityPicker/EntitySearchResult.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
class="entity-picker__bubble"
:class="{ 'entity-picker__bubble--selected': isSelected }"
:display-name="source.label"
:user="source.user"
:user="source.shareType === ShareType.User ? source.user : undefined"
:margin="6"
:size="44"
url="#"
Expand All @@ -25,6 +25,7 @@
</template>

<script>
import { ShareType } from '@nextcloud/sharing'
import { NcUserBubble as UserBubble } from '@nextcloud/vue'

export default {
Expand Down Expand Up @@ -53,6 +54,12 @@ export default {
},
},

setup() {
return {
ShareType,
}
},

computed: {
isSelected() {
return this.source.id in this.selection
Expand Down
27 changes: 14 additions & 13 deletions src/models/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,19 +126,20 @@ export const CIRCLES_MEMBER_GROUPING = [
share: ShareType.Group,
type: MEMBER_TYPE_GROUP,
},
// TODO: implement federated
// {
// id: `picker-${ShareType.Remote}`,
// label: t('contacts', 'federated users'),
// share: ShareType.Remote,
// type: MEMBER_TYPE_USER
// },
// {
// id: `picker-${ShareType.RemoteGroup}`,
// label: t('contacts', 'federated groups'),
// share: ShareType.RemoteGroup,
// type: MEMBER_TYPE_GROUP
// },
{
id: `picker-${ShareType.Remote}`,
label: t('contacts', 'federated users'),
labelStandalone: t('contacts', 'Federated users'),
share: ShareType.Remote,
type: MEMBER_TYPE_USER,
},
{
id: `picker-${ShareType.RemoteGroup}`,
label: t('contacts', 'federated groups'),
labelStandalone: t('contacts', 'Federated groups'),
share: ShareType.RemoteGroup,
type: MEMBER_TYPE_GROUP,
},
{
id: `picker-${ShareType.Team}`,
label: t('contacts', 'teams'),
Expand Down
Loading