From 41b9e38085ada88ee932399ef4b612a5fd00fc04 Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Mon, 14 Apr 2025 11:36:50 +0200 Subject: [PATCH] feat(ui): improve session count display and filter logic - Added `flex-shrink-0` class to session count text in `CardSessionsByList` for better layout handling. - Introduced conditional filter logic in `SessionsBy` to handle `FETCH` metric with specific `FETCH_URL` filter. - Removed unused filter mapping logic for cleaner code. This improves UI consistency and enhances filter functionality. --- .../Dashboard/Widgets/CardSessionsByList.tsx | 2 +- .../CustomMetricsWidgets/SessionsBy.tsx | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/frontend/app/components/Dashboard/Widgets/CardSessionsByList.tsx b/frontend/app/components/Dashboard/Widgets/CardSessionsByList.tsx index 5f2efe77d..4ebb9e814 100644 --- a/frontend/app/components/Dashboard/Widgets/CardSessionsByList.tsx +++ b/frontend/app/components/Dashboard/Widgets/CardSessionsByList.tsx @@ -57,7 +57,7 @@ function CardSessionsByList({ list, selected, paginated, onClickHandler = () =>
{row.displayName} - {row.sessionCount} + {row.sessionCount}
{ - const { key, operatorOptions, category, icon, label, options, ...cleaned } = f; - return { ...cleaned, type: f.key, value: [] }; - }) + filters: [], }; + if (metric.metricOf === FilterKey.FETCH) { + baseFilter.filters = [ + { + key: FilterKey.FETCH_URL, + operator: 'is', + value: [data.name], + type: FilterKey.FETCH_URL, + } + ]; + } + + + const { key, operatorOptions, category, icon, label, options, ...finalFilter } = baseFilter; setSelected(data.name);