Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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 <[email protected]>
  • Loading branch information
nfebe authored and emoral435 committed Dec 26, 2023
commit 44c689ac1ef307ad01780870d3cc2736701c48b3
4 changes: 4 additions & 0 deletions core/src/components/UnifiedSearch/SearchableList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -126,6 +127,9 @@ export default {
this.clearSearch()
this.opened = false
},
searchTermChanged(term) {
this.$emit('search-term-change', term)
},
},
}
</script>
Expand Down
2 changes: 2 additions & 0 deletions core/src/views/UnifiedSearchModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -198,6 +199,7 @@ export default {
results: [],
contacts: [],
debouncedFind: debounce(this.find, 300),
debouncedFilterContacts: debounce(this.filterContacts, 300),
showDateRangeModal: false,
internalIsVisible: false,
}
Expand Down