Remove concept of validity from binding panel and allowing saving anything
This commit is contained in:
parent
ca4318f8c2
commit
a806dff3f4
|
@ -9,7 +9,6 @@
|
||||||
} from "@budibase/bbui"
|
} from "@budibase/bbui"
|
||||||
import { createEventDispatcher, getContext, onMount } from "svelte"
|
import { createEventDispatcher, getContext, onMount } from "svelte"
|
||||||
import {
|
import {
|
||||||
isValid,
|
|
||||||
decodeJSBinding,
|
decodeJSBinding,
|
||||||
encodeJSBinding,
|
encodeJSBinding,
|
||||||
processStringSync,
|
processStringSync,
|
||||||
|
@ -35,7 +34,6 @@
|
||||||
|
|
||||||
export let bindings
|
export let bindings
|
||||||
export let value = ""
|
export let value = ""
|
||||||
export let valid
|
|
||||||
export let allowJS = false
|
export let allowJS = false
|
||||||
export let allowHelpers = true
|
export let allowHelpers = true
|
||||||
export let context = null
|
export let context = null
|
||||||
|
@ -134,12 +132,9 @@
|
||||||
|
|
||||||
const updateValue = val => {
|
const updateValue = val => {
|
||||||
const runtimeExpression = readableToRuntimeBinding(enrichedBindings, val)
|
const runtimeExpression = readableToRuntimeBinding(enrichedBindings, val)
|
||||||
valid = isValid(runtimeExpression)
|
|
||||||
if (valid) {
|
|
||||||
dispatch("change", val)
|
dispatch("change", val)
|
||||||
requestUpdateEvaluation(runtimeExpression, context)
|
requestUpdateEvaluation(runtimeExpression, context)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
const onSelectHelper = (helper, js) => {
|
const onSelectHelper = (helper, js) => {
|
||||||
bindingHelpers.onSelectHelper(js ? jsValue : hbsValue, helper, { js })
|
bindingHelpers.onSelectHelper(js ? jsValue : hbsValue, helper, { js })
|
||||||
|
@ -182,10 +177,6 @@
|
||||||
jsValue = encodeJSBinding(e.detail)
|
jsValue = encodeJSBinding(e.detail)
|
||||||
updateValue(jsValue)
|
updateValue(jsValue)
|
||||||
}
|
}
|
||||||
|
|
||||||
onMount(() => {
|
|
||||||
valid = isValid(readableToRuntimeBinding(enrichedBindings, value))
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<DrawerContent padding={false}>
|
<DrawerContent padding={false}>
|
||||||
|
|
Loading…
Reference in New Issue