From e10220039008f349f819a3e278a6776cd2007438 Mon Sep 17 00:00:00 2001 From: ransome1 Date: Sat, 23 Mar 2024 09:50:10 +0100 Subject: [PATCH] Fixed bug in group header button. --- src/renderer/Grid/DatePickerInline.tsx | 2 +- src/renderer/Grid/Renderer.tsx | 8 ++++---- src/renderer/Shared.tsx | 11 +++++++---- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/renderer/Grid/DatePickerInline.tsx b/src/renderer/Grid/DatePickerInline.tsx index e9930eb5..25bc29be 100644 --- a/src/renderer/Grid/DatePickerInline.tsx +++ b/src/renderer/Grid/DatePickerInline.tsx @@ -66,7 +66,7 @@ const DatePickerInline: React.FC = ({ ), projects: (value, type) => ( - ), rec: (value, type) => ( - ), pm: (value, type) => ( - diff --git a/src/renderer/Shared.tsx b/src/renderer/Shared.tsx index e8b86b06..b3f3ad44 100644 --- a/src/renderer/Shared.tsx +++ b/src/renderer/Shared.tsx @@ -16,16 +16,18 @@ export const handleFilterSelect = (key: string, name: string, values: string | s const updatedFilters: Filters = { ...filters }; const filterList: Filter[] = updatedFilters[key] || []; + const normalizedValues = typeof values === 'string' ? [values] : values; + const filterIndex = filterList.findIndex((filter: Filter) => { - return Array.isArray(values) && Array.isArray(filter.values) ? - values.every(v => filter.values.includes(v)) : - filter.values === values; + return Array.isArray(normalizedValues) && Array.isArray(filter.values) ? + normalizedValues.every(v => filter.values.includes(v)) : + filter.values === normalizedValues; }); if (filterIndex !== -1) { filterList.splice(filterIndex, 1); } else { - filterList.push({ name, values, exclude }); + filterList.push({ name, values: normalizedValues, exclude }); } updatedFilters[key] = filterList; @@ -35,6 +37,7 @@ export const handleFilterSelect = (key: string, name: string, values: string | s } }; + export const handleLinkClick = (event: MouseEvent, url: string) => { event.preventDefault(); event.stopPropagation();