From eaa9a5f1a05f65cde97ce7e79978e4f0a2a551ab Mon Sep 17 00:00:00 2001 From: Simon Larsen Date: Thu, 28 Nov 2024 14:11:13 +0000 Subject: [PATCH] Make metricAliasData optional in MetricView component for improved safety and handling --- Dashboard/src/Components/Metrics/MetricView.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dashboard/src/Components/Metrics/MetricView.tsx b/Dashboard/src/Components/Metrics/MetricView.tsx index 13d3ca72bb..3f14f54d38 100644 --- a/Dashboard/src/Components/Metrics/MetricView.tsx +++ b/Dashboard/src/Components/Metrics/MetricView.tsx @@ -248,7 +248,7 @@ const MetricView: FunctionComponent = ( } else { chartSeries.push({ seriesName: - queryConfig.metricAliasData.title || + queryConfig.metricAliasData?.title || queryConfig.metricQueryData.filterData.metricName?.toString() || "", data: metricResults[index]!.data.map((result: AggregatedModel) => { @@ -264,10 +264,10 @@ const MetricView: FunctionComponent = ( id: index.toString(), type: ChartType.LINE, title: - queryConfig.metricAliasData.title || + queryConfig.metricAliasData?.title || queryConfig.metricQueryData.filterData.metricName?.toString() || "", - description: queryConfig.metricAliasData.description, + description: queryConfig.metricAliasData?.description || "", props: { data: chartSeries, xAxis: {