fix direct mutation of inputdata in rowselector

This commit is contained in:
Peter Clement 2023-03-14 13:57:36 +00:00
parent 6d6a4816a0
commit b854e06b33
2 changed files with 5 additions and 7 deletions

View File

@ -63,9 +63,6 @@
const getInputData = (testData, blockInputs) => { const getInputData = (testData, blockInputs) => {
let newInputData = testData || blockInputs let newInputData = testData || blockInputs
if (block.event === "app:trigger" && !newInputData?.fields) {
newInputData = cloneDeep(blockInputs)
}
inputData = newInputData inputData = newInputData
} }
@ -214,8 +211,6 @@
function saveFilters(key) { function saveFilters(key) {
const filters = LuceneUtils.buildLuceneQuery(tempFilters) const filters = LuceneUtils.buildLuceneQuery(tempFilters)
const defKey = `${key}-def` const defKey = `${key}-def`
inputData[key] = filters
inputData[defKey] = tempFilters
onChange({ detail: filters }, key) onChange({ detail: filters }, key)
// need to store the builder definition in the automation // need to store the builder definition in the automation
onChange({ detail: tempFilters }, defKey) onChange({ detail: tempFilters }, defKey)

View File

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