Skip to content
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Enhancement: Display custom attributes in share autocomplete

When sharing a resource, we're now displaying custom attributes in the autocomplete.
Previously, we were only displaying the user's email address.
What attributes are displayed depends on the server configuration.

https://github.com/owncloud/web/pull/13144
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ interface Props {
const props = defineProps<Props>()

const additionalInfo = computed(() => {
return props.item.mail || props.item.onPremisesSamAccountName
return (
props.item.attributes?.join(' · ') || props.item.mail || props.item.onPremisesSamAccountName
)
})

const externalIssuer = computed(() => {
Expand Down Expand Up @@ -92,5 +94,6 @@ const collaboratorClass = computed(() => {
.files-collaborators-autocomplete-additionalInfo,
.files-collaborators-autocomplete-externalIssuer {
font-size: var(--oc-font-size-small);
white-space: normal;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ describe('AutocompleteItem component', () => {
})
})
describe('additional info', () => {
it('shows the attributes for a user if given', () => {
const attributes = ['foo', 'bar']
const { wrapper } = createWrapper({ shareType: ShareTypes.user.value, attributes })
expect(wrapper.find('.files-collaborators-autocomplete-additionalInfo').text()).toEqual(
attributes.join(' · ')
)
})
it('shows the email for a user if given', () => {
const mail = 'foo@bar.com'
const { wrapper } = createWrapper({ shareType: ShareTypes.user.value, mail })
Expand Down Expand Up @@ -87,12 +94,13 @@ function createWrapper({
id = '',
displayName = '',
mail = '',
onPremisesSamAccountName = ''
onPremisesSamAccountName = '',
attributes = []
}: Partial<CollaboratorAutoCompleteItem>) {
return {
wrapper: shallowMount(AutocompleteItem, {
props: {
item: { shareType, id, displayName, mail, onPremisesSamAccountName }
item: { shareType, id, displayName, mail, onPremisesSamAccountName, attributes }
},
global: {
renderStubDefaultSlot: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ vi.mock('../../../../../../../src/helpers/user/avatarUrl', () => ({
const getRecipient = (shareType: number = ShareTypes.user.value): CollaboratorAutoCompleteItem => ({
displayName: 'Albert Einstein',
id: 'einstein',
shareType
shareType,
attributes: []
})

describe('InviteCollaborator RecipientContainer', () => {
Expand Down
1 change: 1 addition & 0 deletions packages/web-client/src/helpers/share/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,5 @@ export interface CollaboratorAutoCompleteItem {
mail?: string
onPremisesSamAccountName?: string
identities?: ObjectIdentity[]
attributes: string[]
}