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 feedback
Sheen Capadngan3b100d86095c
diff --git a/backend/src/ee/services/dynamic-secret/dynamic-secret-dal.ts b/backend/src/ee/services/dynamic-secret/dynamic-secret-dal.tsindex 09d01a9361..26ff3a1fda 100644--- a/backend/src/ee/services/dynamic-secret/dynamic-secret-dal.ts+++ b/backend/src/ee/services/dynamic-secret/dynamic-secret-dal.ts@@ -42,7 +42,7 @@ export interface TDynamicSecretDALFactory extends Omit<TOrmify<TableName.Dynamicname: string;folderId: string;projectId: string;- projectName: string | null;+ projectName: string;environmentSlug: string;}>>;diff --git a/frontend/src/layouts/OrganizationLayout/OrganizationLayout.tsx b/frontend/src/layouts/OrganizationLayout/OrganizationLayout.tsxindex 038cf84da0..6e75f8dc51 100644--- a/frontend/src/layouts/OrganizationLayout/OrganizationLayout.tsx+++ b/frontend/src/layouts/OrganizationLayout/OrganizationLayout.tsx@@ -43,7 +43,7 @@ export const OrganizationLayout = () => {{!isLoading && !isInsideProject && !serverDetails?.emailConfigured && <SmtpBanner />}{!isLoading && !isInsideProject && subscription.auditLogs && <AuditLogBanner />}{!window.isSecureContext && !isInsideProject && <InsecureConnectionBanner />}- <NetworkHealthBanner />+ {!isInsideProject && <NetworkHealthBanner />}<mainclassName={twMerge("flex-1 overflow-x-hidden bg-bunker-800 px-12 pt-10 pb-4 dark:scheme-dark",diff --git a/frontend/src/layouts/OrganizationLayout/components/NavBar/Notification.tsx b/frontend/src/layouts/OrganizationLayout/components/NavBar/Notification.tsxindex f2f0eb8ce7..5e552e307c 100644--- a/frontend/src/layouts/OrganizationLayout/components/NavBar/Notification.tsx+++ b/frontend/src/layouts/OrganizationLayout/components/NavBar/Notification.tsx@@ -21,7 +21,7 @@ export const Notification = ({ notification, onDelete }: Props) => {"group relative flex cursor-pointer items-start border-b border-mineshaft-600 p-2 transition-colors",notification.link ? "hover:bg-mineshaft-700" : "cursor-default",!notification.isRead && "bg-mineshaft-800",- isCritical && !notification.isRead && "border-l-2 border-l-red-500"+ isCritical && !notification.isRead && "border-l-2 border-l-red-700")}><div className="flex w-full min-w-0 flex-col p-1">@@ -32,7 +32,7 @@ export const Notification = ({ notification, onDelete }: Props) => {icon={faCircle}className={twMerge("size-2 shrink-0",- isCritical ? "text-red-500" : "text-yellow-400"+ isCritical ? "text-red-700" : "text-yellow-400")}/></div>diff --git a/frontend/src/layouts/OrganizationLayout/components/NavBar/NotificationDropdown.tsx b/frontend/src/layouts/OrganizationLayout/components/NavBar/NotificationDropdown.tsxindex 6b5bcc54c4..58542cd144 100644--- a/frontend/src/layouts/OrganizationLayout/components/NavBar/NotificationDropdown.tsx+++ b/frontend/src/layouts/OrganizationLayout/components/NavBar/NotificationDropdown.tsx@@ -49,7 +49,7 @@ export const NotificationDropdown = () => {<spanclassName={twMerge("absolute -top-1 -right-1 flex h-4 min-w-4 items-center justify-center rounded-full px-1 text-[10px]",- hasCritical ? "bg-red-500 text-white" : "bg-yellow-400 text-black"+ hasCritical ? "bg-red-700 text-white" : "bg-yellow-400 text-black")}>{unreadCount > 99 ? "99+" : unreadCount}@@ -67,7 +67,7 @@ export const NotificationDropdown = () => {<div className="flex items-center gap-2"><span className="font-medium text-white">Notifications</span>{hasCritical && (- <span className="rounded-full bg-red-500 px-1.5 py-0.5 text-[10px] font-medium text-white">+ <span className="rounded-full bg-red-700 px-1.5 py-0.5 text-[10px] font-medium text-white">{criticalCount > 99 ? "99+" : criticalCount} critical</span>)}diff --git a/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/GatewayTab.tsx b/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/GatewayTab.tsxindex 77cc741524..ff0444b22e 100644--- a/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/GatewayTab.tsx+++ b/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/GatewayTab.tsx@@ -5,7 +5,6 @@ import {faEdit,faEllipsisV,faInfoCircle,- faLink,faMagnifyingGlass,faPlus,faSearch,@@ -109,9 +108,8 @@ const GatewayConnectedCell = ({ gatewayId, isV1, onClick }: GatewayConnectedCell<buttontype="button"onClick={onClick}- className="flex items-center gap-1.5 text-primary-400 hover:text-primary-300"+ className="flex cursor-pointer items-center gap-1.5 text-mineshaft-200 underline decoration-mineshaft-400 underline-offset-2 hover:text-mineshaft-100 hover:decoration-mineshaft-300">- <FontAwesomeIcon icon={faLink} className="h-3 w-3" /><span>{totalCount} resource{totalCount !== 1 ? "s" : ""}</span>diff --git a/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/GatewayConnectedResourcesDrawer.tsx b/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/GatewayConnectedResourcesDrawer.tsxindex 1e3ec48d02..db8aa37bc6 100644--- a/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/GatewayConnectedResourcesDrawer.tsx+++ b/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/GatewayConnectedResourcesDrawer.tsx@@ -1,10 +1,21 @@-import { faChevronDown, faChevronRight, faLink } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";import { Link } from "@tanstack/react-router";+import { ExternalLinkIcon } from "lucide-react";-import { Drawer, DrawerContent, Spinner } from "@app/components/v2";+import { Spinner } from "@app/components/v2";+import {+ Badge,+ Sheet,+ SheetContent,+ SheetDescription,+ SheetFooter,+ SheetHeader,+ SheetTitle,+ UnstableAccordion,+ UnstableAccordionContent,+ UnstableAccordionItem,+ UnstableAccordionTrigger+} from "@app/components/v3";import { useOrganization } from "@app/context";-import { useToggle } from "@app/hooks";import {TGatewayConnectedResources,useGetGatewayConnectedResources@@ -17,70 +28,6 @@ type Props = {gatewayName: string;};-type ResourceSectionProps = {- title: string;- count: number;- children: React.ReactNode;- icon?: React.ReactNode;-};--const ResourceSection = ({ title, count, children, icon }: ResourceSectionProps) => {- const [isExpanded, setIsExpanded] = useToggle(true);-- if (count === 0) return null;-- return (- <div className="border-b border-mineshaft-600 last:border-b-0">- <button- type="button"- onClick={() => setIsExpanded.toggle()}- className="flex w-full items-center gap-2 px-1 py-3 text-left hover:bg-mineshaft-700/30"- >- <FontAwesomeIcon- icon={isExpanded ? faChevronDown : faChevronRight}- className="h-3 w-3 text-mineshaft-400"- />- {icon}- <span className="flex-1 text-sm font-medium text-mineshaft-100">{title}</span>- <span className="rounded bg-mineshaft-600 px-2 py-0.5 text-xs text-mineshaft-300">- {count}- </span>- </button>- {isExpanded && <div className="pb-3 pl-6">{children}</div>}- </div>- );-};--type ResourceItemProps = {- name: string;- subtitle?: string;- to?: string;- params?: Record<string, string>;-};--const ResourceItem = ({ name, subtitle, to, params }: ResourceItemProps) => {- const content = (- <div className="py-1.5">- <div className="text-sm text-mineshaft-100">{name}</div>- {subtitle && <div className="text-xs text-mineshaft-400">{subtitle}</div>}- </div>- );-- if (to && params) {- return (- <Link- to={to as "/"}- params={params}- className="-mx-2 block rounded px-2 hover:bg-mineshaft-700/50"- >- {content}- </Link>- );- }-- return <div className="-mx-2 px-2">{content}</div>;-};-const getTotalResourceCount = (resources: TGatewayConnectedResources | undefined): number => {if (!resources) return 0;return (@@ -107,6 +54,32 @@ const getResourceTypeCount = (resources: TGatewayConnectedResources | undefined)return count;};+type ResourceRowProps = {+ name: string;+ subtitle: string;+ to: string;+ params: Record<string, string>;+ isLast?: boolean;+};++const ResourceRow = ({ name, subtitle, to, params, isLast }: ResourceRowProps) => {+ return (+ <Link+ to={to as "/"}+ params={params}+ className={`flex items-center justify-between px-4 py-2.5 transition-colors hover:bg-mineshaft-700/30 ${+ !isLast ? "border-b border-mineshaft-600" : ""+ }`}+ >+ <div className="flex flex-col gap-0.5">+ <span className="text-sm text-mineshaft-100">{name}</span>+ <span className="text-xs text-mineshaft-400">{subtitle}</span>+ </div>+ <ExternalLinkIcon className="size-3.5 text-mineshaft-400" />+ </Link>+ );+};+export const GatewayConnectedResourcesDrawer = ({isOpen,onOpenChange,@@ -119,169 +92,220 @@ export const GatewayConnectedResourcesDrawer = ({const totalCount = getTotalResourceCount(resources);const typeCount = getResourceTypeCount(resources);+ const defaultOpenSections = [+ resources?.appConnections.length ? "app-connections" : null,+ resources?.dynamicSecrets.length ? "dynamic-secrets" : null,+ resources?.pamResources.length ? "pam-resources" : null,+ resources?.pamDiscoverySources.length ? "pam-discovery" : null,+ resources?.kubernetesAuths.length ? "kubernetes-auth" : null,+ resources?.mcpServers.length ? "mcp-servers" : null,+ resources?.pkiDiscoveryConfigs.length ? "pki-discovery" : null+ ].filter(Boolean) as string[];+return (- <Drawer isOpen={isOpen} onOpenChange={onOpenChange}>- <DrawerContent- title="Connected Resources"- subTitle={gatewayName}- className="w-[400px]"- footerContent={- totalCount > 0 ? (- <div className="text-xs text-mineshaft-400">- To delete this gateway, first remove or reassign these connected resources.- </div>- ) : null- }- >- {isPending ? (- <div className="flex h-32 items-center justify-center">- <Spinner size="lg" />- </div>- ) : (- <div>- <div className="mb-4 text-sm text-mineshaft-300">- {totalCount > 0 ? (- <>- {totalCount} resource{totalCount !== 1 ? "s" : ""} connected across {typeCount}{" "}- type{typeCount !== 1 ? "s" : ""}- </>- ) : (- "No resources connected to this gateway"- )}+ <Sheet open={isOpen} onOpenChange={onOpenChange}>+ <SheetContent className="overflow-y-auto">+ <SheetHeader className="border-b border-mineshaft-600">+ <SheetTitle>Connected Resources</SheetTitle>+ <SheetDescription>{gatewayName}</SheetDescription>+ </SheetHeader>++ <div className="flex-1 px-4">+ {isPending ? (+ <div className="flex h-32 items-center justify-center">+ <Spinner size="lg" /></div>+ ) : (+ <div className="flex flex-col gap-4">+ <p className="text-sm text-mineshaft-300">+ {totalCount > 0 ? (+ <>+ {totalCount} resource{totalCount !== 1 ? "s" : ""} connected across {typeCount}{" "}+ type{typeCount !== 1 ? "s" : ""}+ </>+ ) : (+ "No resources connected to this gateway"+ )}+ </p>- <div className="rounded-md border border-mineshaft-600">- <ResourceSection- title="App Connections"- count={resources?.appConnections.length ?? 0}- icon={<FontAwesomeIcon icon={faLink} className="h-3 w-3 text-primary-500" />}- >- {resources?.appConnections.map((conn) => (- <ResourceItem- key={conn.id}- name={conn.name}- subtitle={- conn.projectName- ? `${conn.app} · ${conn.projectName}`- : `${conn.app} · Organization`- }- to="/organizations/$orgId/app-connections/"- params={{ orgId: currentOrg.id }}- />- ))}- </ResourceSection>+ {totalCount > 0 && (+ <UnstableAccordion type="multiple" defaultValue={defaultOpenSections}>+ {(resources?.appConnections.length ?? 0) > 0 && (+ <UnstableAccordionItem value="app-connections">+ <UnstableAccordionTrigger>+ <span className="flex-1">App Connections</span>+ <Badge variant="neutral">{resources?.appConnections.length}</Badge>+ </UnstableAccordionTrigger>+ <UnstableAccordionContent className="p-0">+ {resources?.appConnections.map((conn, idx) => (+ <ResourceRow+ key={conn.id}+ name={conn.name}+ subtitle={+ conn.projectName+ ? `${conn.app} · ${conn.projectName}`+ : `${conn.app} · Organization`+ }+ to="/organizations/$orgId/app-connections/"+ params={{ orgId: currentOrg.id }}+ isLast={idx === (resources?.appConnections.length ?? 0) - 1}+ />+ ))}+ </UnstableAccordionContent>+ </UnstableAccordionItem>+ )}- <ResourceSection- title="Dynamic Secrets"- count={resources?.dynamicSecrets.length ?? 0}- icon={<span className="text-yellow-500">✧</span>}- >- {resources?.dynamicSecrets.map((ds) => (- <ResourceItem- key={ds.id}- name={ds.name}- subtitle={`${ds.environmentSlug} · ${ds.projectName}`}- to="/organizations/$orgId/projects/secret-management/$projectId/secrets/$envSlug"- params={{- orgId: currentOrg.id,- projectId: ds.projectId,- envSlug: ds.environmentSlug- }}- />- ))}- </ResourceSection>+ {(resources?.dynamicSecrets.length ?? 0) > 0 && (+ <UnstableAccordionItem value="dynamic-secrets">+ <UnstableAccordionTrigger>+ <span className="flex-1">Dynamic Secrets</span>+ <Badge variant="neutral">{resources?.dynamicSecrets.length}</Badge>+ </UnstableAccordionTrigger>+ <UnstableAccordionContent className="p-0">+ {resources?.dynamicSecrets.map((ds, idx) => (+ <ResourceRow+ key={ds.id}+ name={ds.name}+ subtitle={`${ds.environmentSlug} · ${ds.projectName}`}+ to="/organizations/$orgId/projects/secret-management/$projectId/secrets/$envSlug"+ params={{+ orgId: currentOrg.id,+ projectId: ds.projectId,+ envSlug: ds.environmentSlug+ }}+ isLast={idx === (resources?.dynamicSecrets.length ?? 0) - 1}+ />+ ))}+ </UnstableAccordionContent>+ </UnstableAccordionItem>+ )}- <ResourceSection- title="PAM Resources"- count={resources?.pamResources.length ?? 0}- icon={<span className="text-green-500">⊕</span>}- >- {resources?.pamResources.map((res) => (- <ResourceItem- key={res.id}- name={res.name}- subtitle={`${res.resourceType} · ${res.projectName}`}- to="/organizations/$orgId/projects/pam/$projectId/resources/"- params={{ orgId: currentOrg.id, projectId: res.projectId }}- />- ))}- </ResourceSection>+ {(resources?.pamResources.length ?? 0) > 0 && (+ <UnstableAccordionItem value="pam-resources">+ <UnstableAccordionTrigger>+ <span className="flex-1">PAM Resources</span>+ <Badge variant="neutral">{resources?.pamResources.length}</Badge>+ </UnstableAccordionTrigger>+ <UnstableAccordionContent className="p-0">+ {resources?.pamResources.map((res, idx) => (+ <ResourceRow+ key={res.id}+ name={res.name}+ subtitle={`${res.resourceType} · ${res.projectName}`}+ to="/organizations/$orgId/projects/pam/$projectId/resources/"+ params={{ orgId: currentOrg.id, projectId: res.projectId }}+ isLast={idx === (resources?.pamResources.length ?? 0) - 1}+ />+ ))}+ </UnstableAccordionContent>+ </UnstableAccordionItem>+ )}- <ResourceSection- title="Discovery Sources"- count={resources?.pamDiscoverySources.length ?? 0}- icon={<span className="text-blue-500">◎</span>}- >- {resources?.pamDiscoverySources.map((source) => (- <ResourceItem- key={source.id}- name={source.name}- subtitle={source.projectName}- to="/organizations/$orgId/projects/pam/$projectId/discovery/"- params={{ orgId: currentOrg.id, projectId: source.projectId }}- />- ))}- </ResourceSection>+ {(resources?.pamDiscoverySources.length ?? 0) > 0 && (+ <UnstableAccordionItem value="pam-discovery">+ <UnstableAccordionTrigger>+ <span className="flex-1">Discovery Sources</span>+ <Badge variant="neutral">{resources?.pamDiscoverySources.length}</Badge>+ </UnstableAccordionTrigger>+ <UnstableAccordionContent className="p-0">+ {resources?.pamDiscoverySources.map((source, idx) => (+ <ResourceRow+ key={source.id}+ name={source.name}+ subtitle={source.projectName}+ to="/organizations/$orgId/projects/pam/$projectId/discovery/"+ params={{ orgId: currentOrg.id, projectId: source.projectId }}+ isLast={idx === (resources?.pamDiscoverySources.length ?? 0) - 1}+ />+ ))}+ </UnstableAccordionContent>+ </UnstableAccordionItem>+ )}- <ResourceSection- title="Kubernetes Auth"- count={resources?.kubernetesAuths.length ?? 0}- icon={<span className="text-purple-500">⎈</span>}- >- {resources?.kubernetesAuths.map((auth) => (- <ResourceItem- key={auth.id}- name={auth.identityName}- subtitle="Kubernetes Auth"- to="/organizations/$orgId/identities/$identityId"- params={{ orgId: currentOrg.id, identityId: auth.identityId }}- />- ))}- </ResourceSection>+ {(resources?.kubernetesAuths.length ?? 0) > 0 && (+ <UnstableAccordionItem value="kubernetes-auth">+ <UnstableAccordionTrigger>+ <span className="flex-1">Kubernetes Auth</span>+ <Badge variant="neutral">{resources?.kubernetesAuths.length}</Badge>+ </UnstableAccordionTrigger>+ <UnstableAccordionContent className="p-0">+ {resources?.kubernetesAuths.map((auth, idx) => (+ <ResourceRow+ key={auth.id}+ name={auth.identityName}+ subtitle="Kubernetes Auth"+ to="/organizations/$orgId/identities/$identityId"+ params={{ orgId: currentOrg.id, identityId: auth.identityId }}+ isLast={idx === (resources?.kubernetesAuths.length ?? 0) - 1}+ />+ ))}+ </UnstableAccordionContent>+ </UnstableAccordionItem>+ )}- <ResourceSection- title="MCP Servers"- count={resources?.mcpServers.length ?? 0}- icon={<span className="text-cyan-500">⬡</span>}- >- {resources?.mcpServers.map((server) => (- <ResourceItem- key={server.id}- name={server.name}- subtitle={server.projectName}- to="/organizations/$orgId/projects/ai/$projectId/mcp-servers/$serverId"- params={{- orgId: currentOrg.id,- projectId: server.projectId,- serverId: server.id- }}- />- ))}- </ResourceSection>+ {(resources?.mcpServers.length ?? 0) > 0 && (+ <UnstableAccordionItem value="mcp-servers">+ <UnstableAccordionTrigger>+ <span className="flex-1">MCP Servers</span>+ <Badge variant="neutral">{resources?.mcpServers.length}</Badge>+ </UnstableAccordionTrigger>+ <UnstableAccordionContent className="p-0">+ {resources?.mcpServers.map((server, idx) => (+ <ResourceRow+ key={server.id}+ name={server.name}+ subtitle={server.projectName}+ to="/organizations/$orgId/projects/ai/$projectId/mcp-servers/$serverId"+ params={{+ orgId: currentOrg.id,+ projectId: server.projectId,+ serverId: server.id+ }}+ isLast={idx === (resources?.mcpServers.length ?? 0) - 1}+ />+ ))}+ </UnstableAccordionContent>+ </UnstableAccordionItem>+ )}- <ResourceSection- title="PKI Discovery"- count={resources?.pkiDiscoveryConfigs.length ?? 0}- icon={<span className="text-orange-500">🔐</span>}- >- {resources?.pkiDiscoveryConfigs.map((config) => (- <ResourceItem- key={config.id}- name={config.name}- subtitle={config.projectName}- to="/organizations/$orgId/projects/cert-manager/$projectId/discovery/$discoveryId"- params={{- orgId: currentOrg.id,- projectId: config.projectId,- discoveryId: config.id- }}- />- ))}- </ResourceSection>+ {(resources?.pkiDiscoveryConfigs.length ?? 0) > 0 && (+ <UnstableAccordionItem value="pki-discovery">+ <UnstableAccordionTrigger>+ <span className="flex-1">PKI Discovery</span>+ <Badge variant="neutral">{resources?.pkiDiscoveryConfigs.length}</Badge>+ </UnstableAccordionTrigger>+ <UnstableAccordionContent className="p-0">+ {resources?.pkiDiscoveryConfigs.map((config, idx) => (+ <ResourceRow+ key={config.id}+ name={config.name}+ subtitle={config.projectName}+ to="/organizations/$orgId/projects/cert-manager/$projectId/discovery/$discoveryId"+ params={{+ orgId: currentOrg.id,+ projectId: config.projectId,+ discoveryId: config.id+ }}+ isLast={idx === (resources?.pkiDiscoveryConfigs.length ?? 0) - 1}+ />+ ))}+ </UnstableAccordionContent>+ </UnstableAccordionItem>+ )}+ </UnstableAccordion>+ )}</div>- </div>+ )}+ </div>++ {totalCount > 0 && (+ <SheetFooter>+ <p className="text-xs text-mineshaft-400">+ To delete this gateway, first remove or reassign these connected resources.+ </p>+ </SheetFooter>)}- </DrawerContent>- </Drawer>+ </SheetContent>+ </Sheet>);};