From c1af05fbbe493ecc1143e3960ff9cad9cfb46088 Mon Sep 17 00:00:00 2001 From: sylenien Date: Tue, 17 May 2022 16:17:29 +0200 Subject: [PATCH] fix(ui): fix metrics table width, fix reload pathing --- frontend/app/components/Dashboard/NewDashboard.tsx | 3 +-- .../Dashboard/components/MetricsView/MetricsView.tsx | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/frontend/app/components/Dashboard/NewDashboard.tsx b/frontend/app/components/Dashboard/NewDashboard.tsx index b3e6ac59f..106852923 100644 --- a/frontend/app/components/Dashboard/NewDashboard.tsx +++ b/frontend/app/components/Dashboard/NewDashboard.tsx @@ -12,7 +12,6 @@ function NewDashboard(props: RouteComponentProps<{}>) { const { history, match: { params: { siteId, dashboardId, metricId } } } = props; const { dashboardStore } = useStore(); const loading = useObserver(() => dashboardStore.isLoading); - const dashboardsNumber = useObserver(() => dashboardStore.dashboards.length); const isMetricDetails = history.location.pathname.includes('/metrics/') || history.location.pathname.includes('/metric/'); useEffect(() => { @@ -21,7 +20,7 @@ function NewDashboard(props: RouteComponentProps<{}>) { dashboardStore.selectDashboardById(dashboardId); } }); - if (!dashboardId) { + if (!dashboardId && location.pathname.includes('dashboard')) { dashboardStore.selectDefaultDashboard().then(({ dashboardId }) => { props.history.push(withSiteId(`/dashboard/${dashboardId}`, siteId)); }, () => { diff --git a/frontend/app/components/Dashboard/components/MetricsView/MetricsView.tsx b/frontend/app/components/Dashboard/components/MetricsView/MetricsView.tsx index 9fffa8624..41ffbd659 100644 --- a/frontend/app/components/Dashboard/components/MetricsView/MetricsView.tsx +++ b/frontend/app/components/Dashboard/components/MetricsView/MetricsView.tsx @@ -18,7 +18,7 @@ function MetricsView(props: Props) { metricStore.fetchList(); }, []); return useObserver(() => ( -
+