Form Editor v2.5 (#599)

* Form Editor v2.5

* Remove log debug

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
This commit is contained in:
Chirag Chhatrala
2024-10-23 14:04:51 +05:30
committed by GitHub
parent 97c4b9db5b
commit 8a1282f4b0
23 changed files with 169 additions and 87 deletions

View File

@@ -73,6 +73,14 @@ export const useWorkingFormStore = defineStore("working_form", {
},
prefillDefault(data) {
// If a field already has this name, we need to make it unique with a number at the end
let baseName = data.name
let counter = 1
while (this.content.properties.some(prop => prop.name === data.name)) {
counter++
data.name = `${baseName} ${counter}`
}
if (data.type === "nf-text") {
data.content = "<p>This is a text block.</p>"
} else if (data.type === "nf-page-break") {