Skip to content

Commit

Permalink
Merge pull request #11338 from Budibase/fix/data-query-builder-binding
Browse files Browse the repository at this point in the history
Stop data query binding drawer value from being cleared.
  • Loading branch information
aptkingston authored Jul 25, 2023
2 parents cf4ffaf + 68a12a2 commit 34f47c7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,12 @@
{#if query?.parameters?.length > 0}
<div class="params">
<BindingBuilder
bind:customParams={parameters.queryParams}
customParams={parameters.queryParams}
queryBindings={query.parameters}
bind:bindings
on:change={v => {
parameters.queryParams = { ...v.detail }
}}
/>
<IntegrationQueryEditor
height={200}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,12 @@
}
const openQueryParamsDrawer = () => {
tmpQueryParams = value.queryParams
tmpQueryParams = { ...value.queryParams }
drawer.show()
}
const getQueryValue = queries => {
value = queries.find(q => q._id === value._id) || value
return value
return queries.find(q => q._id === value._id) || value
}
const saveQueryParams = () => {
Expand All @@ -176,7 +175,10 @@
<Layout noPadding gap="XS">
{#if getQueryParams(value).length > 0}
<BindingBuilder
bind:customParams={tmpQueryParams}
customParams={tmpQueryParams}
on:change={v => {
tmpQueryParams = { ...v.detail }
}}
queryBindings={getQueryParams(value)}
bind:bindings
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
runtimeToReadableBinding,
} from "builderStore/dataBinding"
import DrawerBindableInput from "components/common/bindings/DrawerBindableInput.svelte"
import { createEventDispatcher } from "svelte"
const dispatch = createEventDispatcher()
export let bindable = true
export let queryBindings = []
Expand All @@ -20,7 +23,10 @@
// The readable binding in the UI gets converted to a UUID value that the client understands
// for parsing, then converted back so we can display it the readable form in the UI
function onBindingChange(param, valueToParse) {
customParams[param] = readableToRuntimeBinding(bindings, valueToParse)
dispatch("change", {
...customParams,
[param]: readableToRuntimeBinding(bindings, valueToParse),
})
}
</script>

Expand Down

0 comments on commit 34f47c7

Please sign in to comment.