From f6e46ab59d397b41ec989a5d76af417c884d2d8d Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Wed, 24 Aug 2022 19:01:54 +0200 Subject: [PATCH] change(ui) - add metric dashboard on create based on the curre path --- .../components/Dashboard/components/WidgetForm/WidgetForm.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/app/components/Dashboard/components/WidgetForm/WidgetForm.tsx b/frontend/app/components/Dashboard/components/WidgetForm/WidgetForm.tsx index af9dc296e..b613bd370 100644 --- a/frontend/app/components/Dashboard/components/WidgetForm/WidgetForm.tsx +++ b/frontend/app/components/Dashboard/components/WidgetForm/WidgetForm.tsx @@ -79,6 +79,8 @@ function WidgetForm(props: Props) { if (wasCreating) { if (parseInt(dashboardId) > 0) { history.replace(withSiteId(dashboardMetricDetails(dashboardId, metric.metricId), siteId)); + const dashboard = dashboardStore.getDashboard(parseInt(dashboardId)) + dashboardStore.addWidgetToDashboard(dashboard, [metric.metricId]) } else { history.replace(withSiteId(metricDetails(metric.metricId), siteId)); }