account for 400 errors in data ui for plus datasources, fix query param selection in automations
This commit is contained in:
parent
f1126a025b
commit
218996d50d
|
@ -1,24 +1,27 @@
|
||||||
<script>
|
<script>
|
||||||
|
import { createEventDispatcher } from "svelte"
|
||||||
import { queries } from "stores/backend"
|
import { queries } from "stores/backend"
|
||||||
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"
|
||||||
|
|
||||||
|
const dispatch = createEventDispatcher()
|
||||||
|
|
||||||
export let value
|
export let value
|
||||||
export let bindings
|
export let bindings
|
||||||
|
|
||||||
$: 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
|
|
||||||
// that the select works
|
|
||||||
$: if (value?.queryId == null) value = { queryId: "" }
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="block-field">
|
<div class="block-field">
|
||||||
<Select
|
<Select
|
||||||
label="Query"
|
label="Query"
|
||||||
bind:value={value.queryId}
|
value={value.queryId}
|
||||||
|
on:change={e => {
|
||||||
|
value = { queryId: e.detail }
|
||||||
|
dispatch("change", value)
|
||||||
|
}}
|
||||||
options={$queries.list}
|
options={$queries.list}
|
||||||
getOptionValue={query => query._id}
|
getOptionValue={query => query._id}
|
||||||
getOptionLabel={query => query.name}
|
getOptionLabel={query => query.name}
|
||||||
|
@ -34,6 +37,7 @@
|
||||||
value={value[field.name]}
|
value={value[field.name]}
|
||||||
on:change={e => {
|
on:change={e => {
|
||||||
value[field.name] = e.detail
|
value[field.name] = e.detail
|
||||||
|
dispatch("change", value)
|
||||||
}}
|
}}
|
||||||
label={field.name}
|
label={field.name}
|
||||||
type="string"
|
type="string"
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="block-field">
|
<div class="block-field">
|
||||||
<Select bind:value secondary extraThin>
|
<Select on:change bind:value secondary extraThin>
|
||||||
<option value="">Choose an option</option>
|
<option value="">Choose an option</option>
|
||||||
{#each $queries.list as query}
|
{#each $queries.list as query}
|
||||||
<option value={query._id}>{query.name}</option>
|
<option value={query._id}>{query.name}</option>
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
message: `${field} ${rowResponse.validationErrors[field][0]}`,
|
message: `${field} ${rowResponse.validationErrors[field][0]}`,
|
||||||
}))
|
}))
|
||||||
return false
|
return false
|
||||||
} else if (rowResponse.status === 500) {
|
} else if (rowResponse.status >= 400) {
|
||||||
errors = [{ message: rowResponse.message }]
|
errors = [{ message: rowResponse.message }]
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue