Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

improvement(ui): use real row links for KMIP, networking and template usage rows (#8941)

Andrew Huang0dc20ca4e3bf
diff --git a/frontend/src/pages/organization/AccessManagementPage/components/OrgIdentityTab/components/IdentitySection/MachineAuthTemplateUsagesModal.tsx b/frontend/src/pages/organization/AccessManagementPage/components/OrgIdentityTab/components/IdentitySection/MachineAuthTemplateUsagesModal.tsx
index 92d863e089..a798d636c9 100644
--- a/frontend/src/pages/organization/AccessManagementPage/components/OrgIdentityTab/components/IdentitySection/MachineAuthTemplateUsagesModal.tsx
+++ b/frontend/src/pages/organization/AccessManagementPage/components/OrgIdentityTab/components/IdentitySection/MachineAuthTemplateUsagesModal.tsx
@@ -1,4 +1,3 @@
-import { useNavigate } from "@tanstack/react-router";
import { FileKeyIcon } from "lucide-react";
import {
@@ -10,6 +9,7 @@ import {
EmptyHeader,
EmptyMedia,
EmptyTitle,
+ RowLink,
Skeleton,
Table,
TableBody,
@@ -35,7 +35,6 @@ export const MachineAuthTemplateUsagesModal = ({
templateName
}: Props) => {
const { currentOrg } = useOrganization();
- const navigate = useNavigate();
const organizationId = currentOrg?.id || "";
@@ -77,16 +76,15 @@ export const MachineAuthTemplateUsagesModal = ({
))}
{!isPending &&
usages.map((usage) => (
- <TableRow
- key={`usage-${usage.identityId}`}
- onClick={() =>
- navigate({
- to: "/organizations/$orgId/identities/$identityId",
- params: { identityId: usage.identityId, orgId: organizationId }
- })
- }
- >
- <TableCell>{usage.identityName}</TableCell>
+ <TableRow key={`usage-${usage.identityId}`} linked>
+ <TableCell>
+ <RowLink
+ to="/organizations/$orgId/identities/$identityId"
+ params={{ identityId: usage.identityId, orgId: organizationId }}
+ >
+ {usage.identityName}
+ </RowLink>
+ </TableCell>
<TableCell className="text-muted">{usage.identityId}</TableCell>
</TableRow>
))}
diff --git a/frontend/src/pages/organization/KmipServersPage/components/KmipServerTab.tsx b/frontend/src/pages/organization/KmipServersPage/components/KmipServerTab.tsx
index 4c6eac7ded..60bb326823 100644
--- a/frontend/src/pages/organization/KmipServersPage/components/KmipServerTab.tsx
+++ b/frontend/src/pages/organization/KmipServersPage/components/KmipServerTab.tsx
@@ -1,5 +1,4 @@
import { useState } from "react";
-import { useNavigate } from "@tanstack/react-router";
import { formatRelative } from "date-fns";
import {
CopyIcon,
@@ -37,6 +36,7 @@ import {
InputGroup,
InputGroupAddon,
InputGroupInput,
+ RowLink,
Skeleton,
Table,
TableBody,
@@ -74,8 +74,6 @@ export const KmipServerTab = withPermission(
"createKmipServer"
] as const);
- const navigate = useNavigate();
-
const deleteKmipServerById = useDeleteKmipServerById();
const handleDeleteKmipServer = async () => {
@@ -178,18 +176,17 @@ export const KmipServerTab = withPermission(
</TableRow>
))}
{filteredKmipServers?.map((el) => (
- <TableRow
- key={el.id}
- onClick={() => {
- navigate({
- to: "/organizations/$orgId/projects/kms/kmip-servers/$kmipServerId",
- params: { orgId, kmipServerId: el.id }
- });
- }}
- >
- <TableCell isTruncatable>{el.name}</TableCell>
+ <TableRow key={el.id} linked>
+ <TableCell isTruncatable>
+ <RowLink
+ to="/organizations/$orgId/projects/kms/kmip-servers/$kmipServerId"
+ params={{ orgId, kmipServerId: el.id }}
+ >
+ {el.name}
+ </RowLink>
+ </TableCell>
<TableCell>{formatRelative(new Date(el.createdAt), new Date())}</TableCell>
- <TableCell variant="action" onClick={(e) => e.stopPropagation()}>
+ <TableCell variant="action">
<DropdownMenu>
<DropdownMenuTrigger asChild>
<IconButton aria-label="KMIP server options" variant="ghost" size="sm">
diff --git a/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/GatewayTab.tsx b/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/GatewayTab.tsx
index e9945456db..3ec2f883cc 100644
--- a/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/GatewayTab.tsx
+++ b/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/GatewayTab.tsx
@@ -49,6 +49,7 @@ import {
InputGroupAddon,
InputGroupInput,
OverflowBadgeList,
+ RowLink,
Skeleton,
Table,
TableBody,
@@ -332,24 +333,21 @@ export const GatewayTab = withPermission(
))}
{filteredGateway?.map((el) => {
return (
- <TableRow
- key={el.id}
- className="cursor-pointer"
- onClick={() =>
- navigate({
- to: "/organizations/$orgId/networking/gateways/$gatewayId",
- params: { orgId, gatewayId: el.id }
- })
- }
- >
+ <TableRow key={el.id} linked>
<TableCell>
<div className="flex min-w-0 items-center gap-2">
- <Tooltip>
- <TooltipTrigger asChild>
- <span className="min-w-0 flex-1 truncate">{el.name}</span>
- </TooltipTrigger>
- <TooltipContent>{el.name}</TooltipContent>
- </Tooltip>
+ <RowLink
+ to="/organizations/$orgId/networking/gateways/$gatewayId"
+ params={{ orgId, gatewayId: el.id }}
+ className="min-w-0 flex-1"
+ >
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <span>{el.name}</span>
+ </TooltipTrigger>
+ <TooltipContent>{el.name}</TooltipContent>
+ </Tooltip>
+ </RowLink>
</div>
</TableCell>
{showPoolsTab && (
@@ -360,6 +358,7 @@ export const GatewayTab = withPermission(
getKey={(pool) => pool.id}
getLabel={(pool) => pool.name}
appearance="text"
+ className="pointer-events-none [&_[data-slot=tooltip-trigger]]:pointer-events-auto [&_button]:pointer-events-auto"
onItemClick={(pool) => setSelectedPoolId(pool.id)}
maxBadgeWidth={144}
/>
@@ -389,7 +388,7 @@ export const GatewayTab = withPermission(
heartbeatTTL={"heartbeatTTL" in el ? el.heartbeatTTL : null}
/>
</TableCell>
- <TableCell variant="action" onClick={(e) => e.stopPropagation()}>
+ <TableCell variant="action">
<DropdownMenu>
<DropdownMenuTrigger asChild>
<IconButton
diff --git a/frontend/src/pages/organization/NetworkingPage/components/RelayTab/RelayTab.tsx b/frontend/src/pages/organization/NetworkingPage/components/RelayTab/RelayTab.tsx
index f251cf171f..fbd560f092 100644
--- a/frontend/src/pages/organization/NetworkingPage/components/RelayTab/RelayTab.tsx
+++ b/frontend/src/pages/organization/NetworkingPage/components/RelayTab/RelayTab.tsx
@@ -46,6 +46,7 @@ import {
InputGroup,
InputGroupAddon,
InputGroupInput,
+ RowLink,
Skeleton,
Table,
TableBody,
@@ -232,21 +233,17 @@ export const RelayTab = withPermission(
</TableRow>
))}
{filteredRelays?.map((el) => (
- <TableRow
- key={el.id}
- onClick={
- el.orgId
- ? () =>
- navigate({
- to: "/organizations/$orgId/networking/relays/$relayId",
- params: { orgId, relayId: el.id }
- })
- : undefined
- }
- >
+ <TableRow key={el.id} linked={Boolean(el.orgId)}>
<TableCell>
<div className="flex min-w-0 items-center gap-2">
- <span className="min-w-0 flex-1 truncate">{el.name}</span>
+ <RowLink
+ to="/organizations/$orgId/networking/relays/$relayId"
+ params={{ orgId, relayId: el.id }}
+ disabled={!el.orgId}
+ className="min-w-0 flex-1"
+ >
+ {el.name}
+ </RowLink>
{!el.orgId && (
<Tooltip>
<TooltipTrigger asChild>
@@ -264,7 +261,7 @@ export const RelayTab = withPermission(
<TableCell>
<RelayHealthStatus heartbeat={el.heartbeat} />
</TableCell>
- <TableCell variant="action" onClick={(event) => event.stopPropagation()}>
+ <TableCell variant="action">
<DropdownMenu>
<DropdownMenuTrigger asChild>
<IconButton aria-label="Relay options" variant="ghost" size="sm">