Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2021-03-11 12:53:10 +0300
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2021-03-11 14:30:15 +0300
commit31ddfb02946ee9a84d02aab1b01817de2ea83282 (patch)
treeaa1903e974482efbcc18ee3f497d292cef981168 /apps/files_sharing/src
parent7f06a0cf8e58a89c7fa78dd4bf00d76a120039ab (diff)
Fix SharingInput Multiselect
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files_sharing/src')
-rw-r--r--apps/files_sharing/src/components/SharingInput.vue16
-rw-r--r--apps/files_sharing/src/models/Share.js11
2 files changed, 20 insertions, 7 deletions
diff --git a/apps/files_sharing/src/components/SharingInput.vue b/apps/files_sharing/src/components/SharingInput.vue
index e2d6eef03fc..ab079369f73 100644
--- a/apps/files_sharing/src/components/SharingInput.vue
+++ b/apps/files_sharing/src/components/SharingInput.vue
@@ -35,6 +35,8 @@
:searchable="true"
:user-select="true"
open-direction="below"
+ label="displayName"
+ track-by="id"
@search-change="asyncFind"
@select="addShare">
<template #noOptions>
@@ -233,6 +235,7 @@ export default {
const lookupEntry = []
if (data.lookupEnabled && !lookup) {
lookupEntry.push({
+ id: 'global-lookup',
isNoUser: true,
displayName: t('files_sharing', 'Search globally'),
lookup: true,
@@ -404,26 +407,27 @@ export default {
* @returns {Object}
*/
formatForMultiselect(result) {
- let desc
+ let subtitle
if (result.value.shareType === this.SHARE_TYPES.SHARE_TYPE_USER && this.config.shouldAlwaysShowUnique) {
- desc = result.shareWithDisplayNameUnique ?? ''
+ subtitle = result.shareWithDisplayNameUnique ?? ''
} else if ((result.value.shareType === this.SHARE_TYPES.SHARE_TYPE_REMOTE
|| result.value.shareType === this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP
) && result.value.server) {
- desc = t('files_sharing', 'on {server}', { server: result.value.server })
+ subtitle = t('files_sharing', 'on {server}', { server: result.value.server })
} else if (result.value.shareType === this.SHARE_TYPES.SHARE_TYPE_EMAIL) {
- desc = result.value.shareWith
+ subtitle = result.value.shareWith
} else {
- desc = result.shareWithDescription ?? ''
+ subtitle = result.shareWithDescription ?? ''
}
return {
+ id: `${result.value.shareType}-${result.value.shareWith}`,
shareWith: result.value.shareWith,
shareType: result.value.shareType,
user: result.uuid || result.value.shareWith,
isNoUser: result.value.shareType !== this.SHARE_TYPES.SHARE_TYPE_USER,
displayName: result.name || result.label,
- desc,
+ subtitle,
shareWithDisplayNameUnique: result.shareWithDisplayNameUnique || '',
icon: this.shareTypeToIcon(result.value.shareType),
}
diff --git a/apps/files_sharing/src/models/Share.js b/apps/files_sharing/src/models/Share.js
index db9351fb52c..63653d4b6e6 100644
--- a/apps/files_sharing/src/models/Share.js
+++ b/apps/files_sharing/src/models/Share.js
@@ -150,8 +150,17 @@ export default class Share {
|| this.#share.share_with
}
+ /**
+ * Unique display name in case of multiple
+ * duplicates results with the same name.
+ *
+ * @returns {string}
+ * @readonly
+ * @memberof Share
+ */
get shareWithDisplayNameUnique() {
- return this.#share.share_with_displayname_unique || this.#share.share_with
+ return this.#share.share_with_displayname_unique
+ || this.#share.share_with
}
/**