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

fix: pressure loss results: do not display child rank for results from child law nub

refs #585
parent 7eeeeacc
No related branches found
No related tags found
2 merge requests!225Release v4.17.0,!198Resolve "Restructurer Lechapt et Calmon pour de nouvelles lois de pertes de charge"
Pipeline #140150 passed
...@@ -10,6 +10,7 @@ import { NgParameter } from "../../formulaire/elements/ngparam"; ...@@ -10,6 +10,7 @@ import { NgParameter } from "../../formulaire/elements/ngparam";
import { capitalize, Result, ResultElement } from "jalhyd"; import { capitalize, Result, ResultElement } from "jalhyd";
import { sprintf } from "sprintf-js"; import { sprintf } from "sprintf-js";
import { PressureLoss } from "jalhyd";
@Component({ @Component({
selector: "fixed-results", selector: "fixed-results",
...@@ -256,10 +257,20 @@ export class FixedResultsComponent extends ResultsComponentDirective { ...@@ -256,10 +257,20 @@ export class FixedResultsComponent extends ResultsComponentDirective {
if (sn.parent) { if (sn.parent) {
ct = sn.parent.calcType; ct = sn.parent.calcType;
} }
const cn = capitalize(this.intlService.childName(c));
let label = sprintf(this.intlService.localizeText("INFO_STUFF_N"), cn) // do not display child rank in case of pressure loss law
+ (c.findPositionInParent() + 1) + " : " const displayChildRank = !(sn instanceof PressureLoss);
+ this.formService.expandVariableNameAndUnit(ct, k); let label: string;
if (displayChildRank) {
const cn = capitalize(this.intlService.childName(c));
label = sprintf(this.intlService.localizeText("INFO_STUFF_N"), cn) + (c.findPositionInParent() + 1);
}
else {
label = capitalize(this.intlService.childName(c));
}
label += " : ";
label += this.formService.expandVariableNameAndUnit(ct, k);
label += this._fixedResults.getHelpLink(k); label += this._fixedResults.getHelpLink(k);
data.push({ data.push({
label: label, label: label,
......
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