Skip to content
Snippets Groups Projects
Commit 40bff3f0 authored by AUBRY JEAN-PASCAL's avatar AUBRY JEAN-PASCAL
Browse files

fix: change way to get search parameter related calculator title

Refs #668
parent 5b62e18f
No related branches found
No related tags found
2 merge requests!275Release v4.19.0,!265Resolve "Solveur: Les select d'une session chargée ne s'initialise pas"
Pipeline #204434 passed
This commit is part of merge request !265. Comments created here will be created in the context of that merge request.
......@@ -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)));
}
}
......
......@@ -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
*/
......
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