From f59ab68f11e3e9646d96b1e9b3d4230404fee403 Mon Sep 17 00:00:00 2001 From: Jorge Padilla Date: Tue, 5 Dec 2023 16:11:47 -0500 Subject: [PATCH] fix: environment URL in CLI (#3426) --- agent/runner/runstrategy_desktop.go | 2 +- web/src/components/Router/Router.tsx | 51 +++++++++++++++------------- 2 files changed, 29 insertions(+), 24 deletions(-) diff --git a/agent/runner/runstrategy_desktop.go b/agent/runner/runstrategy_desktop.go index aa72b7d3df..9805850680 100644 --- a/agent/runner/runstrategy_desktop.go +++ b/agent/runner/runstrategy_desktop.go @@ -51,7 +51,7 @@ You can` options := []consoleUI.Option{{ Text: "Open Tracetest in a browser to this environment", Fn: func(_ consoleUI.ConsoleUI) { - s.ui.OpenBrowser(fmt.Sprintf("%sorganizations/%s/environments/%s/dashboard", uiEndpoint, claims["organization_id"], claims["environment_id"])) + s.ui.OpenBrowser(fmt.Sprintf("%sorganizations/%s/environments/%s", uiEndpoint, claims["organization_id"], claims["environment_id"])) }, }, { Text: "Stop this agent", diff --git a/web/src/components/Router/Router.tsx b/web/src/components/Router/Router.tsx index ddbceabf40..475d97802b 100644 --- a/web/src/components/Router/Router.tsx +++ b/web/src/components/Router/Router.tsx @@ -1,5 +1,6 @@ import {Navigate, Route, Routes} from 'react-router-dom'; +import Layout from 'components/Layout/Layout'; import VariableSet from 'pages/VariableSet'; import Home from 'pages/Home'; import TestSuites from 'pages/TestSuites'; @@ -11,32 +12,36 @@ import TestSuiteRunOverview from 'pages/TestSuiteRunOverview'; import TestSuiteRunAutomate from 'pages/TestSuiteRunAutomate'; import AutomatedTestRun from 'pages/AutomatedTestRun'; import CreateTest from 'pages/CreateTest'; -import Layout from 'components/Layout/Layout'; +import {useDashboard} from 'providers/Dashboard/Dashboard.provider'; + +const Router = () => { + const {baseUrl} = useDashboard(); -const Router = () => ( - - }> - } /> - } /> - } /> - } /> - + return ( + + }> + } /> + } /> + } /> + } /> + - }> - } /> - } /> - } /> - } /> - } /> + }> + } /> + } /> + } /> + } /> + } /> - } /> - } /> - } /> - } /> - + } /> + } /> + } /> + } /> + - } /> - -); + } /> + + ); +}; export default Router;