Fixing dynamic filter modal in client library to include static formula.

This commit is contained in:
mike12345567 2022-01-26 17:49:02 +00:00
parent ff6c81f265
commit 223b5a0e16
1 changed files with 7 additions and 3 deletions

View File

@ -19,10 +19,14 @@
export let schemaFields export let schemaFields
export let filters = [] export let filters = []
const BannedTypes = ["link", "attachment", "formula", "json"] const BannedTypes = ["link", "attachment", "json"]
$: fieldOptions = (schemaFields ?? []) $: fieldOptions = (schemaFields ?? [])
.filter(field => !BannedTypes.includes(field.type)) .filter(
field =>
!BannedTypes.includes(field.type) ||
(field.type === "formula" && field.formulaType === "static")
)
.map(field => field.name) .map(field => field.name)
const addFilter = () => { const addFilter = () => {
@ -114,7 +118,7 @@
on:change={e => onOperatorChange(filter, e.detail)} on:change={e => onOperatorChange(filter, e.detail)}
placeholder={null} placeholder={null}
/> />
{#if ["string", "longform", "number"].includes(filter.type)} {#if ["string", "longform", "number", "formula"].includes(filter.type)}
<Input disabled={filter.noValue} bind:value={filter.value} /> <Input disabled={filter.noValue} bind:value={filter.value} />
{:else if ["options", "array"].includes(filter.type)} {:else if ["options", "array"].includes(filter.type)}
<Combobox <Combobox