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:
8
client/stores/working_form.js
vendored
8
client/stores/working_form.js
vendored
@@ -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") {
|
||||
|
||||
Reference in New Issue
Block a user