Add options picker for values when configuring conditions on options columns
This commit is contained in:
parent
d774e30a0a
commit
26a552ac5c
|
@ -10,7 +10,6 @@
|
|||
export let componentBindings
|
||||
export let bindings
|
||||
export let parseSettings
|
||||
export let disabled
|
||||
|
||||
const draggable = getContext("draggable")
|
||||
const dispatch = createEventDispatcher()
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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}
|
||||
|
|
Loading…
Reference in New Issue