From e719a1bdc0637388f2f5b98312aac5a7fabab5a0 Mon Sep 17 00:00:00 2001 From: nick-delirium Date: Tue, 24 Dec 2024 15:17:59 +0100 Subject: [PATCH] ui: lower default density to 35, fix table card display --- .../app/components/Dashboard/Widgets/CardSessionsByList.tsx | 2 +- .../Dashboard/components/WidgetChart/WidgetChart.tsx | 4 +++- frontend/app/mstore/types/widget.ts | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/app/components/Dashboard/Widgets/CardSessionsByList.tsx b/frontend/app/components/Dashboard/Widgets/CardSessionsByList.tsx index 5f2efe77d..7d3dabc73 100644 --- a/frontend/app/components/Dashboard/Widgets/CardSessionsByList.tsx +++ b/frontend/app/components/Dashboard/Widgets/CardSessionsByList.tsx @@ -17,7 +17,7 @@ interface Props { function CardSessionsByList({ list, selected, paginated, onClickHandler = () => null, metric, total }: Props) { const { dashboardStore, metricStore, sessionStore } = useStore(); const drillDownPeriod = dashboardStore.drillDownPeriod; - const params = { density: 70 }; + const params = { density: 35 }; const metricParams = { ...params }; const [loading, setLoading] = React.useState(false); const data = paginated ? metric?.data[0]?.values : list; diff --git a/frontend/app/components/Dashboard/components/WidgetChart/WidgetChart.tsx b/frontend/app/components/Dashboard/components/WidgetChart/WidgetChart.tsx index 1ac9b7a7c..bdbb72999 100644 --- a/frontend/app/components/Dashboard/components/WidgetChart/WidgetChart.tsx +++ b/frontend/app/components/Dashboard/components/WidgetChart/WidgetChart.tsx @@ -513,12 +513,14 @@ function WidgetChart(props: Props) { return
Unknown metric type
; }, [data, compData, enabledRows, _metric]); + + const showTable = _metric.metricType === TIMESERIES && (props.isPreview || _metric.viewType === TABLE) return (
{renderChart()} - {props.isPreview && _metric.metricType === TIMESERIES ? ( + {showTable ? (