From 78d72b78cb7b5eb539129f67672da3d82f3f22e4 Mon Sep 17 00:00:00 2001 From: Dean Date: Thu, 15 Sep 2022 16:39:25 +0100 Subject: [PATCH 1/2] Fix to include the current user bindings in datasource queries --- packages/bbui/src/Drawer/Drawer.svelte | 2 +- .../builder/src/builderStore/dataBinding.js | 2 +- .../integration/QueryBindingBuilder.svelte | 90 ++++++------------- 3 files changed, 30 insertions(+), 64 deletions(-) diff --git a/packages/bbui/src/Drawer/Drawer.svelte b/packages/bbui/src/Drawer/Drawer.svelte index e1880d0ed4..43729cd794 100644 --- a/packages/bbui/src/Drawer/Drawer.svelte +++ b/packages/bbui/src/Drawer/Drawer.svelte @@ -78,7 +78,7 @@ bottom: 0; background: var(--background); border-top: var(--border-light); - z-index: 2; + z-index: 3; } .fillWidth { diff --git a/packages/builder/src/builderStore/dataBinding.js b/packages/builder/src/builderStore/dataBinding.js index 13b749e19f..ed2c20950b 100644 --- a/packages/builder/src/builderStore/dataBinding.js +++ b/packages/builder/src/builderStore/dataBinding.js @@ -370,7 +370,7 @@ const getProviderContextBindings = (asset, dataProviders) => { /** * Gets all bindable properties from the logged in user. */ -const getUserBindings = () => { +export const getUserBindings = () => { let bindings = [] const { schema } = getSchemaForTable(TableNames.USERS) const keys = Object.keys(schema).sort() diff --git a/packages/builder/src/components/integration/QueryBindingBuilder.svelte b/packages/builder/src/components/integration/QueryBindingBuilder.svelte index 255bee21dd..e7edf94150 100644 --- a/packages/builder/src/components/integration/QueryBindingBuilder.svelte +++ b/packages/builder/src/components/integration/QueryBindingBuilder.svelte @@ -1,31 +1,20 @@ @@ -46,57 +35,34 @@ {/if}
- {#each queryBindings as binding, idx} - - onBindingChange(binding.name, evt.detail)} - bind:value={binding.default} - /> - {#if bindable} - onBindingChange(binding.name, evt.detail)} - value={runtimeToReadableBinding( - bindings, - customParams?.[binding.name] - )} - {bindings} - /> - {:else} - deleteQueryBinding(idx)} /> - {/if} - {/each} + { + queryBindings = e.detail.map(binding => { + return { + name: binding.name, + default: binding.value, + } + }) + }} + />