From baf986642776e0f80622b63830e1214edf727ad2 Mon Sep 17 00:00:00 2001
From: "mathias.chouet" <mathias.chouet@irstea.fr>
Date: Mon, 29 Jul 2019 17:49:50 +0200
Subject: [PATCH] Fix #157

help button on select entry
harmonized select ids with enum keys
---
 .../calculators/cloisons/cloisons.config.json | 20 +++++---------
 src/app/calculators/dever/dever.config.json   |  4 +--
 .../parallel-structures.config.json           |  4 +--
 .../regime-uniforme/regime-uniforme.en.json   | 14 +++++-----
 .../regime-uniforme/regime-uniforme.fr.json   | 14 +++++-----
 src/app/calculators/remous/remous.en.json     | 22 ++++++++--------
 src/app/calculators/remous/remous.fr.json     | 22 ++++++++--------
 .../section-param/section-param.en.json       | 14 +++++-----
 .../section-param/section-param.fr.json       | 14 +++++-----
 .../generic-input/generic-input.component.ts  | 15 +++++++++++
 .../ngparam-input/ngparam-input.component.ts  | 15 -----------
 .../results-graph/graph-type.component.ts     |  5 ++++
 .../select-field-line.component.ts            | 25 ++++++++++++++++--
 .../formulaire/definition/form-definition.ts  |  2 +-
 src/app/formulaire/fieldset-container.ts      |  2 +-
 src/app/formulaire/fieldset.ts                |  6 ++---
 src/app/formulaire/formulaire-node.ts         |  5 +++-
 src/app/formulaire/ngparam.ts                 |  2 +-
 src/app/formulaire/select-field.ts            | 26 ++++++++++++-------
 src/locale/messages.en.json                   |  4 +--
 src/locale/messages.fr.json                   |  4 +--
 21 files changed, 130 insertions(+), 109 deletions(-)

diff --git a/src/app/calculators/cloisons/cloisons.config.json b/src/app/calculators/cloisons/cloisons.config.json
index 6b90ef466..4b9c490e1 100644
--- a/src/app/calculators/cloisons/cloisons.config.json
+++ b/src/app/calculators/cloisons/cloisons.config.json
@@ -10,8 +10,7 @@
             "BB",
             "PB",
             "DH"
-        ],
-        "help": "pab/cloisonsFieldset"
+        ]
     },
     {
         "id": "fs_ouvrage",
@@ -20,25 +19,19 @@
         "defaultNodeType": "StructureRectangle",
         "defaultStructType": "SeuilRectangulaire",
         "defaultLoiDebit": "WeirSubmergedLarinier",
-        "help": "pab/cloisonsTemplate",
         "fields": [
             {
-                "id": "select_ouvrage",
+                "id": "select_structure",
                 "type": "select",
                 "source": "device_structure_type"
             },
             {
                 "id": "select_loidebit",
                 "type": "select",
-                "source": "device_loi_debit",
-                "help": "pab/cloisonsSelect"
+                "source": "device_loi_debit"
             },
             "h1",
-            {
-                "id": "L",
-                "type": "input",
-                "help": "pab/cloisonsInput"
-            },
+            "L",
             "CdWSL",
             "CdWR",
             "CdGR",
@@ -54,12 +47,11 @@
         "type": "template_container",
         "templates": [
             "fs_ouvrage"
-        ],
-        "help": "pab/cloisonsTemplateContainer"
+        ]
     },
     {
         "type": "options",
-        "ouvrageSelectId": "select_ouvrage",
+        "ouvrageSelectId": "select_structure",
         "idCal": "Q",
         "help": "pab/cloisons"
     }
diff --git a/src/app/calculators/dever/dever.config.json b/src/app/calculators/dever/dever.config.json
index 9b8b87dcd..a8ee30ecc 100644
--- a/src/app/calculators/dever/dever.config.json
+++ b/src/app/calculators/dever/dever.config.json
@@ -19,7 +19,7 @@
         "defaultLoiDebit": "WeirFree",
         "fields": [
             {
-                "id": "select_ouvrage",
+                "id": "select_structure",
                 "type": "select",
                 "source": "device_structure_type"
             },
@@ -48,7 +48,7 @@
     },
     {
         "type": "options",
-        "ouvrageSelectId": "select_ouvrage",
+        "ouvrageSelectId": "select_structure",
         "idCal": "Q"
     }
 ]
