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

Fix bug in refreshing fieldsets after compute

parent 2433fe13
No related branches found
No related tags found
No related merge requests found
......@@ -174,7 +174,7 @@ export abstract class FormulaireDefinition extends FormulaireNode implements Obs
}
/** called at the end of parseConfig() */
protected completeParse(json: {}) {
protected completeParse(firstNotif: boolean = true) {
this.helpLinks = this._resultsHelpLinks;
}
......@@ -294,7 +294,7 @@ export abstract class FormulaireDefinition extends FormulaireNode implements Obs
}
}
this.completeParse(this._jsonConfig);
this.completeParse();
}
public hasParameter(symbol: string): boolean {
......
......@@ -125,6 +125,7 @@ export class FormulaireFixedVar extends FormulaireDefinition {
for (const fs of this.allFieldsets) {
fs.updateFields();
}
this.completeParse(false); // re-add observers that were destroyed by updateFields()
}
// interface Observer
......
......@@ -51,9 +51,11 @@ export class FormulaireMacrorugoCompound extends FormulaireRepeatableFieldset {
}
}
protected completeParse(json: {}) {
this.subscribeFieldsetContainer();
this.updateApronState(this.currentNub.properties.getPropValue("inclinedApron"));
protected completeParse(firstNotif: boolean = true) {
this.fieldsetContainer.addObserver(this);
if (firstNotif) {
this.updateApronState(this.currentNub.properties.getPropValue("inclinedApron"));
}
this.helpLinks = this._resultsHelpLinks;
}
......@@ -65,13 +67,6 @@ export class FormulaireMacrorugoCompound extends FormulaireRepeatableFieldset {
return n as FieldsetContainer;
}
/**
* abonnement en tant qu'observateur du FieldsetContainer
*/
private subscribeFieldsetContainer() {
this.fieldsetContainer.addObserver(this);
}
/**
* abonnement en tant qu'observateur des NgParameter des FieldSet contenus dans le FieldsetContainer
*/
......
......@@ -92,7 +92,7 @@ export class FormulaireParallelStructure extends FormulaireRepeatableFieldset {
return newStructure;
}
protected completeParse(json: {}) {
protected completeParse(firstNotif: boolean = true) {
this.subscribeFieldsetContainer();
this.helpLinks = this._resultsHelpLinks;
}
......
......@@ -27,8 +27,8 @@ export class FormulaireSolveur extends FormulaireFixedVar {
this._searchedParamSelectId = this.getOption(json, "searchedParamSelectId");
}
protected completeParse(json: {}, firstNotif: boolean = true) {
super.completeParse(json);
protected completeParse(firstNotif: boolean = true) {
super.completeParse();
if (this._targetNubSelectId) {
const sel = this.getFormulaireNodeById(this._targetNubSelectId);
if (sel) {
......@@ -93,7 +93,7 @@ export class FormulaireSolveur extends FormulaireFixedVar {
if (trSel) {
(trSel.parent as FieldSet).updateFields();
// trick to re-set observers
this.completeParse({}, false);
this.completeParse(false);
}
// refresh parameters selector
this.refreshParameterEntries();
......
......@@ -21,8 +21,8 @@ export class FormulaireVerificateur extends FormulaireFixedVar {
this._speciesListSelectId = this.getOption(json, "speciesListSelectId");
}
protected completeParse(json: {}, firstNotif: boolean = true) {
super.completeParse(json);
protected completeParse(firstNotif: boolean = true) {
super.completeParse();
if (this._targetPassSelectId) {
const sel = this.getFormulaireNodeById(this._targetPassSelectId);
if (sel) {
......
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