Merge pull request #9984 from Budibase/fix/automation-saving-fix

Fix issue with saving of automation fields
This commit is contained in:
Peter Clement 2023-03-14 14:39:24 +00:00 committed by GitHub
commit cc4a911505
3 changed files with 6 additions and 9 deletions

View File

@ -32,7 +32,6 @@
import { getSchemaForTable } from "builderStore/dataBinding"
import { Utils } from "@budibase/frontend-core"
import { TriggerStepID, ActionStepID } from "constants/backend/automations"
import { cloneDeep } from "lodash/fp"
import { onMount } from "svelte"
export let block
@ -63,9 +62,6 @@
const getInputData = (testData, blockInputs) => {
let newInputData = testData || blockInputs
if (block.event === "app:trigger" && !newInputData?.fields) {
newInputData = cloneDeep(blockInputs)
}
inputData = newInputData
}
@ -214,8 +210,6 @@
function saveFilters(key) {
const filters = LuceneUtils.buildLuceneQuery(tempFilters)
const defKey = `${key}-def`
inputData[key] = filters
inputData[defKey] = tempFilters
onChange({ detail: filters }, key)
// need to store the builder definition in the automation
onChange({ detail: tempFilters }, defKey)

View File

@ -95,8 +95,11 @@
}
const onChange = (e, field, type) => {
value[field] = coerce(e.detail, type)
dispatch("change", value)
let newValue = {
...value,
[field]: coerce(e.detail, type),
}
dispatch("change", newValue)
}
const onChangeSetting = (e, field) => {

View File

@ -107,7 +107,7 @@ export function substituteLoopStep(hbsString: string, substitute: string) {
let pointer = 0,
openPointer = 0,
closedPointer = 0
while (pointer < hbsString.length) {
while (pointer < hbsString?.length) {
openPointer = hbsString.indexOf(open, pointer)
closedPointer = hbsString.indexOf(closed, pointer) + 2
if (openPointer < 0 || closedPointer < 0) {