Skip to content

Commit edafff7

Browse files
committed
chore: navigation wip
1 parent 5dd1c02 commit edafff7

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

src/components/observability/CustomerListCellComponent.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { FunctionComponent, useEffect, useRef } from 'react'
2-
import { Link } from 'react-router-dom'
2+
import { Link, useRouteMatch } from 'react-router-dom'
33

44
import {
55
FiltersTypeEnum,
6+
getUrlWithSearchParams,
67
TableCellComponentProps,
78
TableSignalEnum,
89
Tooltip,
@@ -22,6 +23,8 @@ export const CustomerListCellComponent: FunctionComponent<
2223
}: TableCellComponentProps<CustomerObservabilityDTO, FiltersTypeEnum.STATE, {}>) => {
2324
const linkRef = useRef<HTMLAnchorElement>(null)
2425

26+
const match = useRouteMatch()
27+
2528
useEffect(() => {
2629
const handleEnter = ({ detail: { activeRowData } }) => {
2730
if (activeRowData.data.id === id) {
@@ -41,7 +44,11 @@ export const CustomerListCellComponent: FunctionComponent<
4144
switch (field) {
4245
case ProjectListFields.PROJECT_NAME:
4346
return (
44-
<Link ref={linkRef} to="test" className="flex left py-10">
47+
<Link
48+
ref={linkRef}
49+
to={getUrlWithSearchParams(match.path, { customer: name })}
50+
className="flex left py-10"
51+
>
4552
<Tooltip content={name}>
4653
<span className="dc__truncate">{name}</span>
4754
</Tooltip>

src/components/observability/ObservabilityRouter.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,27 @@ import { Redirect, Route, Switch, useRouteMatch } from 'react-router-dom'
22

33
import { URLS } from '@devtron-labs/devtron-fe-common-lib'
44

5-
import VM from './VMObservability/VM'
5+
import Project from './ProjectObservability/Project'
66
import Customers from './Customers'
7+
import { Overview } from './Overview'
78

89
const ObservabilityRouter: React.FC = () => {
910
const { path } = useRouteMatch()
1011
return (
1112
<Switch>
1213
<Route exact path={URLS.OBSERVABILITY_OVERVIEW}>
13-
<VM />
14+
<Overview />
1415
</Route>
1516

1617
<Route exact path={URLS.OBSERVABILITY_CUSTOMER_LIST}>
1718
<Customers />
1819
</Route>
1920

20-
<Redirect exact from={path} to={URLS.OBSERVABILITY} />
21+
<Route exact path={`${URLS.OBSERVABILITY_CUSTOMER_LIST}/:customer`}>
22+
<Project />
23+
</Route>
24+
25+
<Redirect exact from={path} to={URLS.OBSERVABILITY_OVERVIEW} />
2126
</Switch>
2227
)
2328
}

0 commit comments

Comments
 (0)