Skip to content

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

improvement(ui): make PAM folder rows real links (#8937)

Andrew Huang88a67729e79d
diff --git a/frontend/src/pages/pam/PamAccountsPage/PamAccountsPage.tsx b/frontend/src/pages/pam/PamAccountsPage/PamAccountsPage.tsx
index ab6cf5fb99..3254ff0595 100644
--- a/frontend/src/pages/pam/PamAccountsPage/PamAccountsPage.tsx
+++ b/frontend/src/pages/pam/PamAccountsPage/PamAccountsPage.tsx
@@ -1,5 +1,4 @@
import { useMemo, useRef, useState } from "react";
-import { useNavigate } from "@tanstack/react-router";
import { ChevronDown, FolderOpen, FolderPlus, Plus, Search } from "lucide-react";
import { createNotification } from "@app/components/notifications";
@@ -75,7 +74,6 @@ import { ViewCredentialsModal } from "./components/ViewCredentialsModal";
const SKELETON_KEYS = ["s1", "s2", "s3", "s4", "s5"];
export const PamAccountsPage = () => {
- const navigate = useNavigate();
const { currentOrg } = useOrganization();
const [searchInput, setSearchInput] = useState("");
const searchInputRef = useRef<HTMLInputElement>(null);
@@ -360,12 +358,6 @@ export const PamAccountsPage = () => {
folder={folder}
search={debouncedSearch}
accounts={filterActive ? (matchesByFolder[folder.id] ?? []) : undefined}
- onOpenFolderView={() =>
- navigate({
- to: "/organizations/$orgId/pam/accounts/$folderId",
- params: { orgId: currentOrg.id, folderId: folder.id }
- })
- }
onOpenAccount={(id, tab) => accountSheet.openSheet(id, tab)}
onLaunchAccount={setLaunchAccount}
onRequestAccess={requestSessionAccess}
diff --git a/frontend/src/pages/pam/PamAccountsPage/components/FolderAccountRows.tsx b/frontend/src/pages/pam/PamAccountsPage/components/FolderAccountRows.tsx
index ade02c8b86..1f28845f5a 100644
--- a/frontend/src/pages/pam/PamAccountsPage/components/FolderAccountRows.tsx
+++ b/frontend/src/pages/pam/PamAccountsPage/components/FolderAccountRows.tsx
@@ -1,6 +1,7 @@
import { Folder } from "lucide-react";
-import { Badge, TableCell, TableRow } from "@app/components/v3";
+import { Badge, RowLink, TableCell, TableRow } from "@app/components/v3";
+import { useOrganization } from "@app/context";
import {
PamAccountType,
PamFolderCallerAccess,
@@ -18,7 +19,6 @@ type Props = {
search: string;
// Matching accounts, supplied by the page's filter query. Undefined when nothing is filtered.
accounts?: TPamAccountListItem[];
- onOpenFolderView: () => void;
onOpenAccount: (accountId: string, tab?: PamSheetTab) => void;
onLaunchAccount: (account: TAccessiblePamAccount) => void;
onRequestAccess: (account: TAccessiblePamAccount) => void;
@@ -35,7 +35,6 @@ export const FolderAccountRows = ({
folder,
search,
accounts,
- onOpenFolderView,
onOpenAccount,
onLaunchAccount,
onRequestAccess,
@@ -47,6 +46,7 @@ export const FolderAccountRows = ({
onFolderDelete,
onFolderJoinAsAdmin
}: Props) => {
+ const { currentOrg } = useOrganization();
const count = accounts ? accounts.length : folder.accountCount;
// Only org admins are sent folders they hold no membership on; opening one means joining it.
const isNotMember = folder.callerAccess === PamFolderCallerAccess.None;
@@ -54,17 +54,27 @@ export const FolderAccountRows = ({
return (
<>
<TableRow
- className="cursor-pointer select-none"
- onClick={isNotMember ? onFolderJoinAsAdmin : onOpenFolderView}
+ linked={!isNotMember}
+ className={isNotMember ? "cursor-pointer select-none" : undefined}
+ onClick={isNotMember ? onFolderJoinAsAdmin : undefined}
>
<TableCell>
<div className="flex items-center gap-2.5">
<Folder className="size-5 shrink-0 text-product-pam" />
- <span className="shrink-0 font-medium text-foreground">{folder.name}</span>
{isNotMember ? (
- <Badge variant="neutral">Not a Member</Badge>
+ <>
+ <span className="shrink-0 font-medium text-foreground">{folder.name}</span>
+ <Badge variant="neutral">Not a Member</Badge>
+ </>
) : (
<>
+ <RowLink
+ to="/organizations/$orgId/pam/accounts/$folderId"
+ params={{ orgId: currentOrg.id, folderId: folder.id }}
+ className="shrink-0 font-medium text-foreground"
+ >
+ {folder.name}
+ </RowLink>
<span className="shrink-0 text-xs text-muted">({count})</span>
{folder.description && (
<span className="max-w-md truncate text-muted">{folder.description}</span>