Skip to content

Commit 255662c

Browse files
authored
Merge pull request #3050 from nextcloud/artonge/fix/sharing
fix(Settings): Only list users in transfer ownership
2 parents cc8bbc3 + 0436c4e commit 255662c

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

src/components/SidebarTabs/SharingSearchDiv.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
:placeholder="t('forms', 'Search for user, group or team …')"
1414
:aria-label-listbox="t('forms', 'Search for user, group or team …')"
1515
@search="asyncSearch"
16-
@update:model-value="addShare">
16+
@update:modelValue="addShare">
1717
<template #no-options>
1818
{{ noResultText }}
1919
</template>

src/components/SidebarTabs/TransferOwnership.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@
4444
:loading="loading"
4545
:options="options"
4646
:placeholder="t('forms', 'Search for a user')"
47-
@search="asyncSearch">
47+
@search="
48+
(query) => asyncSearch(query, [SHARE_TYPES.SHARE_TYPE_USER])
49+
">
4850
<template #no-options>
4951
{{ noResultText }}
5052
</template>

src/mixins/UserSearchMixin.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,15 @@ export default {
5858
* Search for suggestions
5959
*
6060
* @param {string} query The search query to search for
61+
* @param {number[]|undefined} shareType The type of recipient to search.
6162
*/
62-
async asyncSearch(query) {
63+
async asyncSearch(query, shareType) {
6364
// save query to check if valid
6465
this.query = query.trim()
6566
if (this.isValidQuery) {
6667
// already set loading to have proper ux feedback during debounce
6768
this.loading = true
68-
this.debounceGetSuggestions(query)
69+
this.debounceGetSuggestions(query, shareType)
6970
}
7071
},
7172

@@ -82,12 +83,13 @@ export default {
8283
* Get suggestions
8384
*
8485
* @param {string} query the search query
86+
* @param {number[]|undefined} shareType The type of recipient to search.
8587
*/
86-
async getSuggestions(query) {
88+
async getSuggestions(query, shareType) {
8789
this.loading = true
8890

8991
// Search for all used share-types, except public link.
90-
const shareType = this.SHARE_TYPES_USED.filter(
92+
shareType ??= this.SHARE_TYPES_USED.filter(
9193
(type) => type !== this.SHARE_TYPES.SHARE_TYPE_LINK,
9294
)
9395

0 commit comments

Comments
 (0)