\ No newline at end of file
diff --git a/src/app/calculators/parallel-structures/parallel-structures.config.json b/src/app/calculators/parallel-structures/parallel-structures.config.json
index 02cb7d17f..6dc8d5d6f 100644
--- a/src/app/calculators/parallel-structures/parallel-structures.config.json
+++ b/src/app/calculators/parallel-structures/parallel-structures.config.json
@@ -18,7 +18,7 @@
         "defaultLoiDebit": "GateCem88v",
         "fields": [
             {
-                "id": "select_ouvrage",
+                "id": "select_structure",
                 "type": "select",
                 "source": "device_structure_type"
             },
@@ -52,7 +52,7 @@
     },
     {
         "type": "options",
-        "ouvrageSelectId": "select_ouvrage",
+        "ouvrageSelectId": "select_structure",
         "idCal": "Q"
     }
 ]
\ No newline at end of file
diff --git a/src/app/calculators/regime-uniforme/regime-uniforme.en.json b/src/app/calculators/regime-uniforme/regime-uniforme.en.json
index 174647264..4e52b0ab8 100644
--- a/src/app/calculators/regime-uniforme/regime-uniforme.en.json
+++ b/src/app/calculators/regime-uniforme/regime-uniforme.en.json
@@ -1,18 +1,16 @@
 {
     "fs_section": "Type of section",
     "select_section": "Choice of section type",
-    "select_section_trapez": "Trapezoidal",
-    "select_section_rect": "Rectangular",
-    "select_section_circ": "Circular",
-    "select_section_puiss": "Parabolic",
-    "fs_section_trapez": "Definition of trapezoidal section",
+
+    "select_section_SectionTrapeze": "Trapezoidal",
+    "select_section_SectionRectangle": "Rectangular",
+    "select_section_SectionCercle": "Circular",
+    "select_section_SectionPuissance": "Parabolic",
+
     "LargeurFond": "Width at bottom",
     "Fruit": "Bank slope",
-    "fs_section_rect": "Definition of rectangular section",
     "LargeurBerge": "Width at embankment level",
-    "fs_section_circ": "Definition of circular section",
     "D": "Diameter",
-    "fs_section_puiss": "Definition of parabolic section",
     "k": "Coefficient",
     "fs_bief": "Features reach",
     "Ks": "Strickler coefficient",
diff --git a/src/app/calculators/regime-uniforme/regime-uniforme.fr.json b/src/app/calculators/regime-uniforme/regime-uniforme.fr.json
index 9b3bf77db..c3c20571c 100644
--- a/src/app/calculators/regime-uniforme/regime-uniforme.fr.json
+++ b/src/app/calculators/regime-uniforme/regime-uniforme.fr.json
@@ -1,18 +1,16 @@
 {
     "fs_section": "Type de section",
     "select_section": "Choix du type de section",
-    "select_section_trapez": "Trapézoïdale",
-    "select_section_rect": "Rectangulaire",
-    "select_section_circ": "Circulaire",
-    "select_section_puiss": "Parabolique",
-    "fs_section_trapez": "Définition de la section trapézoïdale",
+
+    "select_section_SectionTrapeze": "Trapézoïdale",
+    "select_section_SectionRectangle": "Rectangulaire",
+    "select_section_SectionCercle": "Circulaire",
+    "select_section_SectionPuissance": "Parabolique",
+
     "LargeurFond": "Largeur au fond",
     "Fruit": "Fruit des berges",
-    "fs_section_rect": "Définition de la section rectangulaire",
     "LargeurBerge": "Largeur au niveau des berges",
-    "fs_section_circ": "Définition de la section circulaire",
     "D": "Diamètre",
-    "fs_section_puiss": "Définition de la section parabolique",
     "k": "Coefficient",
     "fs_bief": "Caractéristiques du bief",
     "Ks": "Coefficient de Strickler",
diff --git a/src/app/calculators/remous/remous.en.json b/src/app/calculators/remous/remous.en.json
index 8f9b0f722..15b6decab 100644
--- a/src/app/calculators/remous/remous.en.json
+++ b/src/app/calculators/remous/remous.en.json
@@ -1,17 +1,15 @@
 {
     "fs_section": "Type of section",
     "select_section": "Choice of section type",
-    "select_section_trapez": "Trapezoidal",
-    "select_section_rect": "Rectangular",
-    "select_section_circ": "Circular",
-    "select_section_puiss": "Parabolic",
-    "fs_section_trapez": "Definition of trapezoidal section",
+
+    "select_section_SectionTrapeze": "Trapezoidal",
+    "select_section_SectionRectangle": "Rectangular",
+    "select_section_SectionCercle": "Circular",
+    "select_section_SectionPuissance": "Parabolic",
+
     "LargeurFond": "Width at bottom",
     "Fruit": "Bank slope",
-    "fs_section_rect": "Definition of rectangular section",
-    "fs_section_circ": "Definition of circular section",
     "D": "Diameter",
-    "fs_section_puiss": "Definition of parabolic section",
     "k": "Coefficient",
     "LargeurBerge": "Width at embankment level",
     "fs_bief": "Features reach",
@@ -27,9 +25,11 @@
     "Dx": "Discretisation step",
     "Pr": "Display accuracy",
     "select_resolution": "Resolution method",
-    "select_resolution_trap": "Integration by trapezoid",
-    "select_resolution_rk4": "Runge Kutta fourth order",
-    "select_resolution_euler": "Explicit Euler",
+
+    "select_resolution_Trapezes": "Integration by trapezoid",
+    "select_resolution_RungeKutta4": "Runge Kutta fourth order",
+    "select_resolution_EulerExplicite": "Explicit Euler",
+
     "fs_target_data": "Data to compute",
     "select_target": "Choice of the data to compute",
     "select_target_none": "None",
diff --git a/src/app/calculators/remous/remous.fr.json b/src/app/calculators/remous/remous.fr.json
index 98f5971f3..25110976b 100644
--- a/src/app/calculators/remous/remous.fr.json
+++ b/src/app/calculators/remous/remous.fr.json
@@ -1,17 +1,15 @@
 {
     "fs_section": "Type de section",
     "select_section": "Choix du type de section",
-    "select_section_trapez": "Trapézoïdale",
-    "select_section_rect": "Rectangulaire",
-    "select_section_circ": "Circulaire",
-    "select_section_puiss": "Parabolique",
-    "fs_section_trapez": "Définition de la section trapézoïdale",
+
+    "select_section_SectionTrapeze": "Trapézoïdale",
+    "select_section_SectionRectangle": "Rectangulaire",
+    "select_section_SectionCercle": "Circulaire",
+    "select_section_SectionPuissance": "Parabolique",
+
     "LargeurFond": "Largeur au fond",
     "Fruit": "Fruit des berges",
-    "fs_section_rect": "Définition de la section rectangulaire",
-    "fs_section_circ": "Définition de la section circulaire",
     "D": "Diamètre",
-    "fs_section_puiss": "Définition de la section puissance",
     "k": "Coefficient",
     "LargeurBerge": "Largeur de berge",
     "fs_bief": "Caractéristiques du bief",
@@ -26,9 +24,11 @@
     "Dx": "Pas de discrétisation",
     "Pr": "Précision de calcul des cotes",
     "select_resolution": "Méthode de résolution",
-    "select_resolution_trap": "Intégration par trapèzes",
-    "select_resolution_rk4": "Runge Kutta d'ordre 4",
-    "select_resolution_euler": "Euler explicite",
+
+    "select_resolution_Trapezes": "Intégration par trapèzes",
+    "select_resolution_RungeKutta4": "Runge Kutta d'ordre 4",
+    "select_resolution_EulerExplicite": "Euler explicite",
+
     "fs_target_data": "Donnée à calculer",
     "select_target": "Choix de la donnée à calculer",
     "select_target_none": "Aucune",
diff --git a/src/app/calculators/section-param/section-param.en.json b/src/app/calculators/section-param/section-param.en.json
index 765b14979..239f8e0f5 100644
--- a/src/app/calculators/section-param/section-param.en.json
+++ b/src/app/calculators/section-param/section-param.en.json
@@ -1,17 +1,15 @@
 {
     "fs_section": "Type of section",
     "select_section": "Choice of section type",
-    "select_section_trapez": "Trapezoidal",
-    "select_section_rect": "Rectangular",
-    "select_section_circ": "Circular",
-    "select_section_puiss": "Parabolic",
-    "fs_section_trapez": "Definition of trapezoidal section",
+
+    "select_section_SectionTrapeze": "Trapezoidal",
+    "select_section_SectionRectangle": "Rectangular",
+    "select_section_SectionCercle": "Circular",
+    "select_section_SectionPuissance": "Parabolic",
+
     "LargeurFond": "Width at bottom",
     "Fruit": "Bank slope",
-    "fs_section_rect": "Definition of rectangular section",
-    "fs_section_circ": "Definition of circular section",
     "D": "Diameter",
-    "fs_section_puiss": "Definition of parabolic section",
     "k": "Coefficient",
     "LargeurBerge": "Width at embankment level",
     "fs_bief": "Features reach",
diff --git a/src/app/calculators/section-param/section-param.fr.json b/src/app/calculators/section-param/section-param.fr.json
index aa95a5452..07532c3de 100644
--- a/src/app/calculators/section-param/section-param.fr.json
+++ b/src/app/calculators/section-param/section-param.fr.json
@@ -1,17 +1,15 @@
 {
     "fs_section": "Type de section",
     "select_section": "Choix du type de section",
-    "select_section_trapez": "Trapézoïdale",
-    "select_section_rect": "Rectangulaire",
-    "select_section_circ": "Circulaire",
-    "select_section_puiss": "Parabolique",
-    "fs_section_trapez": "Définition de la section trapézoïdale",
+
+    "select_section_SectionTrapeze": "Trapézoïdale",
+    "select_section_SectionRectangle": "Rectangulaire",
+    "select_section_SectionCercle": "Circulaire",
+    "select_section_SectionPuissance": "Parabolique",
+
     "LargeurFond": "Largeur au fond",
     "Fruit": "Fruit des berges",
-    "fs_section_rect": "Définition de la section rectangulaire",
-    "fs_section_circ": "Définition de la section circulaire",
     "D": "Diamètre",
-    "fs_section_puissance": "Définition de la section parabolique",
     "k": "Coefficient",
     "LargeurBerge": "Largeur au niveau des berges",
     "fs_bief": "Caractéristiques du bief",
diff --git a/src/app/components/generic-input/generic-input.component.ts b/src/app/components/generic-input/generic-input.component.ts
index 42481be86..e18680906 100644
--- a/src/app/components/generic-input/generic-input.component.ts
+++ b/src/app/components/generic-input/generic-input.component.ts
@@ -315,4 +315,19 @@ export abstract class GenericInputComponent extends BaseComponent implements OnC
 
         return { isValid: valid, message: msg };
     }
+
+    public openHelp($event: any) {
+        window.open("assets/docs-fr/calculators/" + this._model.helpLink + ".html", "_blank");
+        $event.preventDefault();
+        $event.stopPropagation();
+        return false;
+    }
+
+    public get enableHelpButton() {
+        return this._model && this._model.helpLink;
+    }
+
+    public get uitextOpenHelp() {
+        return this.intlService.localizeText("INFO_CALCULATOR_OPEN_HELP");
+    }
 }
diff --git a/src/app/components/ngparam-input/ngparam-input.component.ts b/src/app/components/ngparam-input/ngparam-input.component.ts
index c56cb8c2d..c61a4fb78 100644
--- a/src/app/components/ngparam-input/ngparam-input.component.ts
+++ b/src/app/components/ngparam-input/ngparam-input.component.ts
@@ -112,19 +112,4 @@ export class NgParamInputComponent extends GenericInputComponent implements Obse
     public ngOnDestroy() {
         this._paramDef.removeObserver(this);
     }
-
-    public openHelp($event: any) {
-        window.open("assets/docs-fr/calculators/" + this._model.helpLink + ".html", "_blank");
-        $event.preventDefault();
-        $event.stopPropagation();
-        return false;
-    }
-
-    public get enableHelpButton() {
-        return this._model && this._model.helpLink;
-    }
-
-    public get uitextOpenHelp() {
-        return this.intlService.localizeText("INFO_CALCULATOR_OPEN_HELP");
-    }
 }
diff --git a/src/app/components/results-graph/graph-type.component.ts b/src/app/components/results-graph/graph-type.component.ts
index 78ef5d486..35c5c81b0 100644
--- a/src/app/components/results-graph/graph-type.component.ts
+++ b/src/app/components/results-graph/graph-type.component.ts
@@ -78,4 +78,9 @@ export class GraphTypeSelectComponent implements IObservable {
     notifyObservers(data: any, sender?: any) {
         this._observable.notifyObservers(data, sender);
     }
+
+    // implemented because of generic template
+    public get enableHelpButton() {
+        return false;
+    }
 }
diff --git a/src/app/components/select-field-line/select-field-line.component.ts b/src/app/components/select-field-line/select-field-line.component.ts
index e430231f2..fcec71493 100644
--- a/src/app/components/select-field-line/select-field-line.component.ts
+++ b/src/app/components/select-field-line/select-field-line.component.ts
@@ -12,6 +12,10 @@ import { I18nService } from "../../services/internationalisation/internationalis
     ]
 })
 export class SelectFieldLineComponent {
+
+    /** aide en ligne */
+    protected helpLink: string | { [key: string]: string };
+
     @Input()
     private _select: SelectField;
 
@@ -49,14 +53,31 @@ export class SelectFieldLineComponent {
     }
 
     public openHelp($event: any) {
-        window.open("assets/docs-fr/calculators/" + this._select.helpLink + ".html", "_blank");
+        let link;
+        if (typeof this._select.helpLink === "string") {
+            link = this._select.helpLink;
+        } else { // object
+            const cv = this._select.getValue();
+            const entryId = cv.id.substring(this._select.entriesBaseId.length);
+            link = this._select.helpLink[entryId];
+        }
+        window.open("assets/docs-fr/calculators/" + link + ".html", "_blank");
         $event.preventDefault();
         $event.stopPropagation();
         return false;
     }
 
     public get enableHelpButton() {
-        return this._select && this._select.helpLink;
+        if (this._select && this._select.helpLink) {
+            if (typeof this._select.helpLink === "string") {
+                return true;
+            } else { // object
+                const cv = this._select.getValue();
+                const entryId = cv.id.substring(this._select.entriesBaseId.length);
+                return Object.keys(this._select.helpLink).includes(entryId);
+            }
+        }
+        return false;
     }
 
     public get uitextOpenHelp() {
diff --git a/src/app/formulaire/definition/form-definition.ts b/src/app/formulaire/definition/form-definition.ts
index ec6244f68..aae431e1e 100644
--- a/src/app/formulaire/definition/form-definition.ts
+++ b/src/app/formulaire/definition/form-definition.ts
@@ -136,7 +136,7 @@ export abstract class FormulaireDefinition extends FormulaireNode implements Obs
         if (dnt !== undefined) {
             this._props["nodeType"] = ComputeNodeType[dnt];
         }
-        this.helpLink = json["help"];
+        this._helpLink = json["help"];
     }
 
     protected completeParse(json: {}) {
diff --git a/src/app/formulaire/fieldset-container.ts b/src/app/formulaire/fieldset-container.ts
index 626851a2f..0aec05ebc 100644
--- a/src/app/formulaire/fieldset-container.ts
+++ b/src/app/formulaire/fieldset-container.ts
@@ -108,7 +108,7 @@ export class FieldsetContainer extends FormulaireElement {
 
     public parseConfig(json: {}, data?: {}) {
         this._confId = json["id"];
-        this.helpLink = json["help"];
+        this._helpLink = json["help"];
         const templates = data as any[];
 
         const templateNames: string[] = json["templates"];
diff --git a/src/app/formulaire/fieldset.ts b/src/app/formulaire/fieldset.ts
index f03bb0082..701705eeb 100644
--- a/src/app/formulaire/fieldset.ts
+++ b/src/app/formulaire/fieldset.ts
@@ -194,7 +194,7 @@ export class FieldSet extends FormulaireElement implements Observer {
         switch (this._confId) {
 
             case "fs_ouvrage":
-                this.setSelectValueFromProperty("select_ouvrage", "structureType");
+                this.setSelectValueFromProperty("select_structure", "structureType");
 
                 const st: StructureType = this.getPropValue("structureType");
                 switch (st) {
@@ -263,7 +263,7 @@ export class FieldSet extends FormulaireElement implements Observer {
         this._jsonConfig = json;
 
         this._confId = json["id"];
-        this.helpLink = json["help"];
+        this._helpLink = json["help"];
 
         const parentForm = this.parentForm as FormulaireDefinition;
         const ct: string = json["calcType"];
@@ -335,7 +335,7 @@ export class FieldSet extends FormulaireElement implements Observer {
                         case "select_section": // sections paramétrées
                             this.setPropValue("nodeType", data.value.value);
                             break;
-                        case "select_ouvrage": // ouvrages parallèles
+                        case "select_structure": // ouvrages parallèles
                             this.setPropValue("structureType", data.value.value);
                             break;
                         case "select_loidebit": // ouvrages parallèles et dérivés
diff --git a/src/app/formulaire/formulaire-node.ts b/src/app/formulaire/formulaire-node.ts
index 776c0cb60..c1fb2930d 100644
--- a/src/app/formulaire/formulaire-node.ts
+++ b/src/app/formulaire/formulaire-node.ts
@@ -6,7 +6,7 @@ import { JalhydObject, IObservable, Observer, Observable } from "jalhyd";
 export abstract class FormulaireNode implements IObservable {
 
     /** aide en ligne */
-    public helpLink: string;
+    protected _helpLink: string;
 
     /**
      * identifiant dans le fichier de conf
@@ -60,6 +60,9 @@ export abstract class FormulaireNode implements IObservable {
         return this._uid;
     }
 
+    public get helpLink() {
+        return this._helpLink;
+    }
 
     /**
      * cherche un FormulaireNode par son id de conf
diff --git a/src/app/formulaire/ngparam.ts b/src/app/formulaire/ngparam.ts
index eb25f2163..a76a934ff 100644
--- a/src/app/formulaire/ngparam.ts
+++ b/src/app/formulaire/ngparam.ts
@@ -439,7 +439,7 @@ export class NgParameter extends InputField implements Observer {
 
     public parseConfig(json: {}) {
         this._confId = json["id"];
-        this.helpLink = json["help"];
+        this._helpLink = json["help"];
         this.unit = this.paramDefinition.unit;
         this.radioConfig = this.getRadioConfig();
     }
diff --git a/src/app/formulaire/select-field.ts b/src/app/formulaire/select-field.ts
index df656ceb0..7e87dd83b 100644
--- a/src/app/formulaire/select-field.ts
+++ b/src/app/formulaire/select-field.ts
@@ -8,6 +8,9 @@ import { FormulaireDefinition } from "./definition/form-definition";
 
 export class SelectField extends Field {
 
+    /** string to build the select entries IDs from */
+    protected _entriesBaseId: string;
+
     protected _entries: SelectEntry[];
 
     protected _selectedEntry: SelectEntry;
@@ -17,6 +20,10 @@ export class SelectField extends Field {
         this.clearEntries();
     }
 
+    public get entriesBaseId(): string {
+        return this._entriesBaseId;
+    }
+
     public get entries() {
         return this._entries;
     }
@@ -93,17 +100,18 @@ export class SelectField extends Field {
 
     public parseConfig(field: {}, data?: {}) {
         this._confId = field["id"];
-        this.helpLink = field["help"];
+        this._entriesBaseId = this._confId + "_";
+        this._helpLink = field["help"];
         const source = field["source"];
         const nub: Nub = (this.parentForm as FormulaireDefinition).currentNub;
         // ad-hoc cases
         switch (source) {
 
             case "lechapt_calmon_material":
-                this.addEntry(new SelectEntry("select_material_empty", ""));
+                this.addEntry(new SelectEntry(this._entriesBaseId + "empty", ""));
                 let i = 0;
                 for (const mat of LechaptCalmon.materials) {
-                    const e: SelectEntry = new SelectEntry("select_material_" + (i + 1), i);
+                    const e: SelectEntry = new SelectEntry(this._entriesBaseId + (i + 1), i);
                     this.addEntry(e);
                     i++;
                 }
@@ -111,29 +119,29 @@ export class SelectField extends Field {
 
             case "acsection_section":
                 for (const sec of acSection.availableSectionTypes) {
-                    const e: SelectEntry = new SelectEntry("select_section_" + sec.id, sec.value);
+                    const e: SelectEntry = new SelectEntry(this._entriesBaseId + sec.id, sec.value);
                     this.addEntry(e);
                 }
                 break;
 
             case "remous_methode_resolution":
                 for (const mr of CourbeRemous.availableMethodeResolution) {
-                    const e: SelectEntry = new SelectEntry("select_resolution_" + mr.id, mr.value);
+                    const e: SelectEntry = new SelectEntry(this._entriesBaseId + mr.id, mr.value);
                     this.addEntry(e);
                 }
                 break;
 
             case "remous_target":
-                this.addEntry(new SelectEntry("select_target_none", ""));
+                this.addEntry(new SelectEntry(this._entriesBaseId + "none", ""));
                 for (const at of CourbeRemous.availableTargets) {
-                    const e: SelectEntry = new SelectEntry("select_target_" + at, at);
+                    const e: SelectEntry = new SelectEntry(this._entriesBaseId + at, at);
                     this.addEntry(e);
                 }
                 break;
 
             case "device_structure_type":
                 for (const st in (nub as ParallelStructure).getLoisAdmissibles()) {
-                    const e: SelectEntry = new SelectEntry("select_structure_" + st, StructureType[st]);
+                    const e: SelectEntry = new SelectEntry(this._entriesBaseId + st, StructureType[st]);
                     this.addEntry(e);
                 }
                 break;
@@ -145,7 +153,7 @@ export class SelectField extends Field {
                 const la = (nub as ParallelStructure).getLoisAdmissibles();
                 const stName = StructureType[cst];
                 for (const ld of la[stName]) {
-                    const e: SelectEntry = new SelectEntry("select_loidebit_" + stName + "_" + LoiDebit[ld], ld);
+                    const e: SelectEntry = new SelectEntry(this._entriesBaseId + stName + "_" + LoiDebit[ld], ld);
                     this.addEntry(e);
                 }
                 break;
diff --git a/src/locale/messages.en.json b/src/locale/messages.en.json
index 08d9b4a41..ae16d93a7 100644
--- a/src/locale/messages.en.json
+++ b/src/locale/messages.en.json
@@ -196,8 +196,8 @@
     "INFO_LIB_SELECT_LOIDEBIT2": "Stage-discharge law",
     "INFO_LIB_SELECT_LOIDEBIT3": "Stage-discharge law",
     "INFO_LIB_SELECT_LOIDEBIT4": "Stage-discharge law",
-    "INFO_LIB_SELECT_OUVRAGE_SEUIL_RECT": "Rectangular weir",
-    "INFO_LIB_SELECT_OUVRAGE": "Device",
+    "INFO_LIB_SELECT_STRUCTURE_SEUIL_RECT": "Rectangular weir",
+    "INFO_LIB_SELECT_STRUCTURE": "Device",
     "INFO_LIB_STRUCT_CONTAINER": "Devices",
     "INFO_LIB_TAU0": "Tractive force",
     "INFO_LIB_TOR": "Supercritical water line",
diff --git a/src/locale/messages.fr.json b/src/locale/messages.fr.json
index 233ba439b..5216ddcdc 100644
--- a/src/locale/messages.fr.json
+++ b/src/locale/messages.fr.json
@@ -195,8 +195,8 @@
     "INFO_LIB_SELECT_LOIDEBIT2": "Loi de débit",
     "INFO_LIB_SELECT_LOIDEBIT3": "Loi de débit",
     "INFO_LIB_SELECT_LOIDEBIT4": "Loi de débit",
-    "INFO_LIB_SELECT_OUVRAGE_SEUIL_RECT": "Seuil rectangulaire",
-    "INFO_LIB_SELECT_OUVRAGE": "Ouvrage",
+    "INFO_LIB_SELECT_STRUCTURE_SEUIL_RECT": "Seuil rectangulaire",
+    "INFO_LIB_SELECT_STRUCTURE": "Ouvrage",
     "INFO_LIB_STRUCT_CONTAINER": "Ouvrages",
     "INFO_LIB_TAU0": "Force tractrice",
     "INFO_LIB_TOR": "Ligne d'eau torrentielle",
-- 
GitLab