From 73851831ccf2c9b008160e5d06f6d2e6a3ec6a2e Mon Sep 17 00:00:00 2001 From: Chris Van Emmerik Date: Thu, 21 Nov 2024 19:10:00 -0700 Subject: [PATCH] Enable fuzzy filter, remove excess logging. --- src/components/application/GenericTable/helpers.tsx | 3 +-- src/components/pages/useAppTableData.tsx | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/components/application/GenericTable/helpers.tsx b/src/components/application/GenericTable/helpers.tsx index 0ba256e..7c6416c 100644 --- a/src/components/application/GenericTable/helpers.tsx +++ b/src/components/application/GenericTable/helpers.tsx @@ -106,8 +106,7 @@ export const table_filter = (data, columnfilter: ColumnFilter, searchtext = '', ); if (fuzzyFilter) { - return filtered; - //return fuzzyFilter(data, filtered, searchtext, customFilter); + return fuzzyFilter(data, filtered, searchtext, customFilter); } else { return filtered; } diff --git a/src/components/pages/useAppTableData.tsx b/src/components/pages/useAppTableData.tsx index 33067f2..a95a34d 100644 --- a/src/components/pages/useAppTableData.tsx +++ b/src/components/pages/useAppTableData.tsx @@ -18,14 +18,12 @@ export const fuzzySortFilter = (data, filtered, searchtext, customFilter) => { if (filtered?.length < 10) { // Only perform fuzzy filtering if there are < 10 exact match results const fuzzyResults = fuzzysort.go(searchtext, data, { key: 'name', limit: 20 }) as any; - console.log({ fuzzyResults, searchtext }); var combined = [...filtered]; fuzzyResults?.forEach(fr => { if (!combined.find(r => r._id === fr?.obj?._id)) { // If no custom filter or custom filters (platform tags) match, then add fuzzy results // This prevents non matching platform tags from showing in the results if (!customFilter || customFilter(fr.obj, searchtext)) { - console.log('Adding fuzzy search result', fr); combined = combined.concat(fr.obj); } }