Add validation for start and end date in MetricView to prevent loading without valid dates

This commit is contained in:
Simon Larsen 2024-11-12 11:42:25 +00:00
parent a98fc6f784
commit ae002c0d88
No known key found for this signature in database
GPG Key ID: 96C5DCA24769DBCA

View File

@ -396,6 +396,14 @@ const MetricView: FunctionComponent<ComponentProps> = (
async (): Promise<void> => { async (): Promise<void> => {
setIsMetricResultsLoading(true); setIsMetricResultsLoading(true);
if (
!metricViewData.startAndEndDate?.startValue ||
!metricViewData.startAndEndDate?.endValue
) {
setIsMetricResultsLoading(false);
return;
}
const results: Array<AggregatedResult> = []; const results: Array<AggregatedResult> = [];
try { try {
for (const queryConfig of metricViewData.queryConfigs) { for (const queryConfig of metricViewData.queryConfigs) {