Quick fix to allow data UI to show relational fields.
This commit is contained in:
parent
aa9f836572
commit
429d415cc9
|
@ -4,6 +4,7 @@
|
||||||
import FilterBuilder from "components/design/settings/controls/FilterEditor/FilterBuilder.svelte"
|
import FilterBuilder from "components/design/settings/controls/FilterEditor/FilterBuilder.svelte"
|
||||||
import { getUserBindings } from "dataBinding"
|
import { getUserBindings } from "dataBinding"
|
||||||
import { makePropSafe } from "@budibase/string-templates"
|
import { makePropSafe } from "@budibase/string-templates"
|
||||||
|
import { getFields } from "helpers/searchFields"
|
||||||
|
|
||||||
export let schema
|
export let schema
|
||||||
export let filters
|
export let filters
|
||||||
|
@ -15,12 +16,7 @@
|
||||||
let drawer
|
let drawer
|
||||||
|
|
||||||
$: tempValue = filters || []
|
$: tempValue = filters || []
|
||||||
$: schemaFields = Object.entries(schema || {}).map(
|
$: schemaFields = getFields(Object.values(schema || {}), { allowLinks: true })
|
||||||
([fieldName, fieldSchema]) => ({
|
|
||||||
name: fieldName, // Using the key as name if not defined in the schema, for example in some autogenerated columns
|
|
||||||
...fieldSchema,
|
|
||||||
})
|
|
||||||
)
|
|
||||||
|
|
||||||
$: text = getText(filters)
|
$: text = getText(filters)
|
||||||
$: selected = tempValue.filter(x => !x.onEmptyFilter)?.length > 0
|
$: selected = tempValue.filter(x => !x.onEmptyFilter)?.length > 0
|
||||||
|
|
|
@ -4,6 +4,7 @@ import { get } from "svelte/store"
|
||||||
|
|
||||||
export function getTableFields(linkField) {
|
export function getTableFields(linkField) {
|
||||||
const table = get(tables).list.find(table => table._id === linkField.tableId)
|
const table = get(tables).list.find(table => table._id === linkField.tableId)
|
||||||
|
// TODO: mdrury - add support for this with SQS at some point
|
||||||
if (!table || !table.sql) {
|
if (!table || !table.sql) {
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue