Use common search utils to generate field options for design section filter builder

This commit is contained in:
Andrew Kingston 2024-06-24 16:28:25 +01:00
parent 29a5ba5bb3
commit 04a46c43ad
No known key found for this signature in database
1 changed files with 7 additions and 2 deletions

View File

@ -9,7 +9,8 @@
import { createEventDispatcher } from "svelte"
import { getDatasourceForProvider, getSchemaForDatasource } from "dataBinding"
import FilterBuilder from "./FilterBuilder.svelte"
import { selectedScreen } from "stores/builder"
import { tables, selectedScreen } from "stores/builder"
import { search } from "@budibase/frontend-core"
const dispatch = createEventDispatcher()
@ -23,7 +24,11 @@
$: tempValue = value
$: datasource = getDatasourceForProvider($selectedScreen, componentInstance)
$: dsSchema = getSchemaForDatasource($selectedScreen, datasource)?.schema
$: schemaFields = Object.values(schema || dsSchema || {})
$: schemaFields = search.getFields(
$tables.list,
Object.values(schema || dsSchema || {}),
{ allowLinks: true }
)
$: text = getText(value?.filter(filter => filter.field))
async function saveFilter() {