From 2fa7df09dcc5fc174770f53e6a4e02e68449def1 Mon Sep 17 00:00:00 2001 From: igorrCarvalho Date: Tue, 30 Apr 2024 17:09:03 -0300 Subject: [PATCH] Refactor: make global variables search input case insensitive --- src/frontend/src/components/inputComponent/index.tsx | 2 +- .../SettingsPage/pages/GlobalVariablesPage/index.tsx | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/frontend/src/components/inputComponent/index.tsx b/src/frontend/src/components/inputComponent/index.tsx index 4f3a207cc..e18c2b559 100644 --- a/src/frontend/src/components/inputComponent/index.tsx +++ b/src/frontend/src/components/inputComponent/index.tsx @@ -173,7 +173,7 @@ export default function InputComponent({ > { - if (value.includes(search) || value.includes("doNotFilter-")) + if (value.toLowerCase().includes(search.toLowerCase()) || value.includes("doNotFilter-")) return 1; // ensures items arent filtered return 0; }} diff --git a/src/frontend/src/pages/SettingsPage/pages/GlobalVariablesPage/index.tsx b/src/frontend/src/pages/SettingsPage/pages/GlobalVariablesPage/index.tsx index cc65efcdb..955a7cccd 100644 --- a/src/frontend/src/pages/SettingsPage/pages/GlobalVariablesPage/index.tsx +++ b/src/frontend/src/pages/SettingsPage/pages/GlobalVariablesPage/index.tsx @@ -41,14 +41,15 @@ export default function GlobalVariablesPage() { useEffect(() => { const rows:Array<{type: string | undefined; id: string; name: string;default_fields:string | undefined}> = []; - globalVariablesEntries.forEach((e) => { - const globalVariableObj = globalVariables[e]; - console.log(globalVariableObj); + + globalVariablesEntries.forEach((entrie) => { + const globalVariableObj = globalVariables[entrie]; + rows.push({ type: globalVariableObj.type, id: globalVariableObj.id, default_fields: (globalVariableObj.default_fields??[]).join(", "), - name: e, + name: entrie, }); }); console.log(rows);