diff --git a/src/app/formulaire/definition/form-compute-fixedvar.ts b/src/app/formulaire/definition/form-compute-fixedvar.ts index 110235960ec380ccaf1b78306b885e15e11d1959..9285a6704e1367ad8523b7738120f08ae4924fee 100644 --- a/src/app/formulaire/definition/form-compute-fixedvar.ts +++ b/src/app/formulaire/definition/form-compute-fixedvar.ts @@ -21,12 +21,8 @@ export class FormComputeFixedVar extends FormCompute { const pms = this._formBase.getDisplayedParamListFromState(ParamRadioConfig.LINK); for (const p of pms) - if (p.valueMode === ParamValueMode.LINK) - switch (p.paramDefinition.referencedParamValues.valueMode) { - case ParamValueMode.LISTE: - case ParamValueMode.MINMAX: - return p; - } + if (p.paramDefinition.hasMultipleValues) + return p; return undefined; } diff --git a/src/app/formulaire/definition/form-def-fixedvar.ts b/src/app/formulaire/definition/form-def-fixedvar.ts index 440272effcce1ae43631b1749ccf3906a6c78613..9016a8a3081104112b212f1231f9c5af7f892f47 100644 --- a/src/app/formulaire/definition/form-def-fixedvar.ts +++ b/src/app/formulaire/definition/form-def-fixedvar.ts @@ -80,21 +80,13 @@ export class FormDefFixedVar { break; case ParamValueMode.LINK: // nouvel état - // mode du paramètre référencé - const refParamValues = sourceParam.paramDefinition.referencedParamValues; - switch (refParamValues.valueMode) { - case ParamValueMode.MINMAX: - case ParamValueMode.LISTE: - this.resetOtherRadio(sourceParam, ParamRadioConfig.CAL); - break; - - case ParamValueMode.CALCUL: - if (refParamValues.hasMultipleValues) - this.resetOtherRadio(sourceParam, ParamRadioConfig.CAL); - break; - - case ParamValueMode.LINK: - throw new Error(`références de paramètre en chaîne non pris en charge`); // cas à traiter + if (sourceParam.paramDefinition.hasMultipleValues) + this.resetOtherRadio(sourceParam, ParamRadioConfig.CAL); + else { + const refParamValues = sourceParam.paramDefinition.referencedParamValues; + if (refParamValues !== undefined) // cad si on référence un paramètre et non un Result par ex + if (refParamValues.valueMode == ParamValueMode.LINK) + throw new Error(`références de paramètre en chaîne non pris en charge`); // cas à traiter } break; } diff --git a/src/app/formulaire/definition/form-result-fixedvar.ts b/src/app/formulaire/definition/form-result-fixedvar.ts index 27e04a35368e0ac66fad53183ff74141bf7fcbc5..695bc2059247e2fe753f826ab9bb94ce8cc56f53 100644 --- a/src/app/formulaire/definition/form-result-fixedvar.ts +++ b/src/app/formulaire/definition/form-result-fixedvar.ts @@ -42,7 +42,7 @@ export class FormResultFixedVar extends FormResult { this._fixedResults.addFixedParameter(p); for (const p of this._formBase.getDisplayedParamListFromState(ParamRadioConfig.LINK)) - if (p.paramDefinition.referencedParamValues.valueMode == ParamValueMode.SINGLE) + if (!p.paramDefinition.hasMultipleValues) this._fixedResults.addFixedParameter(p); }