From 7003475cafb6e49939e67a99b763d1cec5421601 Mon Sep 17 00:00:00 2001 From: melohagan <101575380+melohagan@users.noreply.github.com> Date: Mon, 2 Oct 2023 11:42:04 +0100 Subject: [PATCH] Refactor FieldSelector to not use BindableSlot (#11942) --- .../automation/SetupPanel/RowSelector.svelte | 31 +++- .../SetupPanel/RowSelectorTypes.svelte | 152 ++++++++---------- 2 files changed, 92 insertions(+), 91 deletions(-) diff --git a/packages/builder/src/components/automation/SetupPanel/RowSelector.svelte b/packages/builder/src/components/automation/SetupPanel/RowSelector.svelte index 8c50689f22..c3097f3072 100644 --- a/packages/builder/src/components/automation/SetupPanel/RowSelector.svelte +++ b/packages/builder/src/components/automation/SetupPanel/RowSelector.svelte @@ -3,6 +3,8 @@ import { Select, Checkbox } from "@budibase/bbui" import { createEventDispatcher } from "svelte" import RowSelectorTypes from "./RowSelectorTypes.svelte" + import DrawerBindableSlot from "../../common/bindings/DrawerBindableSlot.svelte" + import AutomationBindingPanel from "../../common/bindings/ServerBindingPanel.svelte" const dispatch = createEventDispatcher() @@ -108,14 +110,29 @@
{#each schemaFields as [field, schema]} {#if !schema.autocolumn && schema.type !== "attachment"} - + value={value[field]} + on:change={e => onChange(e, field)} + {bindings} + allowJS={true} + updateOnChange={false} + drawerLeft="260px" + > + + {/if} {#if isUpdateRow && schema.type === "link"}
diff --git a/packages/builder/src/components/automation/SetupPanel/RowSelectorTypes.svelte b/packages/builder/src/components/automation/SetupPanel/RowSelectorTypes.svelte index 9111df0adc..8cf1ecf6de 100644 --- a/packages/builder/src/components/automation/SetupPanel/RowSelectorTypes.svelte +++ b/packages/builder/src/components/automation/SetupPanel/RowSelectorTypes.svelte @@ -8,7 +8,6 @@ } from "@budibase/bbui" import LinkedRowSelector from "components/common/LinkedRowSelector.svelte" import DrawerBindableInput from "../../common/bindings/DrawerBindableInput.svelte" - import DrawerBindableSlot from "../../common/bindings/DrawerBindableSlot.svelte" import ModalBindableInput from "../../common/bindings/ModalBindableInput.svelte" import AutomationBindingPanel from "../../common/bindings/ServerBindingPanel.svelte" import Editor from "components/integration/QueryEditor.svelte" @@ -31,88 +30,73 @@ } - onChange(e, field)} - {bindings} - allowJS={true} - updateOnChange={false} - drawerLeft="260px" -> - {#if schemaHasOptions(schema) && schema.type !== "array"} - onChange(e, field)} + label={field} + value={value[field]} + options={schema.constraints.inclusion} + /> +{:else if schema.type === "datetime"} + onChange(e, field)} + /> +{:else if schema.type === "boolean"} +