change(ui) - add metric dashboard on create based on the curre path

This commit is contained in:
Shekar Siri 2022-08-24 19:01:54 +02:00
parent ddcffef3b4
commit f6e46ab59d

View file

@ -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));
}