Skip to content

Commit

Permalink
fix: environment URL in CLI (#3426)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgeepc authored Dec 5, 2023
1 parent be2f70a commit f59ab68
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 24 deletions.
2 changes: 1 addition & 1 deletion agent/runner/runstrategy_desktop.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
51 changes: 28 additions & 23 deletions web/src/components/Router/Router.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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 = () => (
<Routes>
<Route element={<Layout hasMenu />}>
<Route path="/" element={<Home />} />
<Route path="/testsuites" element={<TestSuites />} />
<Route path="/variablesets" element={<VariableSet />} />
<Route path="/settings" element={<Settings />} />
</Route>
return (
<Routes>
<Route element={<Layout hasMenu />}>
<Route path="/" element={<Home />} />
<Route path="/testsuites" element={<TestSuites />} />
<Route path="/variablesets" element={<VariableSet />} />
<Route path="/settings" element={<Settings />} />
</Route>

<Route element={<Layout />}>
<Route path="/test/create/:triggerType" element={<CreateTest />} />
<Route path="/test/:testId" element={<Test />} />
<Route path="/test/:testId/run/:runId" element={<RunDetail />} />
<Route path="/test/:testId/run/:runId/:mode" element={<RunDetail />} />
<Route path="/test/:testId/run" element={<AutomatedTestRun />} />
<Route element={<Layout />}>
<Route path="/test/create/:triggerType" element={<CreateTest />} />
<Route path="/test/:testId" element={<Test />} />
<Route path="/test/:testId/run/:runId" element={<RunDetail />} />
<Route path="/test/:testId/run/:runId/:mode" element={<RunDetail />} />
<Route path="/test/:testId/run" element={<AutomatedTestRun />} />

<Route path="/testsuite/:testSuiteId" element={<TestSuite />} />
<Route path="/testsuite/:testSuiteId/run/:runId" element={<TestSuiteRunOverview />} />
<Route path="/testsuite/:testSuiteId/run/:runId/overview" element={<TestSuiteRunOverview />} />
<Route path="/testsuite/:testSuiteId/run/:runId/automate" element={<TestSuiteRunAutomate />} />
</Route>
<Route path="/testsuite/:testSuiteId" element={<TestSuite />} />
<Route path="/testsuite/:testSuiteId/run/:runId" element={<TestSuiteRunOverview />} />
<Route path="/testsuite/:testSuiteId/run/:runId/overview" element={<TestSuiteRunOverview />} />
<Route path="/testsuite/:testSuiteId/run/:runId/automate" element={<TestSuiteRunAutomate />} />
</Route>

<Route path="*" element={<Navigate to="/" />} />
</Routes>
);
<Route path="*" element={<Navigate to={baseUrl || '/'} />} />
</Routes>
);
};

export default Router;

0 comments on commit f59ab68

Please sign in to comment.