diff --git a/src/app/formulaire/elements/select/select-field-searched-param.ts b/src/app/formulaire/elements/select/select-field-searched-param.ts index 8811ef81f441628e39164f0f46404fa8cf1a1d4c..2b5e1a501eae2e55f34a13dfef7fa28162c73d31 100644 --- a/src/app/formulaire/elements/select/select-field-searched-param.ts +++ b/src/app/formulaire/elements/select/select-field-searched-param.ts @@ -23,11 +23,12 @@ export class SelectFieldSearchedParam extends SelectField { ntc, solv.targettedResult !== undefined && solv.targettedResult !== "" ); + for (const p of searchableParams) { if (p.visible) { - const calc = fs.getFormulaireFromId(p.originNub.uid).calculatorName; + const calcTitle = fs.getTitlebyIdOnSelectedLoadedNubs(p.originNub.uid).title; const varName = fs.expandVariableName(p.originNub.calcType, p.symbol); - const label = `${p.symbol} - ${varName} (${calc})`; + const label = `${p.symbol} - ${varName} (${calcTitle})`; this.addEntry(this.createOrGetEntry(this._entriesBaseId + p.getParentComputeNode(false).uid + "_" + p.symbol, p, decodeHtml(label))); } } diff --git a/src/app/services/formulaire.service.ts b/src/app/services/formulaire.service.ts index ad8d6b1b131745c1c52497d70642112338a46b48..24c3c820b630833b0eb9db78f945f47ae82d8566 100644 --- a/src/app/services/formulaire.service.ts +++ b/src/app/services/formulaire.service.ts @@ -71,6 +71,8 @@ export class FormulaireService extends Observable { private _currentFormId: string = null; + private _selectedLoadedNubs: any[] = []; + public static getConfigPathPrefix(ct: CalculatorType): string { const ctName = CalculatorType[ct].toLowerCase(); return "app/calculators/" + ctName + "/"; @@ -91,6 +93,10 @@ export class FormulaireService extends Observable { return this._formulaires; } + public getTitlebyIdOnSelectedLoadedNubs(uid: string) { + return this._selectedLoadedNubs.find(selectedNub => selectedNub.uid === uid) + } + /** Removes all formulaires from the list */ public clearFormulaires() { this._formulaires = []; @@ -646,6 +652,7 @@ export class FormulaireService extends Observable { // disable "empty fields" flag temporarly const emptyFields = ServiceFactory.applicationSetupService.enableEmptyFieldsOnFormInit; ServiceFactory.applicationSetupService.enableEmptyFieldsOnFormInit = false; + this._selectedLoadedNubs = formInfos; let s; if (i instanceof Blob) { @@ -700,6 +707,10 @@ export class FormulaireService extends Observable { } } + getSelectedLoadedNubs() { + return this._selectedLoadedNubs; + } + /** * Sends an UTF-8 text file for download */