Skip to content
Snippets Groups Projects
Commit 626ff6cf authored by mathias.chouet's avatar mathias.chouet
Browse files

Fix #367 - set parameter to calc mode when singleValue is undefined

parent db294bd6
No related branches found
No related tags found
No related merge requests found
Pipeline #137770 failed
......@@ -4,7 +4,7 @@ import { I18nService } from "../../services/internationalisation.service";
import { NgParameter, ParamRadioConfig } from "../../formulaire/elements/ngparam";
import { NgParamInputComponent } from "../ngparam-input/ngparam-input.component";
import { ServiceFactory } from "../../services/service-factory";
import { ParamValueMode, ParallelStructure } from "jalhyd";
import { ParamValueMode, ParallelStructure, ParamCalculability } from "jalhyd";
import { FormulaireService } from "../../services/formulaire.service";
import { ParamLinkComponent } from "../param-link/param-link.component";
import { ParamValuesComponent } from "../param-values/param-values.component";
......@@ -220,6 +220,15 @@ export class ParamFieldLineComponent implements OnChanges {
case "cal":
this.param.setCalculated(); // sets mode to CALCUL and more
// did some nasty rascal tick the "create module with empty fields" evil option,
// then chose to set a DICHO param to CALC mode without setting a value first ?
if (
this.param.paramDefinition.calculability === ParamCalculability.DICHO
&& this.param.paramDefinition.singleValue === undefined
) {
// restore dedicated initValue
this.param.paramDefinition.singleValue = this.param.paramDefinition.initValue;
}
break;
case "link":
......
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