fix app sorting

This commit is contained in:
Peter Clement 2023-02-24 09:41:48 +00:00
parent 30d9899bb7
commit 6b7d07c926
1 changed files with 5 additions and 7 deletions

View File

@ -86,15 +86,12 @@
$: userPage = $userPageInfo.page $: userPage = $userPageInfo.page
$: logsPage = $logsPageInfo.page $: logsPage = $logsPageInfo.page
$: enrichedList = enrich($users.data || [], selectedUsers, "_id") $: sortedUsers = sort(enrich($users.data, selectedUsers, "_id"), "email")
$: sortedList = sort(enrichedList, "email")
$: sortedEvents = sort( $: sortedEvents = sort(
enrich(parseEventObject($auditLogs.events), selectedEvents, "id"), enrich(parseEventObject($auditLogs.events), selectedEvents, "id"),
"id" "id"
) )
// below is not sorting yet $: sortedApps = sort(enrich($apps, selectedApps, "appId"), "name")
$: sortedApps = enrich($apps, selectedApps, "appId")
const debounce = value => { const debounce = value => {
clearTimeout(timer) clearTimeout(timer)
@ -164,7 +161,8 @@
return list.map(item => { return list.map(item => {
return { return {
...item, ...item,
selected: selected.find(x => x === item[key]) != null, selected:
selected.find(x => x === item[key] || x.includes(item[key])) != null,
} }
}) })
} }
@ -264,7 +262,7 @@
bind:value={selectedUsers} bind:value={selectedUsers}
getOptionValue={user => user._id} getOptionValue={user => user._id}
getOptionLabel={user => user.email} getOptionLabel={user => user.email}
options={sortedList} options={sortedUsers}
/> />
</div> </div>
<div class="select"> <div class="select">