Explorar el Código

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 hace 6 meses
padre
commit
527c51a18e

+ 4
- 0
core/src/components/UnifiedSearch/SearchableList.vue Ver fichero

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

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

Cargando…
Cancelar
Guardar