Skip to content
Snippets Groups Projects
Commit b4c7842b authored by Mathias Chouet's avatar Mathias Chouet Committed by mathias.chouet
Browse files

PreBarrage: add default structure when adding wall

parent 2f9d89b9
No related branches found
No related tags found
1 merge request!93Resolve "Ajout du module Prébarrage"
......@@ -106,7 +106,6 @@ export class FormulairePrebarrage extends FormulaireFixedVar {
wallForm.addObserver(this); // @TODO why not this.form ? wallForm is just a dummy form to extract elements from…
ServiceFactory.instance.formulaireService.loadUpdateFormulaireLocalisation(wallForm);
// add fieldsets for existing Structures
console.log(`Node ${node.uid} : ${node.structures.length} structures, Form ${this.uid} : ${this._kids.length} form elements`);
if (node.structures.length > 0) {
for (const struct of node.structures) {
for (const e of wallForm.allFormElements) {
......@@ -116,8 +115,13 @@ export class FormulairePrebarrage extends FormulaireFixedVar {
}
}
} else {
// if there was no existing structure, add a default one ! @TODO
console.log("TODO add default structure");
// if there was no existing structure, add a default one
for (const e of wallForm.allFormElements) {
if (e instanceof FieldsetContainer) {
e.addFromTemplate(0);
break;
}
}
}
this.showFormElements(wallForm);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment