diff --git a/apps/files_sharing/js/dist/files_sharing_tab.js b/apps/files_sharing/js/dist/files_sharing_tab.js index 48ea3f2901adde0b23da5b334914d7bb26c91145..8a89bb21805a105dafb501887ce2d1603369345c 100644 Binary files a/apps/files_sharing/js/dist/files_sharing_tab.js and b/apps/files_sharing/js/dist/files_sharing_tab.js differ diff --git a/apps/files_sharing/js/dist/files_sharing_tab.js.map b/apps/files_sharing/js/dist/files_sharing_tab.js.map index c0e58949c35121ab7bef40a4abeb4bb8af58f62c..c2ce7b904cc04f695864cc4781bde2ab5d47b269 100644 Binary files a/apps/files_sharing/js/dist/files_sharing_tab.js.map and b/apps/files_sharing/js/dist/files_sharing_tab.js.map differ diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index 65de654be92e636834911121bc42848a23e0c561..16b0e8fcc68ddd2863546c99dbd523683bb0f960 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -235,6 +235,9 @@ class ShareAPIController extends OCSController { $sharedWith = $this->userManager->get($share->getSharedWith()); $result['share_with'] = $share->getSharedWith(); $result['share_with_displayname'] = $sharedWith !== null ? $sharedWith->getDisplayName() : $share->getSharedWith(); + $result['share_with_displayname_unique'] = $sharedWith !== null ? ( + $sharedWith->getEMailAddress() !== '' ? $sharedWith->getEMailAddress() : $sharedWith->getUID() + ) : $share->getSharedWith(); $result['status'] = []; $userStatuses = $this->userStatusManager->getUserStatuses([$share->getSharedWith()]); diff --git a/apps/files_sharing/src/components/SharingEntry.vue b/apps/files_sharing/src/components/SharingEntry.vue index 407221037dcb0ee7230bce024a548822195338ad..c66dfc5c802cb85357e5f4896f5b625ec4ff2ef2 100644 --- a/apps/files_sharing/src/components/SharingEntry.vue +++ b/apps/files_sharing/src/components/SharingEntry.vue @@ -33,7 +33,7 @@ :href="share.shareWithLink" v-tooltip.auto="tooltip" class="sharing-entry__desc"> - <h5>{{ title }}</h5> + <h5>{{ title }}<span v-if="!isUnique" class="sharing-entry__desc-unique"> ({{ share.shareWithDisplayNameUnique }})</span></h5> <p v-if="hasStatus"> <span>{{ share.status.icon || '' }}</span> <span>{{ share.status.message || '' }}</span> @@ -402,6 +402,9 @@ export default { p { color: var(--color-text-maxcontrast); } + &-unique { + color: var(--color-text-maxcontrast); + } } &__actions { margin-left: auto; diff --git a/apps/files_sharing/src/components/SharingEntrySimple.vue b/apps/files_sharing/src/components/SharingEntrySimple.vue index 5cdce17bf0c27482a8ee36c4abae0be6803106fa..de545a497a8b37929ade87714a92c5ee659f3d0a 100644 --- a/apps/files_sharing/src/components/SharingEntrySimple.vue +++ b/apps/files_sharing/src/components/SharingEntrySimple.vue @@ -64,6 +64,10 @@ export default { type: String, default: '', }, + isUnique: { + type: Boolean, + default: true, + }, }, } diff --git a/apps/files_sharing/src/components/SharingInput.vue b/apps/files_sharing/src/components/SharingInput.vue index c8373c6c0aee3bd3936975061f5b538f638f0d87..4222a5589e6fcfb300bdd8551e71e7e4ada6d3dd 100644 --- a/apps/files_sharing/src/components/SharingInput.vue +++ b/apps/files_sharing/src/components/SharingInput.vue @@ -241,7 +241,27 @@ export default { // if there is a condition specified, filter it const externalResults = this.externalResults.filter(result => !result.condition || result.condition(this)) - this.suggestions = exactSuggestions.concat(suggestions).concat(externalResults).concat(lookupEntry) + const allSuggestions = exactSuggestions.concat(suggestions).concat(externalResults).concat(lookupEntry) + + // Count occurances of display names in order to provide a distinguishable description if needed + const nameCounts = allSuggestions.reduce((nameCounts, result) => { + if (!result.displayName) { + return nameCounts + } + if (!nameCounts[result.displayName]) { + nameCounts[result.displayName] = 0 + } + nameCounts[result.displayName]++ + return nameCounts + }, {}) + + this.suggestions = allSuggestions.map(item => { + // Make sure that items with duplicate displayName get the shareWith applied as a description + if (nameCounts[item.displayName] > 1 && !item.desc) { + return { ...item, desc: item.shareWithDisplayNameUnique } + } + return item + }) this.loading = false console.info('suggestions', this.suggestions) @@ -398,6 +418,7 @@ export default { isNoUser: result.value.shareType !== this.SHARE_TYPES.SHARE_TYPE_USER, displayName: result.name || result.label, desc, + shareWithDisplayNameUnique: result.shareWithDisplayNameUnique || '', icon: this.shareTypeToIcon(result.value.shareType), } }, diff --git a/apps/files_sharing/src/mixins/SharesMixin.js b/apps/files_sharing/src/mixins/SharesMixin.js index b35ebd8359e579e4e2cf46b4cc3b34b0e624a3fd..aef543a5fc6d60f4dc2f632ab1c7acc17731f1b8 100644 --- a/apps/files_sharing/src/mixins/SharesMixin.js +++ b/apps/files_sharing/src/mixins/SharesMixin.js @@ -42,6 +42,10 @@ export default { type: Share, default: null, }, + isUnique: { + type: Boolean, + default: true, + }, }, data() { diff --git a/apps/files_sharing/src/models/Share.js b/apps/files_sharing/src/models/Share.js index d36484f064ac26d9cd156b23eca84242576957d7..db9351fb52c26b4d793f75b9cd90046d9d96da63 100644 --- a/apps/files_sharing/src/models/Share.js +++ b/apps/files_sharing/src/models/Share.js @@ -150,6 +150,10 @@ export default class Share { || this.#share.share_with } + get shareWithDisplayNameUnique() { + return this.#share.share_with_displayname_unique || this.#share.share_with + } + /** * Get the share with entity link * diff --git a/apps/files_sharing/src/views/SharingList.vue b/apps/files_sharing/src/views/SharingList.vue index b8f12f6ef157b325590e385748b68f0bc5f7b6e6..5c2a21c8bf87ba1be840ef6e8a82666de5f7a9ce 100644 --- a/apps/files_sharing/src/views/SharingList.vue +++ b/apps/files_sharing/src/views/SharingList.vue @@ -26,6 +26,7 @@ :key="share.id" :file-info="fileInfo" :share="share" + :is-unique="isUnique(share)" @remove:share="removeShare" /> </ul> </template> @@ -34,6 +35,7 @@ // eslint-disable-next-line no-unused-vars import Share from '../models/Share' import SharingEntry from '../components/SharingEntry' +import ShareTypes from '../mixins/ShareTypes' export default { name: 'SharingList', @@ -42,6 +44,8 @@ export default { SharingEntry, }, + mixins: [ShareTypes], + props: { fileInfo: { type: Object, @@ -59,6 +63,13 @@ export default { hasShares() { return this.shares.length === 0 }, + isUnique() { + return (share) => { + return [...this.shares].filter((item) => { + return share.type === this.SHARE_TYPES.SHARE_TYPE_USER && share.shareWithDisplayName === item.shareWithDisplayName + }).length <= 1 + } + }, }, methods: { diff --git a/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php b/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php index a2a6ab59809d81bd19c00abde02f9a1b1509c3bf..ff3429ca71c09a66e10780f536256dd3c3293fb9 100644 --- a/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php +++ b/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php @@ -583,6 +583,7 @@ class ShareAPIControllerTest extends TestCase { 'share_type' => IShare::TYPE_USER, 'share_with' => 'userId', 'share_with_displayname' => 'userDisplay', + 'share_with_displayname_unique' => 'userId@example.com', 'uid_owner' => 'initiatorId', 'displayname_owner' => 'initiatorDisplay', 'item_type' => 'file', @@ -782,6 +783,7 @@ class ShareAPIControllerTest extends TestCase { $user = $this->getMockBuilder(IUser::class)->getMock(); $user->method('getUID')->willReturn('userId'); $user->method('getDisplayName')->willReturn('userDisplay'); + $user->method('getEMailAddress')->willReturn('userId@example.com'); $group = $this->getMockBuilder('OCP\IGroup')->getMock(); $group->method('getGID')->willReturn('groupId'); @@ -3440,6 +3442,8 @@ class ShareAPIControllerTest extends TestCase { $initiator->method('getDisplayName')->willReturn('initiatorDN'); $recipient = $this->getMockBuilder(IUser::class)->getMock(); $recipient->method('getDisplayName')->willReturn('recipientDN'); + $recipient->method('getEmailAddress')->willReturn('recipient'); + $result = []; @@ -3479,6 +3483,7 @@ class ShareAPIControllerTest extends TestCase { 'file_target' => 'myTarget', 'share_with' => 'recipient', 'share_with_displayname' => 'recipient', + 'share_with_displayname_unique' => 'recipient', 'note' => 'personal note', 'label' => null, 'mail_send' => 0, @@ -3516,6 +3521,7 @@ class ShareAPIControllerTest extends TestCase { 'file_target' => 'myTarget', 'share_with' => 'recipient', 'share_with_displayname' => 'recipientDN', + 'share_with_displayname_unique' => 'recipient', 'mail_send' => 0, 'mimetype' => 'myMimeType', 'has_preview' => false, @@ -3567,6 +3573,7 @@ class ShareAPIControllerTest extends TestCase { 'file_target' => 'myTarget', 'share_with' => 'recipient', 'share_with_displayname' => 'recipient', + 'share_with_displayname_unique' => 'recipient', 'mail_send' => 0, 'mimetype' => 'myMimeType', 'has_preview' => false, @@ -3614,6 +3621,7 @@ class ShareAPIControllerTest extends TestCase { 'file_target' => 'myTarget', 'share_with' => 'recipient', 'share_with_displayname' => 'recipient', + 'share_with_displayname_unique' => 'recipient', 'mail_send' => 0, 'mimetype' => 'myMimeType', 'has_preview' => false, @@ -4162,6 +4170,7 @@ class ShareAPIControllerTest extends TestCase { 'file_target' => 'myTarget', 'share_with' => 'recipient', 'share_with_displayname' => 'recipient', + 'share_with_displayname_unique' => 'recipient', 'mail_send' => 0, 'mimetype' => 'mimeWithPreview', 'has_preview' => true, diff --git a/lib/private/Collaboration/Collaborators/MailPlugin.php b/lib/private/Collaboration/Collaborators/MailPlugin.php index 90dc59191769cc6de20e82a0b7550cf3285238c1..7bdd29afc4e7e811fb37aa90ea8bde789f408dfd 100644 --- a/lib/private/Collaboration/Collaborators/MailPlugin.php +++ b/lib/private/Collaboration/Collaborators/MailPlugin.php @@ -136,6 +136,8 @@ class MailPlugin implements ISearchPlugin { 'shareType' => IShare::TYPE_USER, 'shareWith' => $cloud->getUser(), ], + 'shareWithDisplayNameUnique' => !empty($emailAddress) ? $emailAddress : $cloud->getUser() + ]]; $searchResult->addResultSet($userType, [], $singleResult); $searchResult->markExactIdMatch($emailType); @@ -170,6 +172,7 @@ class MailPlugin implements ISearchPlugin { 'shareType' => IShare::TYPE_USER, 'shareWith' => $cloud->getUser(), ], + 'shareWithDisplayNameUnique' => !empty($emailAddress) ? $emailAddress : $cloud->getUser() ]; continue; } diff --git a/lib/private/Collaboration/Collaborators/RemotePlugin.php b/lib/private/Collaboration/Collaborators/RemotePlugin.php index af94027fbe930745a520ef9a4022df99ecb5c19d..3d9b1f9847ac88bbf92623773a0db11abc10d146 100644 --- a/lib/private/Collaboration/Collaborators/RemotePlugin.php +++ b/lib/private/Collaboration/Collaborators/RemotePlugin.php @@ -103,7 +103,8 @@ class RemotePlugin implements ISearchPlugin { 'value' => [ 'shareType' => IShare::TYPE_USER, 'shareWith' => $remoteUser - ] + ], + 'shareWithDisplayNameUnique' => $contact['EMAIL'] !== null && $contact['EMAIL'] !== '' ? $contact['EMAIL'] : $contact['UID'], ]; } diff --git a/lib/private/Collaboration/Collaborators/UserPlugin.php b/lib/private/Collaboration/Collaborators/UserPlugin.php index cd4963197aeecf2cd50d99670c46ab876853845a..0b51a29ae25892e2746c1674d8274c5a68f2b2ce 100644 --- a/lib/private/Collaboration/Collaborators/UserPlugin.php +++ b/lib/private/Collaboration/Collaborators/UserPlugin.php @@ -162,6 +162,7 @@ class UserPlugin implements ISearchPlugin { 'shareType' => IShare::TYPE_USER, 'shareWith' => $uid, ], + 'shareWithDisplayNameUnique' => !empty($userEmail) ? $userEmail : $uid, 'status' => $status, ]; } else { @@ -186,6 +187,7 @@ class UserPlugin implements ISearchPlugin { 'shareType' => IShare::TYPE_USER, 'shareWith' => $uid, ], + 'shareWithDisplayNameUnique' => !empty($userEmail) ? $userEmail : $uid, 'status' => $status, ]; } @@ -207,6 +209,8 @@ class UserPlugin implements ISearchPlugin { if ($addUser) { $status = []; + $uid = $user->getUID(); + $userEmail = $user->getEMailAddress(); if (array_key_exists($user->getUID(), $userStatuses)) { $userStatus = $userStatuses[$user->getUID()]; $status = [ @@ -227,6 +231,7 @@ class UserPlugin implements ISearchPlugin { 'shareType' => IShare::TYPE_USER, 'shareWith' => $user->getUID(), ], + 'shareWithDisplayNameUnique' => $userEmail !== null && $userEmail !== '' ? $userEmail : $uid, 'status' => $status, ]; } diff --git a/tests/lib/Collaboration/Collaborators/MailPluginTest.php b/tests/lib/Collaboration/Collaborators/MailPluginTest.php index 8feebfab1c5bbc7928acd517c50cc5e36b835b6d..141d4b680b70a607bf6e0d7fc2892fd7902b5e76 100644 --- a/tests/lib/Collaboration/Collaborators/MailPluginTest.php +++ b/tests/lib/Collaboration/Collaborators/MailPluginTest.php @@ -385,7 +385,7 @@ class MailPluginTest extends TestCase { ] ], false, - ['users' => [], 'exact' => ['users' => [['uuid' => 'uid1', 'name' => 'User', 'label' => 'User (test@example.com)','value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test'],]]]], + ['users' => [], 'exact' => ['users' => [['uuid' => 'uid1', 'name' => 'User', 'label' => 'User (test@example.com)','value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test'], 'shareWithDisplayNameUnique' => 'test@example.com']]]], true, false, ], @@ -443,8 +443,8 @@ class MailPluginTest extends TestCase { ], true, ['users' => [ - ['uuid' => 'uid1', 'name' => 'User1', 'label' => 'User1 (test@example.com)', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test1']], - ['uuid' => 'uid2', 'name' => 'User2', 'label' => 'User2 (test@example.de)', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test2']], + ['uuid' => 'uid1', 'name' => 'User1', 'label' => 'User1 (test@example.com)', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test1'], 'shareWithDisplayNameUnique' => 'test@example.com'], + ['uuid' => 'uid2', 'name' => 'User2', 'label' => 'User2 (test@example.de)', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test2'], 'shareWithDisplayNameUnique' => 'test@example.de'], ], 'emails' => [], 'exact' => ['users' => [], 'emails' => []]], false, true, @@ -603,7 +603,7 @@ class MailPluginTest extends TestCase { 'UID' => 'User' ] ], - ['users' => [['label' => 'User (test@example.com)', 'uuid' => 'User', 'name' => 'User', 'value' => ['shareType' => 0, 'shareWith' => 'test'],]], 'emails' => [], 'exact' => ['emails' => [], 'users' => []]], + ['users' => [['label' => 'User (test@example.com)', 'uuid' => 'User', 'name' => 'User', 'value' => ['shareType' => 0, 'shareWith' => 'test'],'shareWithDisplayNameUnique' => 'test@example.com',]], 'emails' => [], 'exact' => ['emails' => [], 'users' => []]], false, false, [ diff --git a/tests/lib/Collaboration/Collaborators/UserPluginTest.php b/tests/lib/Collaboration/Collaborators/UserPluginTest.php index 6b8861aedd4fcea8607eb4e90790f9125f9a6c77..2806540d00e2b30a0c0f0f634402efa6234b14c0 100644 --- a/tests/lib/Collaboration/Collaborators/UserPluginTest.php +++ b/tests/lib/Collaboration/Collaborators/UserPluginTest.php @@ -151,13 +151,13 @@ class UserPluginTest extends TestCase { [ 'test', false, true, [], [], [ - ['label' => 'Test', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test'], 'icon' => 'icon-user', 'subline' => null, 'status' => []], + ['label' => 'Test', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test'], 'icon' => 'icon-user', 'subline' => null, 'status' => [], 'shareWithDisplayNameUnique' => 'test'], ], [], true, $this->getUserMock('test', 'Test'), ], [ 'test', false, false, [], [], [ - ['label' => 'Test', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test'], 'icon' => 'icon-user', 'subline' => null, 'status' => []], + ['label' => 'Test', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test'], 'icon' => 'icon-user', 'subline' => null, 'status' => [], 'shareWithDisplayNameUnique' => 'test'], ], [], true, $this->getUserMock('test', 'Test'), ], [ @@ -171,13 +171,13 @@ class UserPluginTest extends TestCase { [ 'test', true, true, ['test-group'], [['test-group', 'test', 2, 0, []]], [ - ['label' => 'Test', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test'], 'icon' => 'icon-user', 'subline' => null, 'status' => []], + ['label' => 'Test', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test'], 'icon' => 'icon-user', 'subline' => null, 'status' => [], 'shareWithDisplayNameUnique' => 'test'], ], [], true, $this->getUserMock('test', 'Test'), ], [ 'test', true, false, ['test-group'], [['test-group', 'test', 2, 0, []]], [ - ['label' => 'Test', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test'], 'icon' => 'icon-user', 'subline' => null, 'status' => []], + ['label' => 'Test', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test'], 'icon' => 'icon-user', 'subline' => null, 'status' => [], 'shareWithDisplayNameUnique' => 'test'], ], [], true, $this->getUserMock('test', 'Test'), ], [ @@ -190,7 +190,7 @@ class UserPluginTest extends TestCase { ], [], [ - ['label' => 'Test One', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test1'], 'icon' => 'icon-user', 'subline' => null, 'status' => []], + ['label' => 'Test One', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test1'], 'icon' => 'icon-user', 'subline' => null, 'status' => [], 'shareWithDisplayNameUnique' => 'test1'], ], true, false, @@ -219,8 +219,8 @@ class UserPluginTest extends TestCase { ], [], [ - ['label' => 'Test One', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test1'], 'icon' => 'icon-user', 'subline' => null, 'status' => []], - ['label' => 'Test Two', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test2'], 'icon' => 'icon-user', 'subline' => null, 'status' => []], + ['label' => 'Test One', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test1'], 'icon' => 'icon-user', 'subline' => null, 'status' => [], 'shareWithDisplayNameUnique' => 'test1'], + ['label' => 'Test Two', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test2'], 'icon' => 'icon-user', 'subline' => null, 'status' => [], 'shareWithDisplayNameUnique' => 'test2'], ], false, false, @@ -250,11 +250,11 @@ class UserPluginTest extends TestCase { $this->getUserMock('test2', 'Test Two'), ], [ - ['label' => 'Test', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test0'], 'icon' => 'icon-user', 'subline' => null, 'status' => []], + ['label' => 'Test', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test0'], 'icon' => 'icon-user', 'subline' => null, 'status' => [], 'shareWithDisplayNameUnique' => 'test0'], ], [ - ['label' => 'Test One', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test1'], 'icon' => 'icon-user', 'subline' => null, 'status' => []], - ['label' => 'Test Two', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test2'], 'icon' => 'icon-user', 'subline' => null, 'status' => []], + ['label' => 'Test One', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test1'], 'icon' => 'icon-user', 'subline' => null, 'status' => [], 'shareWithDisplayNameUnique' => 'test1'], + ['label' => 'Test Two', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test2'], 'icon' => 'icon-user', 'subline' => null, 'status' => [], 'shareWithDisplayNameUnique' => 'test2'], ], false, false, @@ -270,7 +270,7 @@ class UserPluginTest extends TestCase { $this->getUserMock('test2', 'Test Two'), ], [ - ['label' => 'Test', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test0'], 'icon' => 'icon-user', 'subline' => null, 'status' => []], + ['label' => 'Test', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test0'], 'icon' => 'icon-user', 'subline' => null, 'status' => [], 'shareWithDisplayNameUnique' => 'test0'], ], [], true, @@ -287,7 +287,7 @@ class UserPluginTest extends TestCase { ], [], [ - ['label' => 'Test One', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test1'], 'icon' => 'icon-user', 'subline' => null, 'status' => []], + ['label' => 'Test One', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test1'], 'icon' => 'icon-user', 'subline' => null, 'status' => [], 'shareWithDisplayNameUnique' => 'test1'], ], true, false, @@ -325,8 +325,8 @@ class UserPluginTest extends TestCase { ], [], [ - ['label' => 'Test One', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test1'], 'icon' => 'icon-user', 'subline' => null, 'status' => []], - ['label' => 'Test Two', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test2'], 'icon' => 'icon-user', 'subline' => null, 'status' => []], + ['label' => 'Test One', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test1'], 'icon' => 'icon-user', 'subline' => null, 'status' => [], 'shareWithDisplayNameUnique' => 'test1'], + ['label' => 'Test Two', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test2'], 'icon' => 'icon-user', 'subline' => null, 'status' => [], 'shareWithDisplayNameUnique' => 'test2'], ], true, false, @@ -373,10 +373,10 @@ class UserPluginTest extends TestCase { ]], ], [ - ['label' => 'Test One', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test'], 'icon' => 'icon-user', 'subline' => null, 'status' => []], + ['label' => 'Test One', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test'], 'icon' => 'icon-user', 'subline' => null, 'status' => [], 'shareWithDisplayNameUnique' => 'test'], ], [ - ['label' => 'Test Two', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test2'], 'icon' => 'icon-user', 'subline' => null, 'status' => []], + ['label' => 'Test Two', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test2'], 'icon' => 'icon-user', 'subline' => null, 'status' => [], 'shareWithDisplayNameUnique' => 'test2'], ], false, false, @@ -399,7 +399,7 @@ class UserPluginTest extends TestCase { ]], ], [ - ['label' => 'Test One', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test'], 'icon' => 'icon-user', 'subline' => null, 'status' => []], + ['label' => 'Test One', 'value' => ['shareType' => IShare::TYPE_USER, 'shareWith' => 'test'], 'icon' => 'icon-user', 'subline' => null, 'status' => [], 'shareWithDisplayNameUnique' => 'test'], ], [], true, @@ -618,10 +618,10 @@ class UserPluginTest extends TestCase { }, $matchingUsers); $mappedResultExact = array_map(function ($user) { - return ['label' => $user, 'value' => ['shareType' => 0, 'shareWith' => $user], 'icon' => 'icon-user', 'subline' => null, 'status' => []]; + return ['label' => $user, 'value' => ['shareType' => 0, 'shareWith' => $user], 'icon' => 'icon-user', 'subline' => null, 'status' => [], 'shareWithDisplayNameUnique' => $user]; }, $result['exact']); $mappedResultWide = array_map(function ($user) { - return ['label' => $user, 'value' => ['shareType' => 0, 'shareWith' => $user], 'icon' => 'icon-user', 'subline' => null, 'status' => []]; + return ['label' => $user, 'value' => ['shareType' => 0, 'shareWith' => $user], 'icon' => 'icon-user', 'subline' => null, 'status' => [], 'shareWithDisplayNameUnique' => $user]; }, $result['wide']); $this->userManager->expects($this->once())