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

Verificateur: make jet type selector's disabled state persist after calculation

parent 7af18d4f
No related branches found
No related tags found
1 merge request!82Resolve "Ajout de la fonctionnalité "Respect des critères""
This commit is part of merge request !82. Comments created here will be created in the context of that merge request.
......@@ -30,9 +30,7 @@ export class FormulaireVerificateur extends FormulaireFixedVar {
if (sender.id === "select_target_pass" && data.action === "select") {
// update Verificateur property: Pass to check
this._currentNub.properties.setPropValue("nubToVerify", data.value ? data.value.value : undefined);
// refresh jet type selector
const ntv = (this._currentNub as Verificateur).nubToVerify;
(this.getFormulaireNodeById("select_pab_jet_type") as SelectField).disabled = ! (ntv !== undefined && ntv.calcType === CalculatorType.Pab);
this.refreshJetTypeSelector();
} else if (sender.id === "select_species_list" && data.action === "select") {
// update Verificateur property: Species list (string[])
......@@ -43,4 +41,18 @@ export class FormulaireVerificateur extends FormulaireFixedVar {
}
}
protected compute() {
this.runNubCalc(this.currentNub);
this.reaffectResultComponents();
// do not refreshFieldsets() (useless here) or jet type selector's disabled state will be reset
}
/**
* Disables Jet Type selector if target pass is not a Pab
*/
protected refreshJetTypeSelector() {
const ntv = (this._currentNub as Verificateur).nubToVerify;
(this.getFormulaireNodeById("select_pab_jet_type") as SelectField).disabled = ! (ntv !== undefined && ntv.calcType === CalculatorType.Pab);
}
}
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