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
use modal other than tooltip
Thiago Araujo da Silva5b88bae9e563
diff --git a/frontend/src/pages/organization/SettingsPage/components/AuditLogStreamTab/components/AuditLogStreamRow.tsx b/frontend/src/pages/organization/SettingsPage/components/AuditLogStreamTab/components/AuditLogStreamRow.tsxindex 73a6a74d38..3e02681555 100644--- a/frontend/src/pages/organization/SettingsPage/components/AuditLogStreamTab/components/AuditLogStreamRow.tsx+++ b/frontend/src/pages/organization/SettingsPage/components/AuditLogStreamTab/components/AuditLogStreamRow.tsx@@ -1,6 +1,5 @@import { faAsterisk, faEllipsisV, faTrash } from "@fortawesome/free-solid-svg-icons";import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";-import { AlertTriangleIcon } from "lucide-react";import { twMerge } from "tailwind-merge";import { OrgPermissionCan } from "@app/components/permissions";@@ -14,13 +13,12 @@ import {Tooltip,Tr} from "@app/components/v2";-import { Tooltip as TooltipV3, TooltipContent, TooltipTrigger } from "@app/components/v3";import { OrgPermissionSubjects } from "@app/context";import { OrgPermissionActions } from "@app/context/OrgPermissionContext/types";import { AUDIT_LOG_STREAM_PROVIDER_MAP, getProviderUrl } from "@app/helpers/auditLogStreams";import { TAuditLogStream } from "@app/hooks/api/types";-import { LastErrorSection } from "./LastErrorSection";+import { LastErrorDialog } from "./LastErrorDialog";type Props = {logStream: TAuditLogStream;@@ -66,20 +64,10 @@ export const AuditLogStreamRow = ({ logStream, onDelete, onEditCredentials }: Pr<div className="flex w-full items-center gap-2"><p className="truncate">{url}</p>{hasLastError && (- <TooltipV3>- <TooltipTrigger>- <AlertTriangleIcon- className="size-4 shrink-0 text-yellow-500"- aria-label="Stream is failing"- />- </TooltipTrigger>- <TooltipContent className="max-w-96 min-w-52 px-3">- <LastErrorSection- lastErrorMessage={lastErrorMessage ?? null}- lastErrorTimestamp={lastErrorTimestamp ?? null}- />- </TooltipContent>- </TooltipV3>+ <LastErrorDialog+ lastErrorMessage={lastErrorMessage ?? null}+ lastErrorTimestamp={lastErrorTimestamp ?? null}+ />)}</div></Td>diff --git a/frontend/src/pages/organization/SettingsPage/components/AuditLogStreamTab/components/LastErrorDialog.tsx b/frontend/src/pages/organization/SettingsPage/components/AuditLogStreamTab/components/LastErrorDialog.tsxnew file mode 100644index 0000000000..29a6cde94b--- /dev/null+++ b/frontend/src/pages/organization/SettingsPage/components/AuditLogStreamTab/components/LastErrorDialog.tsx@@ -0,0 +1,82 @@+import { useState } from "react";+import { format } from "date-fns";+import { AlertTriangleIcon, CheckIcon, CopyIcon } from "lucide-react";++import { createNotification } from "@app/components/notifications";+import {+ Button,+ Dialog,+ DialogClose,+ DialogContent,+ DialogFooter,+ DialogHeader,+ DialogTitle,+ Tooltip,+ TooltipContent,+ TooltipTrigger+} from "@app/components/v3";+import { useTimedReset } from "@app/hooks";++type Props = {+ lastErrorMessage: string | null;+ lastErrorTimestamp: string | null;+};++export const LastErrorDialog = ({ lastErrorMessage, lastErrorTimestamp }: Props) => {+ const [isOpen, setIsOpen] = useState(false);+ const [, isCopied, setCopied] = useTimedReset<string>({ initialState: "" });++ const handleCopy = async () => {+ if (!lastErrorMessage) return;+ await navigator.clipboard.writeText(lastErrorMessage);+ setCopied("copied");+ createNotification({ type: "success", text: "Error message copied to clipboard" });+ };++ return (+ <Dialog open={isOpen} onOpenChange={setIsOpen}>+ <Tooltip>+ <TooltipTrigger asChild>+ <button+ type="button"+ aria-label="View last error"+ onClick={() => setIsOpen(true)}+ className="flex shrink-0 cursor-pointer items-center rounded-sm p-0.5 text-yellow-500 outline-none hover:bg-foreground/10 focus-visible:ring-2 focus-visible:ring-ring"+ >+ <AlertTriangleIcon className="size-4" />+ </button>+ </TooltipTrigger>+ <TooltipContent>Click to view error</TooltipContent>+ </Tooltip>+ <DialogContent className="max-w-2xl">+ <DialogHeader>+ <DialogTitle className="flex items-center gap-2">+ <AlertTriangleIcon className="size-5 text-yellow-500" />+ Last Error+ </DialogTitle>+ {lastErrorTimestamp && (+ <p className="text-xs text-accent">{format(lastErrorTimestamp, "PPpp")}</p>+ )}+ </DialogHeader>+ {lastErrorMessage ? (+ <pre className="max-h-80 overflow-auto rounded-md border border-border bg-container/50 p-3 font-mono text-xs whitespace-pre-wrap text-foreground select-all">+ {lastErrorMessage}+ </pre>+ ) : (+ <p className="text-sm text-accent">No error message available.</p>+ )}+ <DialogFooter>+ <DialogClose asChild>+ <Button variant="ghost">Close</Button>+ </DialogClose>+ {lastErrorMessage && (+ <Button variant="neutral" onClick={handleCopy}>+ {isCopied ? <CheckIcon /> : <CopyIcon />}+ {isCopied ? "Copied" : "Copy"}+ </Button>+ )}+ </DialogFooter>+ </DialogContent>+ </Dialog>+ );+};diff --git a/frontend/src/pages/organization/SettingsPage/components/AuditLogStreamTab/components/LastErrorSection.tsx b/frontend/src/pages/organization/SettingsPage/components/AuditLogStreamTab/components/LastErrorSection.tsxdeleted file mode 100644index bde5884c77..0000000000--- a/frontend/src/pages/organization/SettingsPage/components/AuditLogStreamTab/components/LastErrorSection.tsx+++ /dev/null@@ -1,37 +0,0 @@-import { format } from "date-fns";-import { ClockIcon, MessageSquareWarningIcon } from "lucide-react";--type Props = {- lastErrorMessage: string | null;- lastErrorTimestamp: string | null;-};--export const LastErrorSection = ({ lastErrorMessage, lastErrorTimestamp }: Props) => (- <div className="py-1">- <div className="mb-2 flex items-center gap-2 border-b border-foreground/25 pb-1">- <div className="font-medium">Last Error</div>- </div>- {lastErrorMessage && (- <div className="mb-2 flex items-start gap-2 text-sm">- <div className="flex items-center justify-center rounded-sm bg-container/50 p-2">- <MessageSquareWarningIcon className="size-5" />- </div>- <div className="flex flex-col">- <div className="text-xs font-medium text-label">Message</div>- <div className="text-sm break-words">{lastErrorMessage}</div>- </div>- </div>- )}- {lastErrorTimestamp && (- <div className="flex items-center gap-2 text-sm">- <div className="flex items-center justify-center rounded-sm bg-container/50 p-2">- <ClockIcon className="size-5" />- </div>- <div className="flex flex-col">- <div className="text-xs font-medium text-label">Time</div>- <div className="text-sm">{format(lastErrorTimestamp, "PPpp")}</div>- </div>- </div>- )}- </div>-);