diff options
author | fenn-cs <fenn25.fn@gmail.com> | 2024-02-17 23:27:12 +0100 |
---|---|---|
committer | fenn-cs <fenn25.fn@gmail.com> | 2024-02-29 19:54:55 +0100 |
commit | 29c37af40c7c28ef17da4b9565e8c30fab27fec4 (patch) | |
tree | d245ca8d6a57cc7dedf263d9838ff3fee0ac6c66 /core/src | |
parent | 1e9f438d1af214b708dcc22a785eece54e218db4 (diff) | |
download | nextcloud-server-29c37af40c7c28ef17da4b9565e8c30fab27fec4.tar.gz nextcloud-server-29c37af40c7c28ef17da4b9565e8c30fab27fec4.zip |
feat(files): restore unified search filtering in files view
The unified search emits, search events that other apps can subscribe to and
react however they want to search queries, following
4b55594f55ce4146ed93c50f71e6204a57d29612 and prior updates to migrate the Files
app ui to vue.js that feature was broken.
This commit reintroduces the feature using the current `FileList` implementation.
This commit also adds some logging to an empty exception handler.
Resolve : https://github.com/nextcloud/server/issues/43365
Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/views/UnifiedSearchModal.vue | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/core/src/views/UnifiedSearchModal.vue b/core/src/views/UnifiedSearchModal.vue index 9c719d2bcf6..101859f950f 100644 --- a/core/src/views/UnifiedSearchModal.vue +++ b/core/src/views/UnifiedSearchModal.vue @@ -237,6 +237,14 @@ export default { }, watch: { isVisible(value) { + if (value) { + /* + * Before setting the search UI to visible, reset previous search event emissions. + * This allows apps to restore defaults after "Filter in current view" if the user opens the search interface once more. + * Additionally, it's a new search, so it's better to reset all previous events emitted. + */ + emit('nextcloud:unified-search.reset', { query: '' }) + } this.internalIsVisible = value }, internalIsVisible(value) { @@ -265,9 +273,9 @@ export default { if (query.length === 0) { this.results = [] this.searching = false + emit('nextcloud:unified-search.reset', { query }) return } - // Event should probably be refactored at some point to used nextcloud:unified-search.search emit('nextcloud:unified-search.search', { query }) const newResults = [] const providersToSearch = this.filteredProviders.length > 0 ? this.filteredProviders : this.providers |