From d3bed3072b953810eb23b9cfbba24527151d38bb Mon Sep 17 00:00:00 2001 From: Chaim Lev-Ari Date: Thu, 12 Jan 2023 15:02:37 +0200 Subject: [PATCH] fix(home): link to correct env route [EE-4877] (#8295) --- .../EnvironmentBrowseButtons.tsx | 8 ++-- .../EnvironmentItem/EnvironmentItem.tsx | 8 ++-- .../portainer/environments/utils/index.ts | 38 +++++++++++++------ 3 files changed, 33 insertions(+), 21 deletions(-) diff --git a/app/react/portainer/HomeView/EnvironmentList/EnvironmentItem/EnvironmentBrowseButtons.tsx b/app/react/portainer/HomeView/EnvironmentList/EnvironmentItem/EnvironmentBrowseButtons.tsx index 9c5a00217..36390a53e 100644 --- a/app/react/portainer/HomeView/EnvironmentList/EnvironmentItem/EnvironmentBrowseButtons.tsx +++ b/app/react/portainer/HomeView/EnvironmentList/EnvironmentItem/EnvironmentBrowseButtons.tsx @@ -23,6 +23,8 @@ export function EnvironmentBrowseButtons({ }) { const isEdgeAsync = checkEdgeAsync(environment); const browseStatus = getStatus(isActive, isEdgeAsync); + + const dashboardRoute = getDashboardRoute(environment); return (
{isBE && ( @@ -44,10 +46,8 @@ export function EnvironmentBrowseButtons({ title="Live connection is not available for async environments" icon={Wifi} disabled={isEdgeAsync || browseStatus === 'connected'} - to={getDashboardRoute(environment)} - params={{ - endpointId: environment.Id, - }} + to={dashboardRoute.to} + params={dashboardRoute.params} onClick={onClickBrowse} color="primary" className="w-full !py-0 !m-0" diff --git a/app/react/portainer/HomeView/EnvironmentList/EnvironmentItem/EnvironmentItem.tsx b/app/react/portainer/HomeView/EnvironmentList/EnvironmentItem/EnvironmentItem.tsx index c71d2c3a4..56ca35c56 100644 --- a/app/react/portainer/HomeView/EnvironmentList/EnvironmentItem/EnvironmentItem.tsx +++ b/app/react/portainer/HomeView/EnvironmentList/EnvironmentItem/EnvironmentItem.tsx @@ -47,15 +47,13 @@ export function EnvironmentItem({ const snapshotTime = getSnapshotTime(environment); const tags = useEnvironmentTagNames(environment.TagIds); + const dashboardRoute = getDashboardRoute(environment); return (