From 75f48e7218010d9fa813ce1446a4fa7d1f4da349 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Grand?= <francois.grand@inrae.fr>
Date: Mon, 20 Mar 2023 11:08:59 +0100
Subject: [PATCH] refactor: MacroRugoRemous: use property name constant

refs #609
---
 src/app/components/generic-calculator/calculator.component.ts | 2 +-
 src/app/formulaire/elements/select/select-field-target-pam.ts | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/app/components/generic-calculator/calculator.component.ts b/src/app/components/generic-calculator/calculator.component.ts
index 68aea17bc..499b77cc1 100644
--- a/src/app/components/generic-calculator/calculator.component.ts
+++ b/src/app/components/generic-calculator/calculator.component.ts
@@ -1268,7 +1268,7 @@ export class GenericCalculatorComponent implements OnInit, DoCheck, AfterViewChe
     public async generateBackwaterInPAM() {
         const f: FormulaireDefinition = await this.formulaireService.createFormulaire(CalculatorType.MacroRugoRemous);
         const mrr = (f.currentNub as MacroRugoRemous);
-        mrr.setPropValue("nubMacroRugo", this.formulaire.currentNub.uid);
+        mrr.setPropValue(MacroRugoRemous.NubMacroRugoProp, this.formulaire.currentNub.uid);
         this.router.navigate(["/calculator", f.uid]);
     }
 
diff --git a/src/app/formulaire/elements/select/select-field-target-pam.ts b/src/app/formulaire/elements/select/select-field-target-pam.ts
index 9970670af..177166a82 100644
--- a/src/app/formulaire/elements/select/select-field-target-pam.ts
+++ b/src/app/formulaire/elements/select/select-field-target-pam.ts
@@ -8,7 +8,7 @@ import { FormulaireNode } from "../formulaire-node";
 export class SelectFieldTargetPam extends SelectField {
     constructor(parent: FormulaireNode) {
         super(parent);
-        this._associatedProperty = "nubMacroRugo";
+        this._associatedProperty = MacroRugoRemous.NubMacroRugoProp;
     }
 
     protected populate() {
-- 
GitLab