Merge pull request #24880 from nextcloud/backport/stable19/23017
This commit is contained in:
commit
0849262c7f
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -226,6 +226,9 @@ class ShareAPIController extends OCSController {
|
||||||
$sharedWith = $this->userManager->get($share->getSharedWith());
|
$sharedWith = $this->userManager->get($share->getSharedWith());
|
||||||
$result['share_with'] = $share->getSharedWith();
|
$result['share_with'] = $share->getSharedWith();
|
||||||
$result['share_with_displayname'] = $sharedWith !== null ? $sharedWith->getDisplayName() : $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();
|
||||||
} elseif ($share->getShareType() === IShare::TYPE_GROUP) {
|
} elseif ($share->getShareType() === IShare::TYPE_GROUP) {
|
||||||
$group = $this->groupManager->get($share->getSharedWith());
|
$group = $this->groupManager->get($share->getSharedWith());
|
||||||
$result['share_with'] = $share->getSharedWith();
|
$result['share_with'] = $share->getSharedWith();
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
:menu-position="'left'"
|
:menu-position="'left'"
|
||||||
:url="share.shareWithAvatar" />
|
:url="share.shareWithAvatar" />
|
||||||
<div v-tooltip.auto="tooltip" class="sharing-entry__desc">
|
<div 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>
|
||||||
</div>
|
</div>
|
||||||
<Actions
|
<Actions
|
||||||
menu-align="right"
|
menu-align="right"
|
||||||
|
@ -384,6 +384,9 @@ export default {
|
||||||
p {
|
p {
|
||||||
color: var(--color-text-maxcontrast);
|
color: var(--color-text-maxcontrast);
|
||||||
}
|
}
|
||||||
|
&-unique {
|
||||||
|
color: var(--color-text-maxcontrast);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
&__actions {
|
&__actions {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
|
|
|
@ -64,6 +64,10 @@ export default {
|
||||||
type: String,
|
type: String,
|
||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
|
isUnique: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -240,7 +240,27 @@ export default {
|
||||||
// if there is a condition specified, filter it
|
// if there is a condition specified, filter it
|
||||||
const externalResults = this.externalResults.filter(result => !result.condition || result.condition(this))
|
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
|
this.loading = false
|
||||||
console.info('suggestions', this.suggestions)
|
console.info('suggestions', this.suggestions)
|
||||||
|
@ -393,6 +413,7 @@ export default {
|
||||||
isNoUser: result.value.shareType !== this.SHARE_TYPES.SHARE_TYPE_USER,
|
isNoUser: result.value.shareType !== this.SHARE_TYPES.SHARE_TYPE_USER,
|
||||||
displayName: result.name || result.label,
|
displayName: result.name || result.label,
|
||||||
desc,
|
desc,
|
||||||
|
shareWithDisplayNameUnique: result.shareWithDisplayNameUnique || '',
|
||||||
icon: this.shareTypeToIcon(result.value.shareType),
|
icon: this.shareTypeToIcon(result.value.shareType),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -42,6 +42,10 @@ export default {
|
||||||
type: Share,
|
type: Share,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
isUnique: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
|
|
|
@ -150,6 +150,10 @@ export default class Share {
|
||||||
|| this.#share.share_with
|
|| this.#share.share_with
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get shareWithDisplayNameUnique() {
|
||||||
|
return this.#share.share_with_displayname_unique || this.#share.share_with
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the share with avatar if any
|
* Get the share with avatar if any
|
||||||
*
|
*
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
:key="share.id"
|
:key="share.id"
|
||||||
:file-info="fileInfo"
|
:file-info="fileInfo"
|
||||||
:share="share"
|
:share="share"
|
||||||
|
:is-unique="isUnique(share)"
|
||||||
@remove:share="removeShare" />
|
@remove:share="removeShare" />
|
||||||
</ul>
|
</ul>
|
||||||
</template>
|
</template>
|
||||||
|
@ -34,6 +35,7 @@
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
import Share from '../models/Share'
|
import Share from '../models/Share'
|
||||||
import SharingEntry from '../components/SharingEntry'
|
import SharingEntry from '../components/SharingEntry'
|
||||||
|
import ShareTypes from '../mixins/ShareTypes'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'SharingList',
|
name: 'SharingList',
|
||||||
|
@ -42,6 +44,8 @@ export default {
|
||||||
SharingEntry,
|
SharingEntry,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
mixins: [ShareTypes],
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
fileInfo: {
|
fileInfo: {
|
||||||
type: Object,
|
type: Object,
|
||||||
|
@ -59,6 +63,13 @@ export default {
|
||||||
hasShares() {
|
hasShares() {
|
||||||
return this.shares.length === 0
|
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: {
|
methods: {
|
||||||
|
|
|
@ -576,6 +576,7 @@ class ShareAPIControllerTest extends TestCase {
|
||||||
'share_type' => \OCP\Share::SHARE_TYPE_USER,
|
'share_type' => \OCP\Share::SHARE_TYPE_USER,
|
||||||
'share_with' => 'userId',
|
'share_with' => 'userId',
|
||||||
'share_with_displayname' => 'userDisplay',
|
'share_with_displayname' => 'userDisplay',
|
||||||
|
'share_with_displayname_unique' => 'userId@example.com',
|
||||||
'uid_owner' => 'initiatorId',
|
'uid_owner' => 'initiatorId',
|
||||||
'displayname_owner' => 'initiatorDisplay',
|
'displayname_owner' => 'initiatorDisplay',
|
||||||
'item_type' => 'file',
|
'item_type' => 'file',
|
||||||
|
@ -773,6 +774,7 @@ class ShareAPIControllerTest extends TestCase {
|
||||||
$user = $this->getMockBuilder(IUser::class)->getMock();
|
$user = $this->getMockBuilder(IUser::class)->getMock();
|
||||||
$user->method('getUID')->willReturn('userId');
|
$user->method('getUID')->willReturn('userId');
|
||||||
$user->method('getDisplayName')->willReturn('userDisplay');
|
$user->method('getDisplayName')->willReturn('userDisplay');
|
||||||
|
$user->method('getEMailAddress')->willReturn('userId@example.com');
|
||||||
|
|
||||||
$group = $this->getMockBuilder('OCP\IGroup')->getMock();
|
$group = $this->getMockBuilder('OCP\IGroup')->getMock();
|
||||||
$group->method('getGID')->willReturn('groupId');
|
$group->method('getGID')->willReturn('groupId');
|
||||||
|
@ -3427,6 +3429,8 @@ class ShareAPIControllerTest extends TestCase {
|
||||||
$initiator->method('getDisplayName')->willReturn('initiatorDN');
|
$initiator->method('getDisplayName')->willReturn('initiatorDN');
|
||||||
$recipient = $this->getMockBuilder(IUser::class)->getMock();
|
$recipient = $this->getMockBuilder(IUser::class)->getMock();
|
||||||
$recipient->method('getDisplayName')->willReturn('recipientDN');
|
$recipient->method('getDisplayName')->willReturn('recipientDN');
|
||||||
|
$recipient->method('getEmailAddress')->willReturn('recipient');
|
||||||
|
|
||||||
|
|
||||||
$result = [];
|
$result = [];
|
||||||
|
|
||||||
|
@ -3466,6 +3470,7 @@ class ShareAPIControllerTest extends TestCase {
|
||||||
'file_target' => 'myTarget',
|
'file_target' => 'myTarget',
|
||||||
'share_with' => 'recipient',
|
'share_with' => 'recipient',
|
||||||
'share_with_displayname' => 'recipient',
|
'share_with_displayname' => 'recipient',
|
||||||
|
'share_with_displayname_unique' => 'recipient',
|
||||||
'note' => 'personal note',
|
'note' => 'personal note',
|
||||||
'label' => null,
|
'label' => null,
|
||||||
'mail_send' => 0,
|
'mail_send' => 0,
|
||||||
|
@ -3502,6 +3507,7 @@ class ShareAPIControllerTest extends TestCase {
|
||||||
'file_target' => 'myTarget',
|
'file_target' => 'myTarget',
|
||||||
'share_with' => 'recipient',
|
'share_with' => 'recipient',
|
||||||
'share_with_displayname' => 'recipientDN',
|
'share_with_displayname' => 'recipientDN',
|
||||||
|
'share_with_displayname_unique' => 'recipient',
|
||||||
'mail_send' => 0,
|
'mail_send' => 0,
|
||||||
'mimetype' => 'myMimeType',
|
'mimetype' => 'myMimeType',
|
||||||
'has_preview' => false,
|
'has_preview' => false,
|
||||||
|
@ -3552,6 +3558,7 @@ class ShareAPIControllerTest extends TestCase {
|
||||||
'file_target' => 'myTarget',
|
'file_target' => 'myTarget',
|
||||||
'share_with' => 'recipient',
|
'share_with' => 'recipient',
|
||||||
'share_with_displayname' => 'recipient',
|
'share_with_displayname' => 'recipient',
|
||||||
|
'share_with_displayname_unique' => 'recipient',
|
||||||
'mail_send' => 0,
|
'mail_send' => 0,
|
||||||
'mimetype' => 'myMimeType',
|
'mimetype' => 'myMimeType',
|
||||||
'has_preview' => false,
|
'has_preview' => false,
|
||||||
|
@ -3598,6 +3605,7 @@ class ShareAPIControllerTest extends TestCase {
|
||||||
'file_target' => 'myTarget',
|
'file_target' => 'myTarget',
|
||||||
'share_with' => 'recipient',
|
'share_with' => 'recipient',
|
||||||
'share_with_displayname' => 'recipient',
|
'share_with_displayname' => 'recipient',
|
||||||
|
'share_with_displayname_unique' => 'recipient',
|
||||||
'mail_send' => 0,
|
'mail_send' => 0,
|
||||||
'mimetype' => 'myMimeType',
|
'mimetype' => 'myMimeType',
|
||||||
'has_preview' => false,
|
'has_preview' => false,
|
||||||
|
@ -4145,6 +4153,7 @@ class ShareAPIControllerTest extends TestCase {
|
||||||
'file_target' => 'myTarget',
|
'file_target' => 'myTarget',
|
||||||
'share_with' => 'recipient',
|
'share_with' => 'recipient',
|
||||||
'share_with_displayname' => 'recipient',
|
'share_with_displayname' => 'recipient',
|
||||||
|
'share_with_displayname_unique' => 'recipient',
|
||||||
'mail_send' => 0,
|
'mail_send' => 0,
|
||||||
'mimetype' => 'mimeWithPreview',
|
'mimetype' => 'mimeWithPreview',
|
||||||
'has_preview' => true,
|
'has_preview' => true,
|
||||||
|
|
|
@ -136,6 +136,8 @@ class MailPlugin implements ISearchPlugin {
|
||||||
'shareType' => Share::SHARE_TYPE_USER,
|
'shareType' => Share::SHARE_TYPE_USER,
|
||||||
'shareWith' => $cloud->getUser(),
|
'shareWith' => $cloud->getUser(),
|
||||||
],
|
],
|
||||||
|
'shareWithDisplayNameUnique' => !empty($emailAddress) ? $emailAddress : $cloud->getUser()
|
||||||
|
|
||||||
]];
|
]];
|
||||||
$searchResult->addResultSet($userType, [], $singleResult);
|
$searchResult->addResultSet($userType, [], $singleResult);
|
||||||
$searchResult->markExactIdMatch($emailType);
|
$searchResult->markExactIdMatch($emailType);
|
||||||
|
@ -170,6 +172,7 @@ class MailPlugin implements ISearchPlugin {
|
||||||
'shareType' => Share::SHARE_TYPE_USER,
|
'shareType' => Share::SHARE_TYPE_USER,
|
||||||
'shareWith' => $cloud->getUser(),
|
'shareWith' => $cloud->getUser(),
|
||||||
],
|
],
|
||||||
|
'shareWithDisplayNameUnique' => !empty($emailAddress) ? $emailAddress : $cloud->getUser()
|
||||||
];
|
];
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,7 +103,8 @@ class RemotePlugin implements ISearchPlugin {
|
||||||
'value' => [
|
'value' => [
|
||||||
'shareType' => Share::SHARE_TYPE_USER,
|
'shareType' => Share::SHARE_TYPE_USER,
|
||||||
'shareWith' => $remoteUser
|
'shareWith' => $remoteUser
|
||||||
]
|
],
|
||||||
|
'shareWithDisplayNameUnique' => $contact['EMAIL'] !== null && $contact['EMAIL'] !== '' ? $contact['EMAIL'] : $contact['UID'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -126,6 +126,7 @@ class UserPlugin implements ISearchPlugin {
|
||||||
'shareType' => Share::SHARE_TYPE_USER,
|
'shareType' => Share::SHARE_TYPE_USER,
|
||||||
'shareWith' => $uid,
|
'shareWith' => $uid,
|
||||||
],
|
],
|
||||||
|
'shareWithDisplayNameUnique' => !empty($userEmail) ? $userEmail : $uid,
|
||||||
];
|
];
|
||||||
} else {
|
} else {
|
||||||
$addToWideResults = false;
|
$addToWideResults = false;
|
||||||
|
@ -147,6 +148,7 @@ class UserPlugin implements ISearchPlugin {
|
||||||
'shareType' => IShare::TYPE_USER,
|
'shareType' => IShare::TYPE_USER,
|
||||||
'shareWith' => $uid,
|
'shareWith' => $uid,
|
||||||
],
|
],
|
||||||
|
'shareWithDisplayNameUnique' => !empty($userEmail) ? $userEmail : $uid,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -166,12 +168,15 @@ class UserPlugin implements ISearchPlugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($addUser) {
|
if ($addUser) {
|
||||||
|
$uid = $user->getUID();
|
||||||
|
$userEmail = $user->getEMailAddress();
|
||||||
$result['exact'][] = [
|
$result['exact'][] = [
|
||||||
'label' => $user->getDisplayName(),
|
'label' => $user->getDisplayName(),
|
||||||
'value' => [
|
'value' => [
|
||||||
'shareType' => Share::SHARE_TYPE_USER,
|
'shareType' => Share::SHARE_TYPE_USER,
|
||||||
'shareWith' => $user->getUID(),
|
'shareWith' => $user->getUID(),
|
||||||
],
|
],
|
||||||
|
'shareWithDisplayNameUnique' => $userEmail !== null && $userEmail !== '' ? $userEmail : $uid,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -385,7 +385,7 @@ class MailPluginTest extends TestCase {
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
false,
|
false,
|
||||||
['users' => [], 'exact' => ['users' => [['uuid' => 'uid1', 'name' => 'User', 'label' => 'User (test@example.com)','value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test'],]]]],
|
['users' => [], 'exact' => ['users' => [['uuid' => 'uid1', 'name' => 'User', 'label' => 'User (test@example.com)','value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test'], 'shareWithDisplayNameUnique' => 'test@example.com']]]],
|
||||||
true,
|
true,
|
||||||
false,
|
false,
|
||||||
],
|
],
|
||||||
|
@ -443,8 +443,8 @@ class MailPluginTest extends TestCase {
|
||||||
],
|
],
|
||||||
true,
|
true,
|
||||||
['users' => [
|
['users' => [
|
||||||
['uuid' => 'uid1', 'name' => 'User1', 'label' => 'User1 (test@example.com)', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test1']],
|
['uuid' => 'uid1', 'name' => 'User1', 'label' => 'User1 (test@example.com)', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test1'], 'shareWithDisplayNameUnique' => 'test@example.com'],
|
||||||
['uuid' => 'uid2', 'name' => 'User2', 'label' => 'User2 (test@example.de)', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test2']],
|
['uuid' => 'uid2', 'name' => 'User2', 'label' => 'User2 (test@example.de)', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test2'], 'shareWithDisplayNameUnique' => 'test@example.de'],
|
||||||
], 'emails' => [], 'exact' => ['users' => [], 'emails' => []]],
|
], 'emails' => [], 'exact' => ['users' => [], 'emails' => []]],
|
||||||
false,
|
false,
|
||||||
true,
|
true,
|
||||||
|
@ -603,7 +603,7 @@ class MailPluginTest extends TestCase {
|
||||||
'UID' => 'User'
|
'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,
|
||||||
false,
|
false,
|
||||||
[
|
[
|
||||||
|
|
|
@ -144,13 +144,13 @@ class UserPluginTest extends TestCase {
|
||||||
[
|
[
|
||||||
'test', false, true, [], [],
|
'test', false, true, [], [],
|
||||||
[
|
[
|
||||||
['label' => 'Test', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test']],
|
['label' => 'Test', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test'], 'shareWithDisplayNameUnique' => 'test'],
|
||||||
], [], true, $this->getUserMock('test', 'Test'),
|
], [], true, $this->getUserMock('test', 'Test'),
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'test', false, false, [], [],
|
'test', false, false, [], [],
|
||||||
[
|
[
|
||||||
['label' => 'Test', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test']],
|
['label' => 'Test', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test'], 'shareWithDisplayNameUnique' => 'test'],
|
||||||
], [], true, $this->getUserMock('test', 'Test'),
|
], [], true, $this->getUserMock('test', 'Test'),
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
@ -164,13 +164,13 @@ class UserPluginTest extends TestCase {
|
||||||
[
|
[
|
||||||
'test', true, true, ['test-group'], [['test-group', 'test', 2, 0, []]],
|
'test', true, true, ['test-group'], [['test-group', 'test', 2, 0, []]],
|
||||||
[
|
[
|
||||||
['label' => 'Test', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test']],
|
['label' => 'Test', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test'], 'shareWithDisplayNameUnique' => 'test'],
|
||||||
], [], true, $this->getUserMock('test', 'Test'),
|
], [], true, $this->getUserMock('test', 'Test'),
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'test', true, false, ['test-group'], [['test-group', 'test', 2, 0, []]],
|
'test', true, false, ['test-group'], [['test-group', 'test', 2, 0, []]],
|
||||||
[
|
[
|
||||||
['label' => 'Test', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test']],
|
['label' => 'Test', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test'], 'shareWithDisplayNameUnique' => 'test'],
|
||||||
], [], true, $this->getUserMock('test', 'Test'),
|
], [], true, $this->getUserMock('test', 'Test'),
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
@ -183,7 +183,7 @@ class UserPluginTest extends TestCase {
|
||||||
],
|
],
|
||||||
[],
|
[],
|
||||||
[
|
[
|
||||||
['label' => 'Test One', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test1']],
|
['label' => 'Test One', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test1'], 'shareWithDisplayNameUnique' => 'test1'],
|
||||||
],
|
],
|
||||||
true,
|
true,
|
||||||
false,
|
false,
|
||||||
|
@ -212,8 +212,8 @@ class UserPluginTest extends TestCase {
|
||||||
],
|
],
|
||||||
[],
|
[],
|
||||||
[
|
[
|
||||||
['label' => 'Test One', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test1']],
|
['label' => 'Test One', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test1'], 'shareWithDisplayNameUnique' => 'test1'],
|
||||||
['label' => 'Test Two', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test2']],
|
['label' => 'Test Two', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test2'], 'shareWithDisplayNameUnique' => 'test2'],
|
||||||
],
|
],
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
|
@ -243,11 +243,11 @@ class UserPluginTest extends TestCase {
|
||||||
$this->getUserMock('test2', 'Test Two'),
|
$this->getUserMock('test2', 'Test Two'),
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
['label' => 'Test', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test0']],
|
['label' => 'Test', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test0'], 'shareWithDisplayNameUnique' => 'test0'],
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
['label' => 'Test One', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test1']],
|
['label' => 'Test One', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test1'], 'shareWithDisplayNameUnique' => 'test1'],
|
||||||
['label' => 'Test Two', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test2']],
|
['label' => 'Test Two', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test2'], 'shareWithDisplayNameUnique' => 'test2'],
|
||||||
],
|
],
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
|
@ -263,7 +263,7 @@ class UserPluginTest extends TestCase {
|
||||||
$this->getUserMock('test2', 'Test Two'),
|
$this->getUserMock('test2', 'Test Two'),
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
['label' => 'Test', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test0']],
|
['label' => 'Test', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test0'], 'shareWithDisplayNameUnique' => 'test0'],
|
||||||
],
|
],
|
||||||
[],
|
[],
|
||||||
true,
|
true,
|
||||||
|
@ -280,7 +280,7 @@ class UserPluginTest extends TestCase {
|
||||||
],
|
],
|
||||||
[],
|
[],
|
||||||
[
|
[
|
||||||
['label' => 'Test One', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test1']],
|
['label' => 'Test One', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test1'], 'shareWithDisplayNameUnique' => 'test1'],
|
||||||
],
|
],
|
||||||
true,
|
true,
|
||||||
false,
|
false,
|
||||||
|
@ -318,8 +318,8 @@ class UserPluginTest extends TestCase {
|
||||||
],
|
],
|
||||||
[],
|
[],
|
||||||
[
|
[
|
||||||
['label' => 'Test One', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test1']],
|
['label' => 'Test One', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test1'], 'shareWithDisplayNameUnique' => 'test1'],
|
||||||
['label' => 'Test Two', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test2']],
|
['label' => 'Test Two', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test2'], 'shareWithDisplayNameUnique' => 'test2'],
|
||||||
],
|
],
|
||||||
true,
|
true,
|
||||||
false,
|
false,
|
||||||
|
@ -366,10 +366,10 @@ class UserPluginTest extends TestCase {
|
||||||
]],
|
]],
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
['label' => 'Test One', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test']],
|
['label' => 'Test One', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test'], 'shareWithDisplayNameUnique' => 'test'],
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
['label' => 'Test Two', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test2']],
|
['label' => 'Test Two', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test2'], 'shareWithDisplayNameUnique' => 'test2'],
|
||||||
],
|
],
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
|
@ -392,7 +392,7 @@ class UserPluginTest extends TestCase {
|
||||||
]],
|
]],
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
['label' => 'Test One', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test']],
|
['label' => 'Test One', 'value' => ['shareType' => Share::SHARE_TYPE_USER, 'shareWith' => 'test'], 'shareWithDisplayNameUnique' => 'test'],
|
||||||
],
|
],
|
||||||
[],
|
[],
|
||||||
true,
|
true,
|
||||||
|
@ -611,10 +611,10 @@ class UserPluginTest extends TestCase {
|
||||||
}, $matchingUsers);
|
}, $matchingUsers);
|
||||||
|
|
||||||
$mappedResultExact = array_map(function ($user) {
|
$mappedResultExact = array_map(function ($user) {
|
||||||
return ['label' => $user, 'value' => ['shareType' => 0, 'shareWith' => $user]];
|
return ['label' => $user, 'value' => ['shareType' => 0, 'shareWith' => $user], 'shareWithDisplayNameUnique' => $user];
|
||||||
}, $result['exact']);
|
}, $result['exact']);
|
||||||
$mappedResultWide = array_map(function ($user) {
|
$mappedResultWide = array_map(function ($user) {
|
||||||
return ['label' => $user, 'value' => ['shareType' => 0, 'shareWith' => $user]];
|
return ['label' => $user, 'value' => ['shareType' => 0, 'shareWith' => $user], 'shareWithDisplayNameUnique' => $user];
|
||||||
}, $result['wide']);
|
}, $result['wide']);
|
||||||
|
|
||||||
$this->userManager->expects($this->once())
|
$this->userManager->expects($this->once())
|
||||||
|
|
Loading…
Reference in New Issue