Filter tables
This commit is contained in:
parent
b908287223
commit
72c415e72c
|
@ -206,7 +206,7 @@
|
|||
</NavItem>
|
||||
|
||||
{#if datasource.open}
|
||||
<TableNavigator sourceId={datasource._id} {selectTable} />
|
||||
<TableNavigator sourceId={datasource._id} {selectTable} {searchTerm} />
|
||||
{#each $queries.list.filter(query => query.datasourceId === datasource._id && (!searchTerm || query.name
|
||||
?.toLowerCase()
|
||||
?.indexOf(searchTerm.toLowerCase()) > -1)) as query}
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
import { goto, isActive } from "@roxi/routify"
|
||||
import { userSelectedResourceMap } from "builderStore"
|
||||
|
||||
export let searchTerm
|
||||
export let sourceId
|
||||
export let selectTable
|
||||
|
||||
|
@ -14,6 +15,11 @@
|
|||
.filter(
|
||||
table => table.sourceId === sourceId && table._id !== TableNames.USERS
|
||||
)
|
||||
.filter(
|
||||
table =>
|
||||
!searchTerm ||
|
||||
table.name.toLowerCase()?.indexOf(searchTerm.toLowerCase()) > -1
|
||||
)
|
||||
.sort(alphabetical)
|
||||
|
||||
const alphabetical = (a, b) => {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script>
|
||||
import { Button, Layout } from "@budibase/bbui"
|
||||
import { Layout } from "@budibase/bbui"
|
||||
import DatasourceNavigator from "components/backend/DatasourceNavigator/DatasourceNavigator.svelte"
|
||||
import Panel from "components/design/Panel.svelte"
|
||||
import { isActive, redirect, goto, params } from "@roxi/routify"
|
||||
|
|
Loading…
Reference in New Issue