Browse Source

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>
tags/v29.0.0beta1
fenn-cs 6 months ago
parent
commit
527c51a18e

+ 4
- 0
core/src/components/UnifiedSearch/SearchableList.vue View File

@@ -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>

+ 2
- 0
core/src/views/UnifiedSearchModal.vue View File

@@ -56,6 +56,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>
@@ -199,6 +200,7 @@ export default {
results: [],
contacts: [],
debouncedFind: debounce(this.find, 300),
debouncedFilterContacts: debounce(this.filterContacts, 300),
showDateRangeModal: false,
internalIsVisible: false,
}

Loading…
Cancel
Save