Skip to content
Snippets Groups Projects
Commit 6e4909e1 authored by François Grand's avatar François Grand
Browse files

fix: predams: wring name in snackbar when copying/adding a basin

refs #522
parent b71b9507
No related branches found
No related tags found
1 merge request!166Resolve "Prébarrages: Regroupement de la saisie des bassins"
316-courbe-de-remous-et-bief-remonter-une-erreur-quand-le-pas-de-discretisation-est-superieur-la 320-prebarrages-regroupement-de-la-saisie-des-bassins
...@@ -95,7 +95,7 @@ export class FixedResultsComponent extends ResultsComponentDirective { ...@@ -95,7 +95,7 @@ export class FixedResultsComponent extends ResultsComponentDirective {
let label = this.formattedLabel(fp); let label = this.formattedLabel(fp);
const nub = fp.paramDefinition.parentNub; const nub = fp.paramDefinition.parentNub;
// add child type and position before label // add child type and position before label
if (nub && nub.parent && nub.parent.childrenType) { if (nub && nub.parent && nub.intlType) {
const pos = nub.findPositionInParent(); const pos = nub.findPositionInParent();
// label = this.intlService.localizeText("INFO_OUVRAGE") + " n°" + (pos + 1) + ": " + label; // label = this.intlService.localizeText("INFO_OUVRAGE") + " n°" + (pos + 1) + ": " + label;
const cn = capitalize(this.intlService.childName(nub)); const cn = capitalize(this.intlService.childName(nub));
...@@ -198,7 +198,7 @@ export class FixedResultsComponent extends ResultsComponentDirective { ...@@ -198,7 +198,7 @@ export class FixedResultsComponent extends ResultsComponentDirective {
let label = this.formattedLabel(fp); let label = this.formattedLabel(fp);
const nub = fp.paramDefinition.parentNub; const nub = fp.paramDefinition.parentNub;
// add child type and position before label // add child type and position before label
if (nub && nub.parent && nub.parent.childrenType) { if (nub && nub.parent && nub.intlType) {
const pos = nub.findPositionInParent(); const pos = nub.findPositionInParent();
const cn = capitalize(this.intlService.childName(nub)); const cn = capitalize(this.intlService.childName(nub));
label = sprintf(this.intlService.localizeText("INFO_STUFF_N"), cn) label = sprintf(this.intlService.localizeText("INFO_STUFF_N"), cn)
......
...@@ -36,7 +36,7 @@ export abstract class GenericInputComponentDirective implements OnChanges { ...@@ -36,7 +36,7 @@ export abstract class GenericInputComponentDirective implements OnChanges {
id = param.symbol; id = param.symbol;
// if inside a child Nub, prefix with child position to disambiguate // if inside a child Nub, prefix with child position to disambiguate
const nub = param.paramDefinition.parentNub; const nub = param.paramDefinition.parentNub;
if (nub && nub.parent && nub.parent.childrenType) { if (nub && nub.parent && nub.intlType) {
id = nub.findPositionInParent() + "_" + id; id = nub.findPositionInParent() + "_" + id;
} }
} }
......
...@@ -32,7 +32,7 @@ export class ParamComputedComponent { ...@@ -32,7 +32,7 @@ export class ParamComputedComponent {
let id = "calc_" + this.param.symbol; let id = "calc_" + this.param.symbol;
// if inside a child Nub, prefix with child position to disambiguate // if inside a child Nub, prefix with child position to disambiguate
const nub = this.param.paramDefinition.parentNub; const nub = this.param.paramDefinition.parentNub;
if (nub && nub.parent && nub.parent.childrenType) { if (nub && nub.parent && nub.intlType) {
id = nub.findPositionInParent() + "_" + id; id = nub.findPositionInParent() + "_" + id;
} }
return id; return id;
......
...@@ -40,7 +40,7 @@ export class ParamLinkComponent implements OnChanges, Observer, OnDestroy { ...@@ -40,7 +40,7 @@ export class ParamLinkComponent implements OnChanges, Observer, OnDestroy {
let id = "linked_" + this.param.symbol; let id = "linked_" + this.param.symbol;
// if inside a child Nub, prefix with child position to disambiguate // if inside a child Nub, prefix with child position to disambiguate
const nub = this.param.paramDefinition.parentNub; const nub = this.param.paramDefinition.parentNub;
if (nub && nub.parent && nub.parent.childrenType) { if (nub && nub.parent && nub.intlType) {
id = nub.findPositionInParent() + "_" + id; id = nub.findPositionInParent() + "_" + id;
} }
return id; return id;
......
...@@ -47,7 +47,7 @@ export class ParamValuesComponent implements AfterViewInit, Observer { ...@@ -47,7 +47,7 @@ export class ParamValuesComponent implements AfterViewInit, Observer {
let id = "var_" + this.param.symbol; let id = "var_" + this.param.symbol;
// if inside a child Nub, prefix with child position to disambiguate // if inside a child Nub, prefix with child position to disambiguate
const nub = this.param.paramDefinition.parentNub; const nub = this.param.paramDefinition.parentNub;
if (nub && nub.parent && nub.parent.childrenType) { if (nub && nub.parent && nub.intlType) {
id = nub.findPositionInParent() + "_" + id; id = nub.findPositionInParent() + "_" + id;
} }
return id; return id;
......
...@@ -334,8 +334,7 @@ export class I18nService extends Observable implements Observer { ...@@ -334,8 +334,7 @@ export class I18nService extends Observable implements Observer {
* @param short if true, will return short name * @param short if true, will return short name
*/ */
public childName(nub: Nub, plural: boolean = false, short: boolean = false) { public childName(nub: Nub, plural: boolean = false, short: boolean = false) {
const type: string = nub.parent.childrenType; let k = "INFO_CHILD_TYPE_" + nub.intlType.toUpperCase();
let k = "INFO_CHILD_TYPE_" + type.toUpperCase();
if (short) { if (short) {
k += "_SHORT"; k += "_SHORT";
} else if (plural) { } else if (plural) {
......
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