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 {
let label = this.formattedLabel(fp);
const nub = fp.paramDefinition.parentNub;
// add child type and position before label
if (nub && nub.parent && nub.parent.childrenType) {
if (nub && nub.parent && nub.intlType) {
const pos = nub.findPositionInParent();
// label = this.intlService.localizeText("INFO_OUVRAGE") + " n°" + (pos + 1) + ": " + label;
const cn = capitalize(this.intlService.childName(nub));
......@@ -198,7 +198,7 @@ export class FixedResultsComponent extends ResultsComponentDirective {
let label = this.formattedLabel(fp);
const nub = fp.paramDefinition.parentNub;
// 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 cn = capitalize(this.intlService.childName(nub));
label = sprintf(this.intlService.localizeText("INFO_STUFF_N"), cn)
......
......@@ -36,7 +36,7 @@ export abstract class GenericInputComponentDirective implements OnChanges {
id = param.symbol;
// if inside a child Nub, prefix with child position to disambiguate
const nub = param.paramDefinition.parentNub;
if (nub && nub.parent && nub.parent.childrenType) {
if (nub && nub.parent && nub.intlType) {
id = nub.findPositionInParent() + "_" + id;
}
}
......
......@@ -32,7 +32,7 @@ export class ParamComputedComponent {
let id = "calc_" + this.param.symbol;
// if inside a child Nub, prefix with child position to disambiguate
const nub = this.param.paramDefinition.parentNub;
if (nub && nub.parent && nub.parent.childrenType) {
if (nub && nub.parent && nub.intlType) {
id = nub.findPositionInParent() + "_" + id;
}
return id;
......
......@@ -40,7 +40,7 @@ export class ParamLinkComponent implements OnChanges, Observer, OnDestroy {
let id = "linked_" + this.param.symbol;
// if inside a child Nub, prefix with child position to disambiguate
const nub = this.param.paramDefinition.parentNub;
if (nub && nub.parent && nub.parent.childrenType) {
if (nub && nub.parent && nub.intlType) {
id = nub.findPositionInParent() + "_" + id;
}
return id;
......
......@@ -47,7 +47,7 @@ export class ParamValuesComponent implements AfterViewInit, Observer {
let id = "var_" + this.param.symbol;
// if inside a child Nub, prefix with child position to disambiguate
const nub = this.param.paramDefinition.parentNub;
if (nub && nub.parent && nub.parent.childrenType) {
if (nub && nub.parent && nub.intlType) {
id = nub.findPositionInParent() + "_" + id;
}
return id;
......
......@@ -334,8 +334,7 @@ export class I18nService extends Observable implements Observer {
* @param short if true, will return short name
*/
public childName(nub: Nub, plural: boolean = false, short: boolean = false) {
const type: string = nub.parent.childrenType;
let k = "INFO_CHILD_TYPE_" + type.toUpperCase();
let k = "INFO_CHILD_TYPE_" + nub.intlType.toUpperCase();
if (short) {
k += "_SHORT";
} 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