From 6964f49b8b026e5e0b778d418bb358f451a69cc4 Mon Sep 17 00:00:00 2001 From: Kim Date: Tue, 29 Aug 2023 11:34:35 +0200 Subject: [PATCH] Widened Search --- .../src/components/Installations/InstallationList.tsx | 7 ++++++- typescript/Frontend/src/components/Users/UserList.tsx | 6 ++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/typescript/Frontend/src/components/Installations/InstallationList.tsx b/typescript/Frontend/src/components/Installations/InstallationList.tsx index 86f4c30cb..87d3010f1 100644 --- a/typescript/Frontend/src/components/Installations/InstallationList.tsx +++ b/typescript/Frontend/src/components/Installations/InstallationList.tsx @@ -23,7 +23,12 @@ const filterData = ( return data.filter( (installation) => installation.name.toLowerCase().includes(searchQuery.toLowerCase()) || - installation.location.toLowerCase().includes(searchQuery.toLowerCase()) + installation.location.toLowerCase().includes(searchQuery.toLowerCase()) || + installation.region.toLowerCase().includes(searchQuery.toLowerCase()) || + installation.information.toLowerCase().includes(searchQuery.toLowerCase())|| + installation.orderNumbers.includes(searchQuery.toLowerCase())|| + installation.country.toLowerCase().includes(searchQuery.toLowerCase())|| + (installation.detail && installation.detail.toLowerCase().includes(searchQuery.toLowerCase())) ); } return data; diff --git a/typescript/Frontend/src/components/Users/UserList.tsx b/typescript/Frontend/src/components/Users/UserList.tsx index 544ddaf18..0b4cda627 100644 --- a/typescript/Frontend/src/components/Users/UserList.tsx +++ b/typescript/Frontend/src/components/Users/UserList.tsx @@ -21,8 +21,10 @@ const getPathWithoutId = (path?: string) => { const filterData = (searchQuery: string, data: I_User[] | undefined) => { if (data) { - return data.filter((installation) => - installation.name.toLowerCase().includes(searchQuery.toLowerCase()) + return data.filter((user) => + user.name.toLowerCase().includes(searchQuery.toLowerCase()) || + user.email.toLowerCase().includes(searchQuery.toLowerCase()) || + user.information.toLowerCase().includes(searchQuery.toLowerCase()) ); } return data;