1
0
Fork 0
mirror of synced 2024-09-20 11:27:56 +12:00

Add options picker for values when configuring conditions on options columns

This commit is contained in:
Andrew Kingston 2024-07-22 09:35:36 +01:00
parent d774e30a0a
commit 26a552ac5c
No known key found for this signature in database
3 changed files with 18 additions and 7 deletions

View file

@ -10,7 +10,6 @@
export let componentBindings
export let bindings
export let parseSettings
export let disabled
const draggable = getContext("draggable")
const dispatch = createEventDispatcher()

View file

@ -108,12 +108,12 @@ const getColumns = ({
createComponent,
schema
)
const primary = draggableList.find(
entry => entry.field === primaryDisplayColumnName
)
const sortable = draggableList.filter(
entry => entry.field !== primaryDisplayColumnName
)
const primary = draggableList
.filter(entry => entry.field === primaryDisplayColumnName)
.map(instance => ({ ...instance, schema }))[0]
const sortable = draggableList
.filter(entry => entry.field !== primaryDisplayColumnName)
.map(instance => ({ ...instance, schema }))
return {
primary,

View file

@ -8,6 +8,7 @@
Select,
Icon,
DatePicker,
Combobox,
} from "@budibase/bbui"
import { createEventDispatcher } from "svelte"
import { cloneDeep } from "lodash"
@ -18,6 +19,8 @@
import { FieldType, FormulaType } from "@budibase/types"
import { dndzone } from "svelte-dnd-action"
import { flip } from "svelte/animate"
import { getDatasourceForProvider } from "dataBinding"
import { selectedScreen } from "stores/builder"
export let componentInstance
export let bindings
@ -62,6 +65,8 @@
// on the page, so adding this ensures formula columns get operators
formulaType: FormulaType.STATIC,
})
$: datasource = getDatasourceForProvider($selectedScreen, componentInstance)
$: console.log(componentInstance)
const getValueTypeOptions = type => {
let options = [
@ -222,6 +227,13 @@
options={["True", "False"]}
bind:value={condition.referenceValue}
/>
{:else if type === FieldType.OPTIONS && condition.valueType === type}
<Combobox
disabled={condition.noValue}
options={componentInstance.schema?.[componentInstance.field]
?.constraints?.inclusion || []}
bind:value={condition.referenceValue}
/>
{:else}
<DrawerBindableInput
{bindings}