Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
chore: ui/ux adjustments for PAM
Sheen Capadngan2e939fd0cacb
diff --git a/frontend/src/components/v3/platform/GatewayPicker/GatewayPicker.tsx b/frontend/src/components/v3/platform/GatewayPicker/GatewayPicker.tsxindex 5478299826..d99a6d56ae 100644--- a/frontend/src/components/v3/platform/GatewayPicker/GatewayPicker.tsx+++ b/frontend/src/components/v3/platform/GatewayPicker/GatewayPicker.tsx@@ -1,7 +1,12 @@import { useQuery } from "@tanstack/react-query";+import { Link } from "@tanstack/react-router";import { GlobeIcon, Layers3Icon, type LucideIcon, ServerIcon } from "lucide-react";-import { useSubscription } from "@app/context";+import { useOrganization, useOrgPermission, useSubscription } from "@app/context";+import {+ OrgGatewayPermissionActions,+ OrgPermissionSubjects+} from "@app/context/OrgPermissionContext/types";import { gatewayPoolsQueryKeys } from "@app/hooks/api/gateway-pools/queries";import { gatewaysQueryKeys } from "@app/hooks/api/gateways/queries";import { isGatewayHealthy } from "@app/hooks/api/gateways-v2/utils";@@ -51,6 +56,8 @@ export const GatewayPicker = ({noGatewayIcon: NoGatewayIcon = GlobeIcon}: Props) => {const { subscription } = useSubscription();+ const { currentOrg } = useOrganization();+ const { permission } = useOrgPermission();const showPools = subscription?.gatewayPool;const { data: gateways, isPending: isGatewaysLoading } = useQuery(gatewaysQueryKeys.list());@@ -82,6 +89,13 @@ export const GatewayPicker = ({const isOnline = (gw: (typeof v2Gateways)[number]) => isGatewayHealthy(gw);+ const poolCount = pools?.length ?? 0;+ const hasAnyGateways = v2Gateways.length > 0 || poolCount > 0;+ const canCreateGateway = permission.can(+ OrgGatewayPermissionActions.CreateGateways,+ OrgPermissionSubjects.Gateway+ );+return (<Select value={selectValue} onValueChange={handleChange} disabled={isDisabled || isLoading}><SelectTrigger className={className ?? "w-full"} isError={isError}>@@ -154,6 +168,27 @@ export const GatewayPicker = ({))}</>)}++ {isRequired && !hasAnyGateways && (+ <div className="px-2 py-4 text-center text-sm text-muted">+ {canCreateGateway ? (+ <>+ No gateways configured.{" "}+ <Link+ to="/organizations/$orgId/networking"+ params={{ orgId: currentOrg.id }}+ target="_blank"+ className="text-foreground underline underline-offset-2 hover:text-primary"+ >+ Set one up+ </Link>{" "}+ to continue.+ </>+ ) : (+ "No gateways configured. Ask your organization admin to set one up."+ )}+ </div>+ )}</SelectContent></Select>);diff --git a/frontend/src/pages/pam/PamAccessPage/PamAccessPage.tsx b/frontend/src/pages/pam/PamAccessPage/PamAccessPage.tsxindex 6368191169..2c8b7dd1f9 100644--- a/frontend/src/pages/pam/PamAccessPage/PamAccessPage.tsx+++ b/frontend/src/pages/pam/PamAccessPage/PamAccessPage.tsx@@ -1,16 +1,19 @@import { useCallback, useEffect, useState } from "react";import { Helmet } from "react-helmet";import { useTranslation } from "react-i18next";-import { FolderOpen, KeyRound, Layers, Search } from "lucide-react";+import { Link } from "@tanstack/react-router";+import { ArrowRight, FolderOpen, KeyRound, Layers, Search } from "lucide-react";import { PageHeader } from "@app/components/v2";import {+ Button,Card,CardContent,CardDescription,CardHeader,CardTitle,Empty,+ EmptyContent,EmptyDescription,EmptyHeader,EmptyTitle,@@ -29,8 +32,10 @@ import {TableRow} from "@app/components/v3";import { Skeleton } from "@app/components/v3/generic/Skeleton";+import { useOrganization } from "@app/context";import {TAccessiblePamAccount,+ useGetPamAccessCapabilities,useListAccessiblePamFolders,useListPamAccountTypes} from "@app/hooks/api/pam";@@ -54,6 +59,13 @@ export const PamAccessPage = () => {const { data: folders = [], isLoading: isLoadingFolders } = useListAccessiblePamFolders();const { data: accountTypes = [] } = useListPamAccountTypes();+ const { data: capabilities } = useGetPamAccessCapabilities();+ const { currentOrg } = useOrganization();++ // Anyone who can reach the Accounts page from the sidebar (product admins and+ // resource admins) sees a CTA that points them there — otherwise the empty+ // state on a fresh org is a dead end.+ const canManageAccounts = Boolean(capabilities?.isProductAdmin || capabilities?.isResourceAdmin);const query = searchInput.trim();@@ -90,6 +102,19 @@ export const PamAccessPage = () => {const showNoMatches = filterActive && filterSettled && !filterHasMatches;const showEmpty = !isLoadingFolders && (visibleFolders.length === 0 || showNoMatches);+ let emptyTitle: string;+ let emptyDescription: string;+ if (hasActiveFilters) {+ emptyTitle = "No accounts match your filters";+ emptyDescription = "Try adjusting your search or filters.";+ } else if (canManageAccounts) {+ emptyTitle = "No accounts yet";+ emptyDescription = "Onboard your first privileged account from the Accounts page to get started.";+ } else {+ emptyTitle = "No accounts available";+ emptyDescription = "Ask your PAM admin to grant you access to a folder or account.";+ }+return (<><Helmet>@@ -174,17 +199,24 @@ export const PamAccessPage = () => {{showEmpty && (<CardContent>- <Empty>+ <Empty className="border"><EmptyHeader>- <EmptyTitle>- {hasActiveFilters ? "No accounts match your filters" : "No accounts available"}- </EmptyTitle>- <EmptyDescription>- {hasActiveFilters- ? "Try adjusting your search or filters."- : "You don't have access to any accounts yet."}- </EmptyDescription>+ <EmptyTitle>{emptyTitle}</EmptyTitle>+ <EmptyDescription>{emptyDescription}</EmptyDescription></EmptyHeader>+ {!hasActiveFilters && canManageAccounts && (+ <EmptyContent>+ <Button variant="pam" asChild>+ <Link+ to="/organizations/$orgId/pam/accounts"+ params={{ orgId: currentOrg.id }}+ >+ Go to Accounts+ <ArrowRight />+ </Link>+ </Button>+ </EmptyContent>+ )}</Empty></CardContent>)}diff --git a/frontend/src/pages/pam/PamAccountsPage/PamAccountsPage.tsx b/frontend/src/pages/pam/PamAccountsPage/PamAccountsPage.tsxindex 84e4cf7455..476de78496 100644--- a/frontend/src/pages/pam/PamAccountsPage/PamAccountsPage.tsx+++ b/frontend/src/pages/pam/PamAccountsPage/PamAccountsPage.tsx@@ -165,7 +165,10 @@ export const PamAccountsPage = () => {Accounts<DocumentationLinkBadge href={PamDocsUrls.accounts.overview} /></CardTitle>- <CardDescription>Privileged accounts grouped into folders.</CardDescription>+ <CardDescription>+ Privileged accounts organized by access into folders, each inheriting governance rules+ from an account template.+ </CardDescription><CardAction><ButtonGroup><Buttondiff --git a/frontend/src/pages/pam/PamAccountsPage/components/CreateAccountSheet.tsx b/frontend/src/pages/pam/PamAccountsPage/components/CreateAccountSheet.tsxindex eb88267fcc..5c1cf6d252 100644--- a/frontend/src/pages/pam/PamAccountsPage/components/CreateAccountSheet.tsx+++ b/frontend/src/pages/pam/PamAccountsPage/components/CreateAccountSheet.tsx@@ -1,7 +1,8 @@import { useEffect, useState } from "react";import { Controller, useForm } from "react-hook-form";import { zodResolver } from "@hookform/resolvers/zod";-import { AlertTriangle, Plus, Search } from "lucide-react";+import { Link } from "@tanstack/react-router";+import { AlertTriangle, ArrowUpRight, Plus, Search } from "lucide-react";import { createNotification } from "@app/components/notifications";import { HighlightText } from "@app/components/v2/HighlightText";@@ -36,11 +37,13 @@ import {import {Sheet,SheetContent,+ SheetDescription,SheetFooter,SheetHeader,SheetTitle} from "@app/components/v3/generic/Sheet";import { TextArea } from "@app/components/v3/generic/TextArea";+import { useOrganization } from "@app/context";import {accountTypeRequiresRecording,PamAccountType,@@ -76,6 +79,8 @@ type Props = {export const CreateAccountSheet = ({ isOpen, onOpenChange, defaultFolderId, onCreated }: Props) => {const createAccount = useCreatePamAccount();+ const { currentOrg } = useOrganization();+const [step, setStep] = useState<1 | 2>(1);const [templateSearch, setTemplateSearch] = useState("");const [confirmDiscardOpen, setConfirmDiscardOpen] = useState(false);@@ -255,13 +260,17 @@ export const CreateAccountSheet = ({ isOpen, onOpenChange, defaultFolderId, onCr<><Sheet open={isOpen} onOpenChange={handleOpenChange}><SheetContent>- <SheetHeader>+ <SheetHeader className="border-b"><SheetTitle>Add Account</SheetTitle>+ <SheetDescription>+ Pick a folder and an account template. The account inherits its type and governance+ rules from the selected template.+ </SheetDescription></SheetHeader>{step === 1 ? (<>- <div className="flex min-h-0 flex-1 flex-col gap-5 px-4">+ <div className="flex min-h-0 flex-1 flex-col gap-5 px-4 pt-3"><Controllercontrol={control}name="folderId"@@ -309,9 +318,26 @@ export const CreateAccountSheet = ({ isOpen, onOpenChange, defaultFolderId, onCrname="templateId"render={({ field }) => (<Field className="min-h-0 flex-1">- <FieldLabel>- Account Template<span className="text-product-pam">*</span>- </FieldLabel>+ <div className="flex items-center justify-between">+ <FieldLabel>+ Account Template<span className="text-product-pam">*</span>+ </FieldLabel>+ <Button+ variant="ghost"+ size="xs"+ className="text-muted hover:text-foreground"+ asChild+ >+ <Link+ to="/organizations/$orgId/pam/templates"+ params={{ orgId: currentOrg.id }}+ target="_blank"+ >+ Manage Templates+ <ArrowUpRight />+ </Link>+ </Button>+ </div><FieldContent className="min-h-0 flex-1"><InputGroup><InputGroupAddon align="inline-start">@@ -384,7 +410,7 @@ export const CreateAccountSheet = ({ isOpen, onOpenChange, defaultFolderId, onCr</>) : (<form onSubmit={handleSubmit(onSubmit)} className="flex min-h-0 flex-1 flex-col">- <div className="flex thin-scrollbar flex-1 flex-col gap-4 overflow-y-auto px-4">+ <div className="flex thin-scrollbar flex-1 flex-col gap-4 overflow-y-auto px-4 pt-3">{selectedTemplate && (<div className="flex items-center gap-3 rounded-md border border-border bg-container p-3"><AccountPlatformIcon accountType={selectedTemplate.type} size={28} />diff --git a/frontend/src/pages/pam/PamAccountsPage/components/CreateFolderModal.tsx b/frontend/src/pages/pam/PamAccountsPage/components/CreateFolderModal.tsxindex 7a12801e48..f09893519a 100644--- a/frontend/src/pages/pam/PamAccountsPage/components/CreateFolderModal.tsx+++ b/frontend/src/pages/pam/PamAccountsPage/components/CreateFolderModal.tsx@@ -7,6 +7,7 @@ import {Button,Dialog,DialogContent,+ DialogDescription,DialogFooter,DialogHeader,DialogTitle,@@ -70,6 +71,10 @@ export const CreateFolderModal = ({ isOpen, onOpenChange, onCreated }: Props) =><DialogContent className="max-w-xl"><DialogHeader><DialogTitle>Add Folder</DialogTitle>+ <DialogDescription>+ Group accounts by who needs access to them. Organize by team, department, application,+ or environment.+ </DialogDescription></DialogHeader><form onSubmit={handleSubmit(onSubmit)} className="flex flex-col gap-4"><Field>@@ -77,7 +82,7 @@ export const CreateFolderModal = ({ isOpen, onOpenChange, onCreated }: Props) =><FieldContent><Inputid="folder-name"- placeholder="e.g. production-databases"+ placeholder="e.g. backend-team, checkout-service"isError={!!errors.name}{...register("name")}/>@@ -90,7 +95,7 @@ export const CreateFolderModal = ({ isOpen, onOpenChange, onCreated }: Props) =><FieldContent><TextAreaid="folder-description"- placeholder="What lives in this folder?"+ placeholder="Who needs access and what accounts will this contain?"rows={3}isError={!!errors.description}{...register("description")}diff --git a/frontend/src/pages/pam/PamTemplatesPage/PamTemplatesPage.tsx b/frontend/src/pages/pam/PamTemplatesPage/PamTemplatesPage.tsxindex 9186a04996..3bad2dfb04 100644--- a/frontend/src/pages/pam/PamTemplatesPage/PamTemplatesPage.tsx+++ b/frontend/src/pages/pam/PamTemplatesPage/PamTemplatesPage.tsx@@ -184,7 +184,7 @@ export const PamTemplatesPage = () => {scope={ProjectType.PAM}icon={ClipboardList}title="Account Templates"- description="Define the policies, rotation behavior, and settings for a type of account."+ description="Define the rules that apply when users connect to accounts."/><Card className="mt-4">@@ -194,7 +194,8 @@ export const PamTemplatesPage = () => {<DocumentationLinkBadge href={PamDocsUrls.templates.overview} /></CardTitle><CardDescription>- Templates define the policies, rotation behavior, and settings for a type of account.+ Templates define the governance rules that every account inherits, including session+ limits, MFA, and recording.</CardDescription><CardAction><Button variant="pam" onClick={() => handlePopUpOpen("createTemplate")}>diff --git a/frontend/src/pages/pam/PamTemplatesPage/components/CreateTemplateModal.tsx b/frontend/src/pages/pam/PamTemplatesPage/components/CreateTemplateModal.tsxindex 9c93df9cce..f46ac0a56f 100644--- a/frontend/src/pages/pam/PamTemplatesPage/components/CreateTemplateModal.tsx+++ b/frontend/src/pages/pam/PamTemplatesPage/components/CreateTemplateModal.tsx@@ -7,6 +7,7 @@ import {Button,Dialog,DialogContent,+ DialogDescription,DialogFooter,DialogHeader,DialogTitle,@@ -90,6 +91,10 @@ export const CreateTemplateModal = ({ isOpen, onOpenChange, onCreated }: Props)<DialogContent className="max-w-xl"><DialogHeader><DialogTitle>Create Account Template</DialogTitle>+ <DialogDescription>+ Templates hold the governance rules inherited by every account created from them,+ including session limits, MFA, and recording.+ </DialogDescription></DialogHeader><form onSubmit={handleSubmit(onSubmit)} className="flex flex-col gap-4"><Field>