remove debouncing of automation input change and replace with on blurr

This commit is contained in:
Peter Clement 2022-04-25 14:51:36 +01:00
parent 365cba2a61
commit 6b7d77088b
4 changed files with 15 additions and 3 deletions

View File

@ -25,7 +25,6 @@
import QueryParamSelector from "./QueryParamSelector.svelte"
import CronBuilder from "./CronBuilder.svelte"
import Editor from "components/integration/QueryEditor.svelte"
import { debounce } from "lodash"
import ModalBindableInput from "components/common/bindings/ModalBindableInput.svelte"
import FilterDrawer from "components/design/PropertiesPanel/PropertyControls/FilterEditor/FilterDrawer.svelte"
import { LuceneUtils } from "@budibase/frontend-core"
@ -54,7 +53,8 @@
$: schema = getSchemaForTable(tableId, { searchableSchema: true }).schema
$: schemaFields = Object.values(schema || {})
const onChange = debounce(async function (e, key) {
const onChange = async (e, key) => {
console.log(e, key)
try {
if (isTestModal) {
// Special case for webhook, as it requires a body, but the schema already brings back the body's contents
@ -82,7 +82,7 @@
} catch (error) {
notifications.error("Error saving automation")
}
}, 800)
}
function getAvailableBindings(block, automation) {
if (!block || !automation) {
@ -205,6 +205,7 @@
on:change={e => onChange(e, key)}
{bindings}
allowJS={false}
updateOnChange={false}
/>
{/if}
{:else if value.customType === "query"}
@ -281,6 +282,7 @@
value={inputData[key]}
on:change={e => onChange(e, key)}
{bindings}
updateOnChange={false}
/>
</div>
{/if}

View File

@ -43,6 +43,11 @@
}
const coerce = (value, type) => {
var re = new RegExp(/{{([^{].*?)}}/g)
if (re.test(value)) {
return value
}
if (type === "boolean") {
if (typeof value === "boolean") {
return value
@ -120,6 +125,7 @@
{bindings}
fillWidth={true}
allowJS={true}
updateOnChange={false}
/>
{/if}
{:else if !rowControl}
@ -137,6 +143,7 @@
{bindings}
fillWidth={true}
allowJS={true}
updateOnChange={false}
/>
{/if}
{/if}

View File

@ -60,5 +60,6 @@
{bindings}
fillWidth={true}
allowJS={true}
updateOnChange={false}
/>
{/if}

View File

@ -17,6 +17,7 @@
export let disabled = false
export let fillWidth
export let allowJS = true
export let updateOnChange = true
const dispatch = createEventDispatcher()
let bindingDrawer
@ -44,6 +45,7 @@
value={isJS ? "(JavaScript function)" : readableValue}
on:change={event => onChange(event.detail)}
{placeholder}
{updateOnChange}
/>
{#if !disabled}
<div class="icon" on:click={bindingDrawer.show}>