diff --git a/README.md b/README.md index 4b93c03438e22e6bf8999418eef7e56393f49e3c..ae73d50069c1118d4669a61d6c6f5912e0071cea 100644 --- a/README.md +++ b/README.md @@ -248,6 +248,15 @@ Custom Material SVG Icons will only show up when the application is deployed on - pour l'entête d'un _template_container_: `{... "type": "template_container", "help": "aide.html", ...}` + - éventuellement l'URL de l'aide pour un résultat en particulier, dans le bloc d'options de la configuration : + - ```json + { + "type": "options", + … + "resultsHelp": { + "HG": "devalaison/grille.html#hauteur-de-grille" + } + - dans _src/app/calculators/ma-calculette_ : Créer les fichiers d'internationalisation (_ma-calculette.<langue>.json_). Il doivent reprendre tous les ids utilisés dans le fichier de configuration et fournir leur traduction. diff --git a/src/app/calculators/grille/grille.config.json b/src/app/calculators/grille/grille.config.json index aac755031d170c6eb384b53de7e9f75e96487dcd..226729e6baeff8d81140d8802056b97d5e66868c 100644 --- a/src/app/calculators/grille/grille.config.json +++ b/src/app/calculators/grille/grille.config.json @@ -40,6 +40,9 @@ "type": "options", "gridTypeSelectId": "select_grid_type", "gridProfileSelectId": "select_grid_profile", - "help": "devalaison/grille" + "help": "devalaison/grille", + "resultsHelp": { + "HG": "devalaison/grille#hauteur-de-grille" + } } ] \ No newline at end of file diff --git a/src/app/components/fixedvar-results/fixed-results.component.html b/src/app/components/fixedvar-results/fixed-results.component.html index 67effaa6ae9922257947c55c26863a9801e8eaea..fe2ce37f9c0cf592b2987aaf71b3ee23e58169e0 100644 --- a/src/app/components/fixedvar-results/fixed-results.component.html +++ b/src/app/components/fixedvar-results/fixed-results.component.html @@ -12,7 +12,7 @@ <ng-container matColumnDef="parametre"> <th mat-header-cell *matHeaderCellDef>{{ uitextParamFixes }}</th> - <td mat-cell *matCellDef="let element" [ngClass]="{'highlightedResult': element.isCalcResult}">{{ element.label }}</td> + <td mat-cell *matCellDef="let element" [innerHTML]="element.label" [ngClass]="{'highlightedResult': element.isCalcResult}"></td> </ng-container> <ng-container matColumnDef="valeur"> <th mat-header-cell *matHeaderCellDef>{{ uitextValeurs }}</th> diff --git a/src/app/components/fixedvar-results/fixed-results.component.scss b/src/app/components/fixedvar-results/fixed-results.component.scss index c2fee955e0e28dc565a72c5308124bd05bc03170..b4ec0504080be25670fe2900488bfeea0c8f9336 100644 --- a/src/app/components/fixedvar-results/fixed-results.component.scss +++ b/src/app/components/fixedvar-results/fixed-results.component.scss @@ -41,6 +41,12 @@ table.mat-table { ::ng-deep .mat-cell { padding-top: 8px; padding-bottom: 8px; + + .material-icons { + font-size: 1.4em; + vertical-align: bottom; + margin-left: 4px; + } } } diff --git a/src/app/components/fixedvar-results/fixed-results.component.ts b/src/app/components/fixedvar-results/fixed-results.component.ts index 56d481ca4b2df9f91851b121e03bf8e8f7ff27d9..6df588a2990089bf5801a3500f56f93864882bc9 100644 --- a/src/app/components/fixedvar-results/fixed-results.component.ts +++ b/src/app/components/fixedvar-results/fixed-results.component.ts @@ -101,6 +101,7 @@ export class FixedResultsComponent extends ResultsComponent { const pos = fp.paramDefinition.parentNub.findPositionInParent(); label = this.intlService.localizeText("INFO_OUVRAGE") + " n°" + (pos + 1) + ": " + label; } + label += this._fixedResults.getHelpLink(symbol); data.push({ label: label, value: this.formattedValue(fp), @@ -138,7 +139,8 @@ export class FixedResultsComponent extends ResultsComponent { unit = p.unit; } } catch (e) { /* silent fail */ } - const label = this.formService.expandVariableNameAndUnit(ct, k, unit); + let label = this.formService.expandVariableNameAndUnit(ct, k, unit); + label += this._fixedResults.getHelpLink(symbol); data.push({ label: label, value: this.intlService.formatResult(k, er), @@ -160,10 +162,12 @@ export class FixedResultsComponent extends ResultsComponent { ct = sn.parent.calcType; } const cn = capitalize(this.intlService.childName(sn)); + let label = sprintf(this.intlService.localizeText("INFO_STUFF_N"), cn) + + (c.findPositionInParent() + 1) + " : " + + this.formService.expandVariableNameAndUnit(ct, k); + label += this._fixedResults.getHelpLink(symbol); data.push({ - label: sprintf(this.intlService.localizeText("INFO_STUFF_N"), cn) - + (c.findPositionInParent() + 1) + " : " - + this.formService.expandVariableNameAndUnit(ct, k), + label: label, value: this.intlService.formatResult(k, er), isCalcResult: true // for CSS }); @@ -191,6 +195,7 @@ export class FixedResultsComponent extends ResultsComponent { const pos = fp.paramDefinition.parentNub.findPositionInParent(); label = this.intlService.localizeText("INFO_OUVRAGE") + " n°" + (pos + 1) + ": " + label; } + label += this._fixedResults.getHelpLink(fp.symbol); data.push({ label: label, value: this.formattedValue(fp), @@ -223,7 +228,8 @@ export class FixedResultsComponent extends ResultsComponent { unit = p.unit; } } catch (e) { /* silent fail */ } - const label = this.formService.expandVariableNameAndUnit(ct, k, unit); + let label = this.formService.expandVariableNameAndUnit(ct, k, unit); + label += this._fixedResults.getHelpLink(k); data.push({ label: label, value: this.intlService.formatResult(k, er), @@ -242,10 +248,12 @@ export class FixedResultsComponent extends ResultsComponent { ct = sn.parent.calcType; } const cn = capitalize(this.intlService.childName(sn)); + let label = sprintf(this.intlService.localizeText("INFO_STUFF_N"), cn) + + (c.findPositionInParent() + 1) + " : " + + this.formService.expandVariableNameAndUnit(ct, k); + label += this._fixedResults.getHelpLink(k); data.push({ - label: sprintf(this.intlService.localizeText("INFO_STUFF_N"), cn) - + (c.findPositionInParent() + 1) + " : " - + this.formService.expandVariableNameAndUnit(ct, k), + label: label, value: this.intlService.formatResult(k, er), isCalcResult: true // for CSS }); diff --git a/src/app/components/fixedvar-results/var-results.component.html b/src/app/components/fixedvar-results/var-results.component.html index 8768e08b8d2a6ad547e17abb2c11f6990771a5dd..7b6bbeb3e1580444e0e2a81fbe2f58ef87d15aca 100644 --- a/src/app/components/fixedvar-results/var-results.component.html +++ b/src/app/components/fixedvar-results/var-results.component.html @@ -33,8 +33,8 @@ </ng-container> <!-- generic column --> <ng-container *ngFor="let h of headersWithoutLogColumn; let i = index" [matColumnDef]="h"> - <th mat-header-cell *matHeaderCellDef>{{ h }}</th> - <td mat-cell *matCellDef="let element">{{ element[i+1] }}</td> + <th mat-header-cell *matHeaderCellDef [innerHTML]="h"></th> + <td mat-cell *matCellDef="let element" [innerHTML]="element[i+1]"></td> </ng-container> <tr mat-header-row *matHeaderRowDef="headers"></tr> diff --git a/src/app/components/fixedvar-results/var-results.component.scss b/src/app/components/fixedvar-results/var-results.component.scss index d897f54841d63ad93bc8847f6263ffb15c22fd9c..6dc74ba0bf49e85d3740d096c8cc87071afee188 100644 --- a/src/app/components/fixedvar-results/var-results.component.scss +++ b/src/app/components/fixedvar-results/var-results.component.scss @@ -61,6 +61,12 @@ table.mat-table { color: black; padding: 5px; border: none; + + .material-icons { + font-size: 1.4em; + vertical-align: bottom; + margin-left: 4px; + } } ::ng-deep .mat-cell { diff --git a/src/app/components/macrorugo-compound-results/macrorugo-compound-results-table.component.html b/src/app/components/macrorugo-compound-results/macrorugo-compound-results-table.component.html index 1e1df2713ccb63ddce22a7355588146221c088c9..b6d40a92fb3e757015fe0212c0a8256e894dff71 100644 --- a/src/app/components/macrorugo-compound-results/macrorugo-compound-results-table.component.html +++ b/src/app/components/macrorugo-compound-results/macrorugo-compound-results-table.component.html @@ -19,7 +19,7 @@ <table mat-table [dataSource]="dataSet"> <ng-container *ngFor="let h of headers; let i = index" [matColumnDef]="h"> - <th mat-header-cell *matHeaderCellDef>{{ h }}</th> + <th mat-header-cell *matHeaderCellDef [innerHTML]="h"></th> <td mat-cell *matCellDef="let element" [innerHTML]="element[i]"></td> </ng-container> diff --git a/src/app/components/macrorugo-compound-results/macrorugo-compound-results-table.component.scss b/src/app/components/macrorugo-compound-results/macrorugo-compound-results-table.component.scss index 14c20aa01d6539da5befe396c5d73d71cdc3035d..fc10d9cdf94000fa8b5a4d85151654aee8655e7b 100644 --- a/src/app/components/macrorugo-compound-results/macrorugo-compound-results-table.component.scss +++ b/src/app/components/macrorugo-compound-results/macrorugo-compound-results-table.component.scss @@ -62,5 +62,11 @@ table.mat-table { font-size: 1em; color: black; padding: 5px; + + .material-icons { + font-size: 1.4em; + vertical-align: bottom; + margin-left: 4px; + } } } diff --git a/src/app/components/pab-results/pab-results-table.component.html b/src/app/components/pab-results/pab-results-table.component.html index 97d728f3a04cfe008262c8d3dd5729182df168f4..f5e6fcf9b1c1ba49fc66ddceb701feb79aa9a35e 100644 --- a/src/app/components/pab-results/pab-results-table.component.html +++ b/src/app/components/pab-results/pab-results-table.component.html @@ -19,7 +19,7 @@ <table mat-table [dataSource]="dataSet"> <ng-container *ngFor="let h of headers; let i = index" [matColumnDef]="h"> - <th mat-header-cell *matHeaderCellDef>{{ h }}</th> + <th mat-header-cell *matHeaderCellDef [innerHTML]="h"></th> <td mat-cell *matCellDef="let element" [innerHTML]="element[i]"></td> </ng-container> diff --git a/src/app/components/pab-results/pab-results-table.component.scss b/src/app/components/pab-results/pab-results-table.component.scss index c0eaa55d272e08f72dfdea4d61d0c3f88a0be377..d57b6484a2206342cabb8569a30e31ec40c4848b 100644 --- a/src/app/components/pab-results/pab-results-table.component.scss +++ b/src/app/components/pab-results/pab-results-table.component.scss @@ -62,5 +62,11 @@ table.mat-table { font-size: 1em; color: black; padding: 5px; + + .material-icons { + font-size: 1.4em; + vertical-align: bottom; + margin-left: 4px; + } } } diff --git a/src/app/components/section-results/section-results.component.ts b/src/app/components/section-results/section-results.component.ts index 3ab72436e9d7d8aad9b340affd720164553ad174..57215b164a302cf3e6c9a1c57acb8ecdee3edc47 100644 --- a/src/app/components/section-results/section-results.component.ts +++ b/src/app/components/section-results/section-results.component.ts @@ -101,7 +101,6 @@ export class SectionResultsComponent extends ResultsComponent implements DoCheck } private updateResults() { - console.log("UPDATE RESULTS"); if (this._results && this._sectionCanvas) { this._resultElement = new ResultElement(); diff --git a/src/app/formulaire/definition/concrete/form-base.ts b/src/app/formulaire/definition/concrete/form-base.ts index 976cf3368d999b51ddee651a5d752852e4e1e1c0..35f9b9cc84320b494f815e516b3666abc8a07c8b 100644 --- a/src/app/formulaire/definition/concrete/form-base.ts +++ b/src/app/formulaire/definition/concrete/form-base.ts @@ -18,6 +18,11 @@ export class FormulaireBase extends FormulaireDefinition { this._formCompute = new FormComputeFixedVar(this, (this._formResult as FormResultFixedVar)); } + protected completeParse(json: {}) { + super.completeParse(json); + this._formResult.helpLinks = this._resultsHelpLinks; + } + /** * Resets the form results, the results panel on screen, the model * results, and does the same for all depending modules diff --git a/src/app/formulaire/definition/concrete/form-macrorugo-compound.ts b/src/app/formulaire/definition/concrete/form-macrorugo-compound.ts index d15d41e2ba09851e6bb1c4a6356695fec70e941b..b9690657eec530045c5c6ee2a0bdd482d8796b45 100644 --- a/src/app/formulaire/definition/concrete/form-macrorugo-compound.ts +++ b/src/app/formulaire/definition/concrete/form-macrorugo-compound.ts @@ -153,6 +153,7 @@ export class FormulaireMacrorugoCompound extends FormulaireBase { protected completeParse(json: {}) { this.subscribeFieldsetContainer(); this.updateApronState(this.mrcNub.properties.getPropValue("inclinedApron")); + this._formResult.helpLinks = this._resultsHelpLinks; } private get fieldsetContainer(): FieldsetContainer { diff --git a/src/app/formulaire/definition/concrete/form-parallel-structures.ts b/src/app/formulaire/definition/concrete/form-parallel-structures.ts index 2c7ab712506805bd8a9b4f3d0abd3407e6564398..c4b32913557b0536380c1637cf410c3c8886520d 100644 --- a/src/app/formulaire/definition/concrete/form-parallel-structures.ts +++ b/src/app/formulaire/definition/concrete/form-parallel-structures.ts @@ -170,6 +170,7 @@ export class FormulaireParallelStructure extends FormulaireBase { protected completeParse(json: {}) { this.subscribeFieldsetContainer(); + this._formResult.helpLinks = this._resultsHelpLinks; } private get fieldsetContainer(): FieldsetContainer { diff --git a/src/app/formulaire/definition/concrete/form-regime-uniforme.ts b/src/app/formulaire/definition/concrete/form-regime-uniforme.ts index 79ad66e52b6a2007bab08a85c9657a44a447a170..bb4cbd0a9ef74c761e29c49cec44b917b88b19de 100644 --- a/src/app/formulaire/definition/concrete/form-regime-uniforme.ts +++ b/src/app/formulaire/definition/concrete/form-regime-uniforme.ts @@ -23,6 +23,7 @@ export class FormulaireRegimeUniforme extends FormulaireBase implements Observer protected completeParse(json: {}) { super.completeParse(json); + this._formResult.helpLinks = this._resultsHelpLinks; } // interface Observer diff --git a/src/app/formulaire/definition/form-definition.ts b/src/app/formulaire/definition/form-definition.ts index 699fc83bf277be97dbbc5aa29e42ec06594f3aa6..2ba17671bcb97125f20319a2bf72cb94938924af 100644 --- a/src/app/formulaire/definition/form-definition.ts +++ b/src/app/formulaire/definition/form-definition.ts @@ -19,6 +19,7 @@ import { PabTable } from "../pab-table"; * classe de base pour tous les formulaires */ export abstract class FormulaireDefinition extends FormulaireNode implements Observer { + /** nom du module de calcul */ private _calculatorName: string; @@ -28,6 +29,9 @@ export abstract class FormulaireDefinition extends FormulaireNode implements Obs /** propriétés par défaut (lues si _currentNub === undefined ) */ protected _props = {}; + /** aide en ligne pour les résultats */ + protected _resultsHelpLinks: { [key: string]: string }; + /** fichier de configuration */ private _jsonConfig: {}; @@ -137,8 +141,10 @@ export abstract class FormulaireDefinition extends FormulaireNode implements Obs this._props["nodeType"] = ComputeNodeType[dnt]; } this._helpLink = json["help"]; + this._resultsHelpLinks = json["resultsHelp"]; } + /** called at the end of parseConfig() */ protected completeParse(json: {}) { } diff --git a/src/app/formulaire/definition/form-result-fixedvar.ts b/src/app/formulaire/definition/form-result-fixedvar.ts index 4e4dfa58349711e65d6c84058064fddd6ccefe77..512a6342d031505c83ffdc5aa99a28488cb3c8f8 100644 --- a/src/app/formulaire/definition/form-result-fixedvar.ts +++ b/src/app/formulaire/definition/form-result-fixedvar.ts @@ -56,6 +56,9 @@ export class FormResultFixedVar extends FormResult { public get results(): CalculatorResults[] { const res: CalculatorResults[] = []; + // ensure help links are propagated + this._fixedResults.helpLinks = this.helpLinks; + this._varResults.helpLinks = this.helpLinks; res.push(this._fixedResults); res.push(this._varResults); return res; diff --git a/src/app/formulaire/definition/form-result-macrorugo-compound.ts b/src/app/formulaire/definition/form-result-macrorugo-compound.ts index 73ba7e9d2ece0f8c90dfe8808a931db85b3b46b7..d73ec051c96c669638fb0135d9c8937a46675e9e 100644 --- a/src/app/formulaire/definition/form-result-macrorugo-compound.ts +++ b/src/app/formulaire/definition/form-result-macrorugo-compound.ts @@ -24,6 +24,8 @@ export class FormResultMacrorugoCompound extends FormResult { } public get results(): CalculatorResults[] { + // ensure help links are propagated + this._mrcResults.helpLinks = this.helpLinks; return [ this._mrcResults ]; } diff --git a/src/app/formulaire/definition/form-result-pab.ts b/src/app/formulaire/definition/form-result-pab.ts index 5adc86f132629dfdea0239728c1c2a819c95bc90..6a4cd34fdcad78ac0c4267403b85d5b6ab691b4c 100644 --- a/src/app/formulaire/definition/form-result-pab.ts +++ b/src/app/formulaire/definition/form-result-pab.ts @@ -24,6 +24,8 @@ export class FormResultPab extends FormResult { } public get results(): CalculatorResults[] { + // ensure help links are propagated + this._pabResults.helpLinks = this.helpLinks; return [ this._pabResults ]; } diff --git a/src/app/formulaire/definition/form-result-remous.ts b/src/app/formulaire/definition/form-result-remous.ts index 047d7a8796951d1777526f3aeade1530da51c42e..4ae14b792de50ac48a24af0bd857d68afdee3b39 100644 --- a/src/app/formulaire/definition/form-result-remous.ts +++ b/src/app/formulaire/definition/form-result-remous.ts @@ -28,8 +28,8 @@ export class FormResultRemous extends FormResult { } public get results(): CalculatorResults[] { - const res: CalculatorResults[] = []; - res.push(this._remousResults); - return res; + // ensure help links are propagated + this._remousResults.helpLinks = this.helpLinks; + return [ this._remousResults ]; } } diff --git a/src/app/formulaire/definition/form-result-section.ts b/src/app/formulaire/definition/form-result-section.ts index 73d5f0e87604939c0350a692c53389ae69c9d0f0..e4acf4a41b00bf2d536af982268afab11afa2547 100644 --- a/src/app/formulaire/definition/form-result-section.ts +++ b/src/app/formulaire/definition/form-result-section.ts @@ -60,6 +60,10 @@ export class FormResultSection extends FormResult { public get results(): CalculatorResults[] { const res: CalculatorResults[] = []; + // ensure help links are propagated + this._fixedResults.helpLinks = this.helpLinks; + this._varResults.helpLinks = this.helpLinks; + this._sectionResults.helpLinks = this.helpLinks; res.push(this._fixedResults); res.push(this._varResults); res.push(this._sectionResults); diff --git a/src/app/formulaire/definition/form-result.ts b/src/app/formulaire/definition/form-result.ts index 07a3c55a057fe65b801eedf739aec2c03d478315..5e5fa62ebea1dcf30167f44e1a63132d432a0d6f 100644 --- a/src/app/formulaire/definition/form-result.ts +++ b/src/app/formulaire/definition/form-result.ts @@ -1,6 +1,10 @@ import { CalculatorResults } from "../../results/calculator-results"; export abstract class FormResult { + + /** copy of options.resultsHelp read by FormDefinition.parseOptions() */ + public helpLinks: { [key: string]: string }; + public abstract resetResults(); public abstract get hasResults(): boolean; diff --git a/src/app/formulaire/formulaire-node.ts b/src/app/formulaire/formulaire-node.ts index c1fb2930d7de6c3ab703833e58536a74495219f7..7425f0a9fe44ef509704b33aa4a56d360301aa1d 100644 --- a/src/app/formulaire/formulaire-node.ts +++ b/src/app/formulaire/formulaire-node.ts @@ -8,29 +8,19 @@ export abstract class FormulaireNode implements IObservable { /** aide en ligne */ protected _helpLink: string; - /** - * identifiant dans le fichier de conf - */ + /** identifiant dans le fichier de conf */ protected _confId: string; - /** - * id numérique unique - */ + /** id numérique unique */ private _uid: string; - /** - * parent direct - */ + /** parent direct */ private _parentNode: FormulaireNode; - /** - * enfants (utilisé entre autres pour FormulaireDefinition, FieldSet et FieldsetContainer) - */ + /** enfants (utilisé entre autres pour FormulaireDefinition, FieldSet et FieldsetContainer) */ private _kids: FormulaireNode[]; - /** - * implémentation par délégation de IObservable - */ + /** implémentation par délégation de IObservable */ private _observable: Observable; constructor(parent: FormulaireNode) { diff --git a/src/app/results/calculator-results.ts b/src/app/results/calculator-results.ts index 0fcc1c0901c576fa9c3a357d30d12044cd94fa93..a3f67c0cfc6c29a3ab1d6c37a0bc517227ab9788 100644 --- a/src/app/results/calculator-results.ts +++ b/src/app/results/calculator-results.ts @@ -7,6 +7,9 @@ import { sprintf } from "sprintf-js"; export abstract class CalculatorResults { + /** help links by result symbol, read from calculator config */ + public helpLinks: { [key: string]: string }; + /** * @param p parameter to generate label for * @param displaySymbol if true, will prefix label with parameter symbol (ex: "ZDV") @@ -51,4 +54,17 @@ export abstract class CalculatorResults { * indique si il existe des résultats à afficher */ public abstract get hasResults(): boolean; + + public getHelpLink(symbol: string): string { + // add help link if any + if (this.helpLinks !== undefined && this.helpLinks[symbol] !== undefined) { + // important: no ".html" is added after the link, to allow using anchors in config file + const helpURL = "assets/docs-fr/calculators/" + this.helpLinks[symbol]; + // pseudo-<mat-icon> dirty trick because <mat-icon> renderer cannot be + // triggered when code is set through innerHTML + return `<a href="${helpURL}" target="_blank"><span class="material-icons mat-accent">help</span></a>`; + } else { + return ""; + } + } } diff --git a/src/app/results/macrorugo-compound-results.ts b/src/app/results/macrorugo-compound-results.ts index dbcdaa4559f4169252885d5ff6b6c385758280b3..dd1e177f502f5087fd206e1e88820ba65fc51ecc 100644 --- a/src/app/results/macrorugo-compound-results.ts +++ b/src/app/results/macrorugo-compound-results.ts @@ -46,7 +46,7 @@ export class MacrorugoCompoundResults extends MultiDimensionResults { if (sn.parent) { ct = sn.parent.calcType; } - let unit; + let unit: string; // is h a parameter ? If so, extract its unit try { const p = sn.getParameter(h); @@ -54,7 +54,9 @@ export class MacrorugoCompoundResults extends MultiDimensionResults { unit = p.unit; } } catch (e) { /* silent fail */ } - return ServiceFactory.instance.formulaireService.expandVariableNameAndUnit(ct , h, unit); + let label = ServiceFactory.instance.formulaireService.expandVariableNameAndUnit(ct , h, unit); + label += this.getHelpLink(h); + return label; }); } diff --git a/src/app/results/pab-results.ts b/src/app/results/pab-results.ts index 38a027703c7094770ef669610f815196b2e6a603..bcf4b2b688e409a06fc4daf9e7a9634424618a53 100644 --- a/src/app/results/pab-results.ts +++ b/src/app/results/pab-results.ts @@ -52,7 +52,9 @@ export class PabResults extends MultiDimensionResults { if (sn.parent) { ct = sn.parent.calcType; } - return ServiceFactory.instance.formulaireService.expandVariableNameAndUnit(ct , h); + let label = ServiceFactory.instance.formulaireService.expandVariableNameAndUnit(ct , h); + label += this.getHelpLink(h); + return label; }); } diff --git a/src/app/results/param-calc-results.ts b/src/app/results/param-calc-results.ts index 02ec6097eee6e2a1f65fb8c63e9eed04b1cbc1f5..60c0e257d0b40dd636f2d1ab62cb6e9964382674 100644 --- a/src/app/results/param-calc-results.ts +++ b/src/app/results/param-calc-results.ts @@ -7,19 +7,14 @@ import { Result, cLog } from "jalhyd"; * les autres étant tous fixés ou avec un paramètre varié */ export abstract class CalculatedParamResults extends CalculatorResults { - /** - * paramètre calculé - */ + + /** paramètre calculé */ protected _calculatedParam: NgParameter; - /** - * titre de la colonne - */ + /** titre de la colonne du paramètre calculé */ public calculatedParameterHeader: string; - /** - * résultat du calcul sur le paramètre calculé - */ + /** résultat du calcul sur le paramètre calculé */ public result: Result; /** custom variables order for results tables */ diff --git a/src/app/results/remous-results.ts b/src/app/results/remous-results.ts index acb80ff6883789e4ee85e72f0b12202d4d912a80..ba7c03a9590464f90bbcbcefe1274d3766abfec0 100644 --- a/src/app/results/remous-results.ts +++ b/src/app/results/remous-results.ts @@ -151,6 +151,7 @@ export class RemousResults extends CalculatorResults { keys.push(this.extraParamSymbol); } this._varResults.resultKeys = keys; + this._varResults.helpLinks = this.helpLinks; this._varResults.update(); } diff --git a/src/app/results/var-results.ts b/src/app/results/var-results.ts index 47a49e5f18f6d0a152fefb770a0caa5bb4dd0a66..3594635b688b37996e7779b5684bc136d97a847c 100644 --- a/src/app/results/var-results.ts +++ b/src/app/results/var-results.ts @@ -312,7 +312,9 @@ export class VarResults extends CalculatedParamResults implements PlottableData public update() { // refresh param headers this._variableParamHeaders = this._variatedParams.map((v) => { - return CalculatorResults.paramLabel(v, true, this.result.sourceNub); + let h = CalculatorResults.paramLabel(v, true, this.result.sourceNub); + h += this.getHelpLink(v.symbol); + return h; }); // liste la plus longue @@ -364,9 +366,9 @@ export class VarResults extends CalculatedParamResults implements PlottableData unit = p.unit; } } catch (e) { /* silent fail */ } - this._resultHeaders.push( - ServiceFactory.instance.formulaireService.expandVariableNameAndUnit(ct, k, unit) - ); + let rh = ServiceFactory.instance.formulaireService.expandVariableNameAndUnit(ct, k, unit); + rh += this.getHelpLink(k); + this._resultHeaders.push(rh); } // entêtes des résultats des enfants for (const c of sn.getChildren()) { @@ -374,11 +376,11 @@ export class VarResults extends CalculatedParamResults implements PlottableData const cn = capitalize(ServiceFactory.instance.i18nService.childName(sn)); // using latest ResultElement; results count / types are supposed to be the same on every iteration for (const k of c.result.resultElement.keys) { - this._resultHeaders.push( - sprintf(ServiceFactory.instance.i18nService.localizeText("INFO_STUFF_N"), cn) - + (c.findPositionInParent() + 1) + " : " - + ServiceFactory.instance.formulaireService.expandVariableNameAndUnit(ct, k) - ); + let rh = sprintf(ServiceFactory.instance.i18nService.localizeText("INFO_STUFF_N"), cn) + + (c.findPositionInParent() + 1) + " : " + + ServiceFactory.instance.formulaireService.expandVariableNameAndUnit(ct, k); + rh += this.getHelpLink(k); + this._resultHeaders.push(rh); } } }