Hide/show app users on search

This commit is contained in:
Adria Navarro 2023-11-10 10:56:15 +01:00
parent 3829797e3c
commit 80874c77c7
1 changed files with 15 additions and 8 deletions

View File

@ -209,18 +209,25 @@
const viewV2Table = options.find(x => x._id === viewsV2.selected?.tableId) const viewV2Table = options.find(x => x._id === viewsV2.selected?.tableId)
return viewV2Table != null return viewV2Table != null
} }
const appUsersTableName = "App users"
$: showAppUsersTable =
!searchTerm ||
appUsersTableName.toLowerCase().indexOf(searchTerm.toLowerCase()) > -1
</script> </script>
{#if $database?._id} {#if $database?._id}
<div class="hierarchy-items-container"> <div class="hierarchy-items-container">
{#if showAppUsersTable}
<NavItem <NavItem
icon="UserGroup" icon="UserGroup"
text="App users" text={appUsersTableName}
selected={$isActive("./table/:tableId") && selected={$isActive("./table/:tableId") &&
$tables.selected?._id === TableNames.USERS} $tables.selected?._id === TableNames.USERS}
on:click={() => selectTable(TableNames.USERS)} on:click={() => selectTable(TableNames.USERS)}
selectedBy={$userSelectedResourceMap[TableNames.USERS]} selectedBy={$userSelectedResourceMap[TableNames.USERS]}
/> />
{/if}
{#each enrichedDataSources.filter(ds => ds.show) as datasource} {#each enrichedDataSources.filter(ds => ds.show) as datasource}
<NavItem <NavItem
border border