aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/files/src/plugins/search/folderSearch.ts5
-rw-r--r--core/src/components/UnifiedSearch/UnifiedSearchModal.vue10
2 files changed, 11 insertions, 4 deletions
diff --git a/apps/files/src/plugins/search/folderSearch.ts b/apps/files/src/plugins/search/folderSearch.ts
index 2b29c7aec4d..4ba7e34a40e 100644
--- a/apps/files/src/plugins/search/folderSearch.ts
+++ b/apps/files/src/plugins/search/folderSearch.ts
@@ -21,7 +21,7 @@ function init() {
logger.info('Initializing unified search plugin: folder search from files app')
OCA.UnifiedSearch.registerFilterAction({
- id: 'files',
+ id: 'in-folder',
appId: 'files',
label: t('files', 'In folder'),
icon: imagePath('files', 'app.svg'),
@@ -35,7 +35,8 @@ function init() {
logger.info('Folder picked', { folder: nodes[0] })
const folder = nodes[0]
emit('nextcloud:unified-search:add-filter', {
- id: 'files',
+ id: 'in-folder',
+ appId: 'files',
payload: folder,
filterUpdateText: t('files', 'Search in folder: {folder}', { folder: folder.basename }),
filterParams: { path: folder.path },
diff --git a/core/src/components/UnifiedSearch/UnifiedSearchModal.vue b/core/src/components/UnifiedSearch/UnifiedSearchModal.vue
index 09d3db52835..d75d54756ac 100644
--- a/core/src/components/UnifiedSearch/UnifiedSearchModal.vue
+++ b/core/src/components/UnifiedSearch/UnifiedSearchModal.vue
@@ -374,7 +374,7 @@ export default defineComponent({
const providersToSearch = this.filteredProviders.length > 0 ? this.filteredProviders : this.providers
const searchProvider = (provider, filters) => {
const params = {
- type: provider.id,
+ type: provider.appId,
query,
cursor: null,
extraQueries: provider.extraParams,
@@ -397,6 +397,7 @@ export default defineComponent({
if (this.providerResultLimit > 5) {
params.limit = this.providerResultLimit
+ unifiedSearchLogger.debug('Limiting search to', params.limit)
}
const request = unifiedSearch(params).request
@@ -404,6 +405,7 @@ export default defineComponent({
request().then((response) => {
newResults.push({
id: provider.id,
+ appId: provider.appId,
provider: provider.name,
inAppSearch: provider.inAppSearch,
results: response.data.ocs.data.entries,
@@ -500,11 +502,13 @@ export default defineComponent({
},
loadMoreResultsForProvider(providerId) {
this.providerResultLimit += 5
- this.filters = this.filters.filter(filter => filter.type !== 'provider')
+ // If user wants more result for a particular filter remove other filters???
+ this.filters = this.filters.filter(filter => filter.id === providerId)
const provider = this.providers.find(provider => provider.id === providerId)
this.addProviderFilter(provider, true)
},
addProviderFilter(providerFilter, loadMoreResultsForProvider = false) {
+ unifiedSearchLogger.debug('Applying provider filter', { providerFilter, loadMoreResultsForProvider })
if (!providerFilter.id) return
if (providerFilter.isPluginFilter) {
providerFilter.callback()
@@ -521,6 +525,7 @@ export default defineComponent({
}
this.filteredProviders.push({
id: providerFilter.id,
+ appId: providerFilter.appId,
name: providerFilter.name,
icon: providerFilter.icon,
type: providerFilter.type || 'provider',
@@ -649,6 +654,7 @@ export default defineComponent({
this.updateDateFilter()
},
handlePluginFilter(addFilterEvent) {
+ unifiedSearchLogger.debug('Handling plugin filter', { addFilterEvent })
for (let i = 0; i < this.filteredProviders.length; i++) {
const provider = this.filteredProviders[i]
if (provider.id === addFilterEvent.id) {