diff options
author | nfebe <fenn25.fn@gmail.com> | 2025-01-31 14:45:29 +0100 |
---|---|---|
committer | F. E Noel Nfebe <fenn25.fn@gmail.com> | 2025-02-03 12:48:00 +0100 |
commit | d2fc45acbd0a38c4da7b566fec58ca8fa1428cfe (patch) | |
tree | b033851332513251e0749c40a85943f110b2f7f4 /core/src | |
parent | e9cb6140debb56ce918a42460027b8c727e58d52 (diff) | |
download | nextcloud-server-d2fc45acbd0a38c4da7b566fec58ca8fa1428cfe.tar.gz nextcloud-server-d2fc45acbd0a38c4da7b566fec58ca8fa1428cfe.zip |
fix(unified-search): filteredProviders now inherits all provider props
The main providers come from both the backend and client side plugins such as `in-folder` search.
The main providers may carry callbacks functions and other information that should be passed to the `filteredProviders`.
This is important because the current code does not make a distinction between `filteredProviders` and `providers`
rightly so, becuase they are the same thing!
Without the mentioned distinction above, sooner or later, we try to access a property on the `filteredProviders` which we
did not transfer with the manual property copy.
----
This fix prevents in-folder search from searching everywhere when "load more results" is clicked; Essentially ignoring the in-folder
search filter.
Signed-off-by: nfebe <fenn25.fn@gmail.com>
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/components/UnifiedSearch/UnifiedSearchModal.vue | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/core/src/components/UnifiedSearch/UnifiedSearchModal.vue b/core/src/components/UnifiedSearch/UnifiedSearchModal.vue index 08c3657ce78..74a17694cea 100644 --- a/core/src/components/UnifiedSearch/UnifiedSearchModal.vue +++ b/core/src/components/UnifiedSearch/UnifiedSearchModal.vue @@ -507,6 +507,11 @@ export default defineComponent({ // If load more result for filter, remove other filters this.filters = this.filters.filter(filter => filter.id === provider.id) this.filteredProviders = this.filteredProviders.filter(filteredProvider => filteredProvider.id === provider.id) + // Plugin filters may have extra parameters, so we need to keep them + // See method handlePluginFilter for more details + if (this.filteredProviders.length > 0 && this.filteredProviders[0].isPluginFilter) { + provider = this.filteredProviders[0] + } this.addProviderFilter(provider, true) }, addProviderFilter(providerFilter, loadMoreResultsForProvider = false) { @@ -531,13 +536,8 @@ export default defineComponent({ this.filters = this.syncProviderFilters(this.filters, this.filteredProviders) } this.filteredProviders.push({ - id: providerFilter.id, - appId: providerFilter.appId, - searchFrom: providerFilter.searchFrom, - name: providerFilter.name, - icon: providerFilter.icon, + ...providerFilter, type: providerFilter.type || 'provider', - filters: providerFilter.filters, isPluginFilter: providerFilter.isPluginFilter || false, }) this.filters = this.syncProviderFilters(this.filters, this.filteredProviders) |