Fixing an import and fixing a util function which was throwing an error in cypress tests.

This commit is contained in:
Michael Drury 2021-04-30 21:20:37 +01:00
parent 48a0c66972
commit ded7a739fa
2 changed files with 5 additions and 5 deletions

View File

@ -4,7 +4,7 @@
readableToRuntimeBinding,
runtimeToReadableBinding,
} from "builderStore/dataBinding"
import BindingPanel from "components/design/PropertiesPanel/BindingPanel.svelte"
import BindingPanel from "components/common/bindings/BindingPanel.svelte"
import { createEventDispatcher } from "svelte"
const dispatch = createEventDispatcher()

View File

@ -1,16 +1,16 @@
export function addToText(value, caretPos, binding) {
binding = typeof binding === "string" ? binding : binding.path
let toAdd = binding
value = value == null ? "" : value
if (!value.includes("{{") && !value.includes("}}")) {
toAdd = `{{ ${binding} }}`
binding = `{{ ${binding} }}`
}
if (caretPos.start) {
value =
value.substring(0, caretPos.start) +
toAdd +
binding +
value.substring(caretPos.end, value.length)
} else {
value += toAdd
value += binding
}
return value
}