From 5f2f01851b25eb5ee53e7e1374ee3c719f52ec6b Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 23 Nov 2021 14:05:20 +0000 Subject: [PATCH] Refactor client and server binding panels into single generic panel. Enable JS for formula fields --- .../DataTable/modals/CreateEditColumn.svelte | 2 +- .../common/bindings/BindingPanel.svelte | 74 ++++-- .../common/bindings/ClientBindingPanel.svelte | 30 +++ .../bindings/DrawerBindableCombobox.svelte | 6 +- .../bindings/DrawerBindableInput.svelte | 6 +- .../common/bindings/ModalBindableInput.svelte | 6 +- .../common/bindings/ServerBindingPanel.svelte | 222 ++---------------- .../FilterEditor/FilterDrawer.svelte | 4 +- 8 files changed, 116 insertions(+), 234 deletions(-) create mode 100644 packages/builder/src/components/common/bindings/ClientBindingPanel.svelte diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte index 841e781cf2..7902212b7e 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte @@ -389,7 +389,7 @@ value={field.formula} on:change={e => (field.formula = e.detail)} bindings={getBindings({ table })} - serverSide="true" + allowJS /> {:else if field.type === AUTO_TYPE} onChange(event.detail)} {placeholder} @@ -55,7 +54,8 @@ value={readableValue} bind:valid on:change={e => (tempValue = e.detail)} - bindableProperties={bindings} + {bindings} + {allowJS} /> diff --git a/packages/builder/src/components/common/bindings/ServerBindingPanel.svelte b/packages/builder/src/components/common/bindings/ServerBindingPanel.svelte index 66b567f343..213e5bbf1d 100644 --- a/packages/builder/src/components/common/bindings/ServerBindingPanel.svelte +++ b/packages/builder/src/components/common/bindings/ServerBindingPanel.svelte @@ -1,209 +1,27 @@ - - -
-
-
Search
- -
- {#each filteredCategories as [categoryName, bindings]} - {#if bindings.length} -
-
{categoryName}
-
    - {#each bindings as binding} -
  • { - value = addHBSBinding(value, getCaretPosition(), binding) - }} - > - {binding.label} - {binding.type} - {#if binding.description} -
    -
    - {binding.description || ""} -
    - {/if} -
  • - {/each} -
-
- {/if} - {/each} - {#if filteredHelpers?.length} -
-
Helpers
-
    - {#each filteredHelpers as helper} -
  • { - value = addHBSBinding(value, getCaretPosition(), helper.text) - }} - > -
    -
    {helper.displayText}
    -
    - {@html helper.description} -
    -
    {helper.example || ''}
    -
    -
  • - {/each} -
-
- {/if} -
-
-
-