aboutsummaryrefslogtreecommitdiffstats
path: root/core/src
diff options
context:
space:
mode:
authorfenn-cs <fenn25.fn@gmail.com>2023-12-11 22:43:53 +0100
committerEduardo Morales <emoral435@gmail.com>2023-12-26 11:19:25 -0600
commit44c689ac1ef307ad01780870d3cc2736701c48b3 (patch)
treef5798fa0d177a1a5ed648b4a216c140109f87c94 /core/src
parent593a2349c1683898239f07c073b9d43787cf8e2d (diff)
downloadnextcloud-server-44c689ac1ef307ad01780870d3cc2736701c48b3.tar.gz
nextcloud-server-44c689ac1ef307ad01780870d3cc2736701c48b3.zip
Unified search: update people select with API calls
On change/input from user which has the effect of filtering, we want to send the query to the API to obtained fresh results, based on the databased on not just preloaded contacts. Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
Diffstat (limited to 'core/src')
-rw-r--r--core/src/components/UnifiedSearch/SearchableList.vue4
-rw-r--r--core/src/views/UnifiedSearchModal.vue2
2 files changed, 6 insertions, 0 deletions
diff --git a/core/src/components/UnifiedSearch/SearchableList.vue b/core/src/components/UnifiedSearch/SearchableList.vue
index 43f7ace1b64..33f45d06266 100644
--- a/core/src/components/UnifiedSearch/SearchableList.vue
+++ b/core/src/components/UnifiedSearch/SearchableList.vue
@@ -32,6 +32,7 @@
:label="labelText"
trailing-button-icon="close"
:show-trailing-button="searchTerm !== ''"
+ @update:value="searchTermChanged"
@trailing-button-click="clearSearch">
<Magnify :size="20" />
</NcTextField>
@@ -126,6 +127,9 @@ export default {
this.clearSearch()
this.opened = false
},
+ searchTermChanged(term) {
+ this.$emit('search-term-change', term)
+ },
},
}
</script>
diff --git a/core/src/views/UnifiedSearchModal.vue b/core/src/views/UnifiedSearchModal.vue
index 7ea8381d954..76a4486d021 100644
--- a/core/src/views/UnifiedSearchModal.vue
+++ b/core/src/views/UnifiedSearchModal.vue
@@ -55,6 +55,7 @@
<SearchableList :label-text="t('core', 'Search people')"
:search-list="userContacts"
:empty-content-text="t('core', 'Not found')"
+ @search-term-change="debouncedFilterContacts"
@item-selected="applyPersonFilter">
<template #trigger>
<NcButton>
@@ -198,6 +199,7 @@ export default {
results: [],
contacts: [],
debouncedFind: debounce(this.find, 300),
+ debouncedFilterContacts: debounce(this.filterContacts, 300),
showDateRangeModal: false,
internalIsVisible: false,
}