From eecda06f1ad2832cc2a7b31d646458f730c8412a Mon Sep 17 00:00:00 2001 From: nfebe Date: Sat, 11 Jan 2025 00:07:19 +0100 Subject: fix(unified-search): Use appId for searching Each provider may search from a particular app so we should use that for searching. Before this commit, we used `provider.id` instead of `provider.appId` the problem with the previous approach is that it forces the provider id to be a valid search provider (an app that supports search) limiting the developers ability to use unique IDs to identify the different providers (especially plugin providers) inside the places filter. For example the Files search plugin "In folder" (search in folder plugin) was required to have id as `files` while the files provider itself already has id as `files`. Signed-off-by: nfebe --- apps/files/src/plugins/search/folderSearch.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'apps/files/src') 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 }, -- cgit v1.2.3