Skip to content

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

chore: more pam ux patches for launch

Sheen Capadnganc8a9293b3ed5
diff --git a/frontend/src/pages/pam/PamAccessPage/components/accountSheetDetails.tsx b/frontend/src/pages/pam/PamAccessPage/components/accountSheetDetails.tsx
index d8a8523817..f5d985613e 100644
--- a/frontend/src/pages/pam/PamAccessPage/components/accountSheetDetails.tsx
+++ b/frontend/src/pages/pam/PamAccessPage/components/accountSheetDetails.tsx
@@ -1,18 +1,34 @@
import { ReactNode } from "react";
import { FolderOpen } from "lucide-react";
+import { Badge, Tooltip, TooltipContent, TooltipTrigger } from "@app/components/v3";
import {
PamAccountType,
+ PamFieldWidget,
TAccessiblePamAccount,
TPamFieldDescriptor,
useGetPamAccountById,
usePamAccountTypeMap
} from "@app/hooks/api/pam";
-const formatFieldValue = (value: unknown): ReactNode => {
+const formatFieldValue = (field: TPamFieldDescriptor, value: unknown): ReactNode => {
if (typeof value === "boolean") return value ? "Enabled" : "Disabled";
+ if (field.widget === PamFieldWidget.Textarea) {
+ return <Badge variant="success">Configured</Badge>;
+ }
const str = String(value);
- if (str.length > 48) return "Provided";
+ if (str.length > 48) {
+ return (
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <span className="block max-w-full cursor-default overflow-hidden font-mono text-ellipsis !whitespace-nowrap">
+ {str}
+ </span>
+ </TooltipTrigger>
+ <TooltipContent className="max-w-xs font-mono break-all">{str}</TooltipContent>
+ </Tooltip>
+ );
+ }
return <span className="font-mono">{str}</span>;
};
@@ -20,7 +36,7 @@ const fieldRows = (fields: TPamFieldDescriptor[] | undefined, source: Record<str
(fields ?? [])
.filter((f) => !f.secret)
.filter((f) => source[f.key] !== undefined && source[f.key] !== null && source[f.key] !== "")
- .map((f) => ({ label: f.label, value: formatFieldValue(source[f.key]) }));
+ .map((f) => ({ label: f.label, value: formatFieldValue(f, source[f.key]) }));
// Shared sidebar content for the account sheets on the access page: the same non-secret
// connection/credential details show whether the user is launching or requesting access.
diff --git a/frontend/src/pages/pam/PamAccountsPage/PamAccountsPage.tsx b/frontend/src/pages/pam/PamAccountsPage/PamAccountsPage.tsx
index 7689f32ec8..738418dd29 100644
--- a/frontend/src/pages/pam/PamAccountsPage/PamAccountsPage.tsx
+++ b/frontend/src/pages/pam/PamAccountsPage/PamAccountsPage.tsx
@@ -40,9 +40,9 @@ import {
TableRow
} from "@app/components/v3";
import { Skeleton } from "@app/components/v3/generic/Skeleton";
-import { useOrganization } from "@app/context";
import {
PamAccountType,
+ TAccessiblePamAccount,
useDeletePamAccount,
useDeletePamFolder,
useListPamAccountTemplates,
@@ -54,6 +54,7 @@ import { usePopUp } from "@app/hooks/usePopUp";
import { PamDocsUrls } from "../pam-docs-urls";
import { AccountPlatformIcon } from "../PamAccessPage/components/AccountPlatformIcon";
+import { LaunchSessionSheet } from "../PamAccessPage/components/LaunchSessionSheet";
import { AccountDetailSheet } from "./components/AccountDetailSheet";
import { CreateAccountSheet } from "./components/CreateAccountSheet";
import { CreateFolderModal } from "./components/CreateFolderModal";
@@ -66,7 +67,6 @@ const SKELETON_KEYS = ["s1", "s2", "s3", "s4", "s5"];
export const PamAccountsPage = () => {
const { t } = useTranslation();
- const { currentOrg } = useOrganization();
const [searchInput, setSearchInput] = useState("");
const [selectedFolderId, setSelectedFolderId] = useState<string>("");
const [selectedTemplateId, setSelectedTemplateId] = useState<string>("");
@@ -89,6 +89,8 @@ export const PamAccountsPage = () => {
const accountSheet = usePamSheetState("accountId");
const folderSheet = usePamSheetState("folderId");
+ const [launchAccount, setLaunchAccount] = useState<TAccessiblePamAccount | null>(null);
+
const query = searchInput.trim();
// Active filters force-open every folder so matches surface; otherwise folders load lazily on open
const filterActive = Boolean(query || selectedTemplateId);
@@ -303,12 +305,7 @@ export const PamAccountsPage = () => {
filterActive={filterActive}
onOpenAccount={(id, tab) => accountSheet.openSheet(id, tab)}
onDeleteAccount={(target) => handlePopUpOpen("deleteAccount", target)}
- onLaunchAccount={(accountId, accountType) => {
- window.open(
- `/organizations/${currentOrg.id}/pam/accounts/${accountType}/${accountId}/access`,
- "_blank"
- );
- }}
+ onLaunchAccount={setLaunchAccount}
onOpenFolder={(tab) => folderSheet.openSheet(folder.id, tab)}
onFolderAddAccount={() =>
handlePopUpOpen("createAccount", { folderId: folder.id })
@@ -391,6 +388,14 @@ export const PamAccountsPage = () => {
if (!open) handlePopUpClose("deleteFolder");
}}
/>
+
+ <LaunchSessionSheet
+ account={launchAccount}
+ isOpen={launchAccount !== null}
+ onOpenChange={(open) => {
+ if (!open) setLaunchAccount(null);
+ }}
+ />
</div>
);
};
diff --git a/frontend/src/pages/pam/PamAccountsPage/components/AccountDetailSheet.tsx b/frontend/src/pages/pam/PamAccountsPage/components/AccountDetailSheet.tsx
index d6376a3436..06fd8d3e88 100644
--- a/frontend/src/pages/pam/PamAccountsPage/components/AccountDetailSheet.tsx
+++ b/frontend/src/pages/pam/PamAccountsPage/components/AccountDetailSheet.tsx
@@ -40,7 +40,10 @@ import {
TableCell,
TableHead,
TableHeader,
- TableRow
+ TableRow,
+ Tooltip,
+ TooltipContent,
+ TooltipTrigger
} from "@app/components/v3";
import { Skeleton } from "@app/components/v3/generic/Skeleton";
import { useOrganization, useUser } from "@app/context";
@@ -54,6 +57,8 @@ import {
isRotatablePamAccountType,
PamAccountAccessibilityIssue,
PamAccountType,
+ PamFieldWidget,
+ TPamFieldDescriptor,
TPamMember,
useGetPamAccountById,
useGetPamAccountTemplate,
@@ -811,35 +816,32 @@ const SettingsTab = ({
);
};
-const CONNECTION_FIELD_LABELS: Record<string, string> = {
- host: "Host",
- port: "Port",
- database: "Database",
- sslEnabled: "SSL",
- sslRejectUnauthorized: "Reject Unauthorized SSL",
- sslCertificate: "SSL Certificate"
-};
-
-const humanizeFieldKey = (key: string) =>
- key
- .replace(/([A-Z])/g, " $1")
- .replace(/^./, (c) => c.toUpperCase())
- .trim();
-
-const formatConnectionValue = (value: unknown): ReactNode => {
+const formatFieldValue = (field: TPamFieldDescriptor, value: unknown): ReactNode => {
if (typeof value === "boolean") return value ? "Enabled" : "Disabled";
+ if (field.widget === PamFieldWidget.Textarea) {
+ return <Badge variant="success">Configured</Badge>;
+ }
const str = String(value);
- if (str.length > 48) return "Provided";
+ if (str.length > 48) {
+ return (
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <span className="block max-w-full cursor-default overflow-hidden font-mono text-ellipsis !whitespace-nowrap">
+ {str}
+ </span>
+ </TooltipTrigger>
+ <TooltipContent className="max-w-xs font-mono break-all">{str}</TooltipContent>
+ </Tooltip>
+ );
+ }
return <span className="font-mono">{str}</span>;
};
-const buildConnectionMetadata = (connectionDetails: Record<string, unknown>) =>
- Object.entries(connectionDetails)
- .filter(([, value]) => value !== null && value !== undefined && value !== "")
- .map(([key, value]) => ({
- label: CONNECTION_FIELD_LABELS[key] ?? humanizeFieldKey(key),
- value: formatConnectionValue(value)
- }));
+const fieldRows = (fields: TPamFieldDescriptor[] | undefined, source: Record<string, unknown>) =>
+ (fields ?? [])
+ .filter((f) => !f.secret)
+ .filter((f) => source[f.key] !== undefined && source[f.key] !== null && source[f.key] !== "")
+ .map((f) => ({ label: f.label, value: formatFieldValue(f, source[f.key]) }));
export const AccountDetailSheet = ({ isOpen, accountId, onOpenChange }: Props) => {
const { data: account, isLoading } = useGetPamAccountById(isOpen ? accountId : undefined);
@@ -884,7 +886,7 @@ export const AccountDetailSheet = ({ isOpen, accountId, onOpenChange }: Props) =
<Badge variant="neutral">None</Badge>
)
},
- ...buildConnectionMetadata(conn),
+ ...fieldRows(typeInfo?.connectionFields, conn),
...(account.credentials?.username
? [
{
diff --git a/frontend/src/pages/pam/PamAccountsPage/components/FolderAccountRows.tsx b/frontend/src/pages/pam/PamAccountsPage/components/FolderAccountRows.tsx
index f3c794f549..9289a78677 100644
--- a/frontend/src/pages/pam/PamAccountsPage/components/FolderAccountRows.tsx
+++ b/frontend/src/pages/pam/PamAccountsPage/components/FolderAccountRows.tsx
@@ -6,6 +6,7 @@ import { Badge, TableCell, TableRow } from "@app/components/v3";
import { Skeleton } from "@app/components/v3/generic/Skeleton";
import {
PamAccountType,
+ TAccessiblePamAccount,
TPamFolderWithCount,
useListPamAccountsAdmin,
usePamAccountTypeMap
@@ -28,7 +29,7 @@ type Props = {
filterActive: boolean;
onOpenAccount: (accountId: string, tab?: PamSheetTab) => void;
onDeleteAccount: (target: DeleteTarget) => void;
- onLaunchAccount: (accountId: string, accountType: PamAccountType) => void;
+ onLaunchAccount: (account: TAccessiblePamAccount) => void;
onOpenFolder: (tab?: PamSheetTab) => void;
onFolderAddAccount: () => void;
onFolderDelete: () => void;
@@ -156,7 +157,21 @@ export const FolderAccountRows = ({
accountType
})
}
- onLaunch={() => onLaunchAccount(account.id, accountType)}
+ onLaunch={() =>
+ onLaunchAccount({
+ id: account.id,
+ name: account.name,
+ description: account.description,
+ folderId: account.folderId,
+ folderName: account.folderName,
+ templateId: account.templateId,
+ templateName: account.templateName,
+ accountType,
+ canLaunch: true,
+ createdAt: account.createdAt,
+ updatedAt: account.updatedAt
+ })
+ }
/>
</div>
</TableCell>