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