From e249e30629b87c33d27c33109013d488cb4bfaad Mon Sep 17 00:00:00 2001
From: "mathias.chouet" <mathias.chouet@irstea.fr>
Date: Wed, 2 Sep 2020 16:13:25 +0200
Subject: [PATCH] Search engine: also search in short title #428

---
 .../components/calculator-list/calculator-list.component.ts  | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/app/components/calculator-list/calculator-list.component.ts b/src/app/components/calculator-list/calculator-list.component.ts
index ed2710834..6dc05bea1 100644
--- a/src/app/components/calculator-list/calculator-list.component.ts
+++ b/src/app/components/calculator-list/calculator-list.component.ts
@@ -87,6 +87,7 @@ export class CalculatorListComponent implements OnInit {
                         item.calculators.push({
                             type: calcType,
                             label: ServiceFactory.formulaireService.getLocalisedTitleFromCalculatorType(calcType),
+                            shortLabel: ServiceFactory.formulaireService.getLocalisedShortTitleFromCalculatorType(calcType),
                             description: ServiceFactory.formulaireService.getLocalisedDescriptionFromCalculatorType(calcType),
                             buttonId: "create-calc-" + calcType
                         });
@@ -121,6 +122,8 @@ export class CalculatorListComponent implements OnInit {
                         unusedTheme.calculators.push({
                             type: t,
                             label: ServiceFactory.formulaireService.getLocalisedTitleFromCalculatorType(t),
+                            shortLabel: ServiceFactory.formulaireService.getLocalisedShortTitleFromCalculatorType(t),
+                            description: ServiceFactory.formulaireService.getLocalisedDescriptionFromCalculatorType(t),
                             buttonId: "create-calc-" + t
                         });
                     }
@@ -205,7 +208,7 @@ export class CalculatorListComponent implements OnInit {
             // filter items based on parent component's search field
             for (const i of this.filteredItems) {
                 i.calculators = i.calculators.filter((c) => {
-                    return this.searchMatches(c.label) || this.searchMatches(c.description);
+                    return this.searchMatches(c.label) || this.searchMatches(c.shortLabel) || this.searchMatches(c.description);
                 });
             }
             this.filteredItems = this.filteredItems.filter((i) => {
-- 
GitLab