From 396c442062ab9d7a1e06c76b379637170bda3536 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Malak?= Date: Sat, 8 Jan 2022 12:48:33 +0100 Subject: [PATCH] Added app descriptions to local search parser --- CHANGELOG.md | 3 +++ client/src/components/Home/Home.tsx | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 008f899..ce9aec0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +### v2.X.Y (TBA) +- Local search will now include app descriptions ([#266](https://github.com/pawelmalak/flame/issues/266)) + ### v2.2.0 (2021-12-17) - Added option to set custom description for apps ([#201](https://github.com/pawelmalak/flame/issues/201)) - Fixed fatal error while deploying Flame to cluster ([#242](https://github.com/pawelmalak/flame/issues/242)) diff --git a/client/src/components/Home/Home.tsx b/client/src/components/Home/Home.tsx index e24e5c0..629ed89 100644 --- a/client/src/components/Home/Home.tsx +++ b/client/src/components/Home/Home.tsx @@ -64,8 +64,10 @@ export const Home = (): JSX.Element => { if (localSearch) { // Search through apps setAppSearchResult([ - ...apps.filter(({ name }) => - new RegExp(escapeRegex(localSearch), 'i').test(name) + ...apps.filter(({ name, description }) => + new RegExp(escapeRegex(localSearch), 'i').test( + `${name} ${description}` + ) ), ]);