Fix issue where external datasource action wasn't saving it's values
This commit is contained in:
parent
fc2a024b28
commit
5a9bd21237
|
@ -3,22 +3,38 @@
|
||||||
import { Select } from "@budibase/bbui"
|
import { Select } from "@budibase/bbui"
|
||||||
import DrawerBindableInput from "../../common/bindings/DrawerBindableInput.svelte"
|
import DrawerBindableInput from "../../common/bindings/DrawerBindableInput.svelte"
|
||||||
import AutomationBindingPanel from "../../common/bindings/ServerBindingPanel.svelte"
|
import AutomationBindingPanel from "../../common/bindings/ServerBindingPanel.svelte"
|
||||||
|
import { createEventDispatcher } from "svelte"
|
||||||
|
|
||||||
|
const dispatch = createEventDispatcher()
|
||||||
|
|
||||||
export let value
|
export let value
|
||||||
export let bindings
|
export let bindings
|
||||||
|
|
||||||
|
const onChangeQuery = e => {
|
||||||
|
value.queryId = e.detail
|
||||||
|
dispatch("change", value)
|
||||||
|
}
|
||||||
|
|
||||||
|
const onChange = (e, field) => {
|
||||||
|
console.log(field)
|
||||||
|
value[field.name] = e.detail
|
||||||
|
dispatch("change", value)
|
||||||
|
}
|
||||||
|
|
||||||
$: query = $queries.list.find(query => query._id === value?.queryId)
|
$: query = $queries.list.find(query => query._id === value?.queryId)
|
||||||
$: parameters = query?.parameters ?? []
|
$: parameters = query?.parameters ?? []
|
||||||
|
|
||||||
// Ensure any nullish queryId values get set to empty string so
|
// Ensure any nullish queryId values get set to empty string so
|
||||||
// that the select works
|
// that the select works
|
||||||
$: if (value?.queryId == null) value = { queryId: "" }
|
$: if (value?.queryId == null) value = { queryId: "" }
|
||||||
|
$: console.log(value)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="block-field">
|
<div class="block-field">
|
||||||
<Select
|
<Select
|
||||||
label="Query"
|
label="Query"
|
||||||
bind:value={value.queryId}
|
on:change={onChangeQuery}
|
||||||
|
value={value.queryId}
|
||||||
options={$queries.list}
|
options={$queries.list}
|
||||||
getOptionValue={query => query._id}
|
getOptionValue={query => query._id}
|
||||||
getOptionLabel={query => query.name}
|
getOptionLabel={query => query.name}
|
||||||
|
@ -32,9 +48,7 @@
|
||||||
panel={AutomationBindingPanel}
|
panel={AutomationBindingPanel}
|
||||||
extraThin
|
extraThin
|
||||||
value={value[field.name]}
|
value={value[field.name]}
|
||||||
on:change={e => {
|
on:change={e => onChange(e, field)}
|
||||||
value[field.name] = e.detail
|
|
||||||
}}
|
|
||||||
label={field.name}
|
label={field.name}
|
||||||
type="string"
|
type="string"
|
||||||
{bindings}
|
{bindings}
|
||||||
|
|
Loading…
Reference in New Issue