Browse Source

Fixes for #4736 - I believe the issue was that the dynamic variables were not being saved, removing the need for the user to be aware of this, also making it possible to pass the entire data structure from one call to another if desired.

master
mike12345567 4 years ago
parent
commit
d0f5b67cf1
  1. 4
      packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/_components/DynamicVariableModal.svelte
  2. 1
      packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/rest/[query]/index.svelte
  3. 2
      packages/string-templates/src/helpers/index.js

4
packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/_components/DynamicVariableModal.svelte

@ -1,5 +1,8 @@
<script>
import { Input, ModalContent, Modal, Body } from "@budibase/bbui"
import { createEventDispatcher } from "svelte"
const dispatch = createEventDispatcher()
export let dynamicVariables
export let datasource
@ -35,6 +38,7 @@
name = null
binding = null
dynamicVariables[copiedName] = copiedBinding
dispatch("change", dynamicVariables)
}
</script>

1
packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/rest/[query]/index.svelte

@ -299,6 +299,7 @@
{dynamicVariables}
bind:binding={varBinding}
bind:this={addVariableModal}
on:change={saveQuery}
/>
{#if query && queryConfig}
<div class="inner">

2
packages/string-templates/src/helpers/index.js

@ -25,7 +25,7 @@ const HELPERS = [
if (
value != null &&
typeof value === "object" &&
value.toString() === "[object Object]"
(value.toString() === "[object Object]" || Array.isArray(value))
) {
return new SafeString(JSON.stringify(value))
}

Loading…
Cancel
Save