diff --git a/desktop/core/src/desktop/js/apps/admin/Metrics/MetricsTab.tsx b/desktop/core/src/desktop/js/apps/admin/Metrics/MetricsTab.tsx index 07e350ba5e2..4411773c3c8 100644 --- a/desktop/core/src/desktop/js/apps/admin/Metrics/MetricsTab.tsx +++ b/desktop/core/src/desktop/js/apps/admin/Metrics/MetricsTab.tsx @@ -60,9 +60,14 @@ const Metrics: React.FC = (): JSX.Element => { return; } - const filteredData = parseMetricsData(metrics).filter(tableData => - tableData.dataSource.some(data => data.name.toLowerCase().includes(searchQuery.toLowerCase())) - ); + const filteredData = parseMetricsData(metrics) + .map(tableData => ({ + ...tableData, + dataSource: tableData.dataSource.filter(data => + data.name.toLowerCase().includes(searchQuery.toLowerCase()) + ) + })) + .filter(tableData => tableData.dataSource.length > 0); setFilteredMetricsData(filteredData); }, [searchQuery, metrics]);