Skip to content

Commit

Permalink
fix links
Browse files Browse the repository at this point in the history
  • Loading branch information
maciaszczykm committed Mar 25, 2024
1 parent 5ebeb8a commit a351bc3
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 36 deletions.
10 changes: 6 additions & 4 deletions assets/src/components/kubernetes/cluster/Events.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { createColumnHelper } from '@tanstack/react-table'

import { Link } from 'react-router-dom'

import {
Common_EventList as EventListT,
Common_Event as EventT,
Expand Down Expand Up @@ -42,12 +44,12 @@ const colObjectNamespace = columnHelper.accessor(
}

return (
<InlineLink
href={getResourceDetailsAbsPath(cluster?.id, 'namespace', namespace!)}
<Link
to={getResourceDetailsAbsPath(cluster?.id, 'namespace', namespace)}
onClick={(e) => e.stopPropagation()}
>
{getValue()}
</InlineLink>
<InlineLink>{getValue()}</InlineLink>
</Link>
)
},
}
Expand Down
24 changes: 11 additions & 13 deletions assets/src/components/kubernetes/storage/PersistentVolumeClaims.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { useMemo } from 'react'

import { ChipList } from '@pluralsh/design-system'

import { Link } from 'react-router-dom'

import {
Persistentvolumeclaim_PersistentVolumeClaimList as PersistentVolumeClaimListT,
Persistentvolumeclaim_PersistentVolumeClaim as PersistentVolumeClaimT,
Expand Down Expand Up @@ -40,16 +42,16 @@ const colVolume = columnHelper.accessor((pvc) => pvc.volume, {
}

return (
<InlineLink
href={getResourceDetailsAbsPath(
<Link
to={getResourceDetailsAbsPath(
cluster?.id,
'persistentvolume',
getValue()!
getValue()
)}
onClick={(e) => e.stopPropagation()}
>
{getValue()}
</InlineLink>
<InlineLink>{getValue()}</InlineLink>
</Link>
)
},
})
Expand All @@ -63,16 +65,12 @@ const colStorageClass = columnHelper.accessor((pvc) => pvc.storageClass, {
}

return (
<InlineLink
href={getResourceDetailsAbsPath(
cluster?.id,
'storageclass',
getValue()!
)}
<Link
to={getResourceDetailsAbsPath(cluster?.id, 'storageclass', getValue())}
onClick={(e) => e.stopPropagation()}
>
{getValue()}
</InlineLink>
<InlineLink>{getValue()}</InlineLink>
</Link>
)
},
})
Expand Down
29 changes: 11 additions & 18 deletions assets/src/components/kubernetes/storage/PersistentVolumes.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createColumnHelper } from '@tanstack/react-table'
import { useMemo } from 'react'

import { ChipList } from '@pluralsh/design-system'
import { Link } from 'react-router-dom'

import {
Persistentvolume_PersistentVolumeList as PersistentVolumeListT,
Expand All @@ -15,10 +15,7 @@ import { ResourceList } from '../ResourceList'

import { ClusterTinyFragment } from '../../../generated/graphql'
import { InlineLink } from '../../utils/typography/InlineLink'
import {
STORAGE_CLASSES_REL_PATH,
getStorageResourceDetailsAbsPath,
} from '../../../routes/kubernetesRoutesConsts'
import { getResourceDetailsAbsPath } from '../../../routes/kubernetesRoutesConsts'

import { PVStatusChip } from './utils'

Expand All @@ -40,17 +37,17 @@ const colClaim = columnHelper.accessor((pv) => pv.claim, {
const [name, namespace] = (getValue() ?? '').split('/')

return (
<InlineLink
href={getStorageResourceDetailsAbsPath(
STORAGE_CLASSES_REL_PATH,
<Link
to={getResourceDetailsAbsPath(
cluster?.id,
'persistentvolumeclaim',
name,
namespace
)}
onClick={(e) => e.stopPropagation()}
>
{getValue()}
</InlineLink>
<InlineLink>{getValue()}</InlineLink>
</Link>
)
},
})
Expand All @@ -64,16 +61,12 @@ const colStorageClass = columnHelper.accessor((pv) => pv.storageClass, {
}

return (
<InlineLink
href={getStorageResourceDetailsAbsPath(
STORAGE_CLASSES_REL_PATH,
cluster?.id,
getValue()
)}
<Link
to={getResourceDetailsAbsPath(cluster?.id, 'storageclass', getValue())}
onClick={(e) => e.stopPropagation()}
>
{getValue()}
</InlineLink>
<InlineLink>{getValue()}</InlineLink>
</Link>
)
},
})
Expand Down
2 changes: 1 addition & 1 deletion assets/src/components/kubernetes/workloads/Pods.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const colNode = columnHelper.accessor((pod) => pod?.nodeName, {
to={getResourceDetailsAbsPath(cluster?.id, 'node', getValue())}
onClick={(e) => e.stopPropagation()}
>
{getValue()}
<InlineLink>{getValue()}</InlineLink>
</Link>
)
},
Expand Down

0 comments on commit a351bc3

Please sign in to comment.