Remove useFetch

This commit is contained in:
Adria Navarro 2023-09-22 15:50:29 +02:00
parent c814e51e36
commit 160b52c22b
5 changed files with 9 additions and 9 deletions

View File

@ -15,7 +15,6 @@
export let sort = false export let sort = false
export let autoWidth = false export let autoWidth = false
export let searchTerm = null export let searchTerm = null
export let useFetch = false
export let customPopoverHeight export let customPopoverHeight
export let customPopoverOffsetBelow export let customPopoverOffsetBelow
export let customPopoverMaxHeight export let customPopoverMaxHeight
@ -94,7 +93,6 @@
{autocomplete} {autocomplete}
bind:searchTerm bind:searchTerm
bind:open bind:open
{useFetch}
{isOptionSelected} {isOptionSelected}
{getOptionLabel} {getOptionLabel}
{getOptionValue} {getOptionValue}

View File

@ -37,7 +37,6 @@
export let autocomplete = false export let autocomplete = false
export let sort = false export let sort = false
export let searchTerm = null export let searchTerm = null
export let useFetch = false
export let customPopoverHeight export let customPopoverHeight
export let customPopoverOffsetBelow export let customPopoverOffsetBelow
export let customPopoverMaxHeight export let customPopoverMaxHeight
@ -85,7 +84,7 @@
} }
const getFilteredOptions = (options, term, getLabel) => { const getFilteredOptions = (options, term, getLabel) => {
if (autocomplete && term && !useFetch) { if (autocomplete && term) {
const lowerCaseTerm = term.toLowerCase() const lowerCaseTerm = term.toLowerCase()
return options.filter(option => { return options.filter(option => {
return `${getLabel(option)}`.toLowerCase().includes(lowerCaseTerm) return `${getLabel(option)}`.toLowerCase().includes(lowerCaseTerm)

View File

@ -17,7 +17,6 @@
export let autoWidth = false export let autoWidth = false
export let autocomplete = false export let autocomplete = false
export let searchTerm = null export let searchTerm = null
export let useFetch = false
export let customPopoverHeight export let customPopoverHeight
const dispatch = createEventDispatcher() const dispatch = createEventDispatcher()
@ -42,7 +41,6 @@
{autocomplete} {autocomplete}
{customPopoverHeight} {customPopoverHeight}
bind:searchTerm bind:searchTerm
{useFetch}
on:change={onChange} on:change={onChange}
on:click on:click
/> />

View File

@ -86,8 +86,15 @@
$: userPage = $userPageInfo.page $: userPage = $userPageInfo.page
$: logsPage = $logsPageInfo.page $: logsPage = $logsPageInfo.page
$: userList = {
...(userList || {}),
...$users.data?.reduce((p, c) => {
p[c._id] = c
return p
}, {}),
}
$: sortedUsers = sort( $: sortedUsers = sort(
enrich($users.data || [], selectedUsers, "_id"), enrich(Object.values(userList), selectedUsers, "_id"),
"email" "email"
) )
$: sortedEvents = sort( $: sortedEvents = sort(
@ -257,7 +264,6 @@
<div class="select"> <div class="select">
<Multiselect <Multiselect
bind:searchTerm={userSearchTerm} bind:searchTerm={userSearchTerm}
useFetch
placeholder="All users" placeholder="All users"
label="Users" label="Users"
autocomplete autocomplete

View File

@ -152,7 +152,6 @@
getOptionValue={option => option._id} getOptionValue={option => option._id}
{placeholder} {placeholder}
sort sort
useFetch={false}
bind:searchTerm bind:searchTerm
loading={$fetch.loading} loading={$fetch.loading}
/> />