From 1f9f78ca0f6e5e9a647e52f826bbd526fa996238 Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Tue, 3 Jan 2023 17:21:37 +0100 Subject: [PATCH] feat(ui) - fixes --- .../ResponseTimeDistribution.tsx | 2 +- .../SpeedIndexByLocation.tsx | 1 + .../DashboardWidgetGrid.tsx | 2 +- .../components/WidgetForm/WidgetForm.tsx | 1 + .../WidgetSubDetailsView.tsx | 2 +- .../components/WidgetView/WidgetView.tsx | 2 +- .../shared/Filters/FilterList/FilterList.tsx | 2 +- frontend/app/constants/card.ts | 18 +++++++++--------- frontend/app/mstore/types/widget.ts | 2 +- 9 files changed, 17 insertions(+), 15 deletions(-) diff --git a/frontend/app/components/Dashboard/Widgets/PredefinedWidgets/ResponseTimeDistribution/ResponseTimeDistribution.tsx b/frontend/app/components/Dashboard/Widgets/PredefinedWidgets/ResponseTimeDistribution/ResponseTimeDistribution.tsx index 548a229ab..4326b3b3a 100644 --- a/frontend/app/components/Dashboard/Widgets/PredefinedWidgets/ResponseTimeDistribution/ResponseTimeDistribution.tsx +++ b/frontend/app/components/Dashboard/Widgets/PredefinedWidgets/ResponseTimeDistribution/ResponseTimeDistribution.tsx @@ -87,7 +87,7 @@ function ResponseTimeDistribution(props: Props) { /> 'Page Response Time: ' + val} /> - { metric.data.percentiles.map((item, i) => ( + { metric.data.percentiles && metric.data.percentiles.map((item: any, i: number) => ( Math.max(acc, item.value), 0); const min = metric.data.chart.reduce((acc: any, item: any) => Math.min(acc, item.value), 0); metric.data.chart.forEach((item: any) => { + if (!item || !item.userCountry) { return } item.perNumber = positionOfTheNumber(min, max, item.value, 5); data[item.userCountry.toLowerCase()] = item; }); diff --git a/frontend/app/components/Dashboard/components/DashboardWidgetGrid/DashboardWidgetGrid.tsx b/frontend/app/components/Dashboard/components/DashboardWidgetGrid/DashboardWidgetGrid.tsx index ba0c33c3d..3b25bbf22 100644 --- a/frontend/app/components/Dashboard/components/DashboardWidgetGrid/DashboardWidgetGrid.tsx +++ b/frontend/app/components/Dashboard/components/DashboardWidgetGrid/DashboardWidgetGrid.tsx @@ -83,7 +83,7 @@ function DashboardWidgetGrid(props: Props) { {smallWidgets.length > 0 && regularWidgets.length > 0 ? (
- All Metrics + All Cards
) : null} diff --git a/frontend/app/components/Dashboard/components/WidgetForm/WidgetForm.tsx b/frontend/app/components/Dashboard/components/WidgetForm/WidgetForm.tsx index db0525aab..bc8429d87 100644 --- a/frontend/app/components/Dashboard/components/WidgetForm/WidgetForm.tsx +++ b/frontend/app/components/Dashboard/components/WidgetForm/WidgetForm.tsx @@ -78,6 +78,7 @@ function WidgetForm(props: Props) { break; case ERRORS: case RESOURCE_MONITORING: + case PERFORMANCE: case WEB_VITALS: obj.viewType = 'chart'; break; diff --git a/frontend/app/components/Dashboard/components/WidgetSubDetailsView/WidgetSubDetailsView.tsx b/frontend/app/components/Dashboard/components/WidgetSubDetailsView/WidgetSubDetailsView.tsx index 261e77efd..2cbfe12e7 100644 --- a/frontend/app/components/Dashboard/components/WidgetSubDetailsView/WidgetSubDetailsView.tsx +++ b/frontend/app/components/Dashboard/components/WidgetSubDetailsView/WidgetSubDetailsView.tsx @@ -30,7 +30,7 @@ function WidgetSubDetailsView(props: Props) {