From b4a0961671229bed5b5608ba6502a93f4c64d529 Mon Sep 17 00:00:00 2001 From: Warren <5959690+wrn14897@users.noreply.github.com> Date: Thu, 14 Mar 2024 10:43:12 -0700 Subject: [PATCH] fix: include where clause for number chart (#344) --- packages/app/src/EditChartForm.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/app/src/EditChartForm.tsx b/packages/app/src/EditChartForm.tsx index 4b3951535..cd9cced8c 100644 --- a/packages/app/src/EditChartForm.tsx +++ b/packages/app/src/EditChartForm.tsx @@ -62,7 +62,9 @@ const buildAndWhereClause = (query1 = '', query2 = '') => { } }; -const withDashboardFilter = ( +const withDashboardFilter = < + T extends { where?: string; series?: ChartSeries[] }, +>( chartConfig: T | null, dashboardQuery?: string, ) => { @@ -75,7 +77,9 @@ const withDashboardFilter = ( ...s, where: buildAndWhereClause( dashboardQuery, - s.type === 'time' || s.type === 'table' ? s.where : '', + s.type === 'number' || s.type === 'time' || s.type === 'table' + ? s.where + : '', ), })) : undefined,