Skip to content

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

improvement(ui): migrate rotation, integration management and PAM overlays to V3 (#8610)

Andrew Huang50a1d6cf51ac
diff --git a/frontend/src/components/secret-rotations-v2/DeleteSecretRotationV2Modal.tsx b/frontend/src/components/secret-rotations-v2/DeleteSecretRotationV2Modal.tsx
index 86826b24db..8d7db46c23 100644
--- a/frontend/src/components/secret-rotations-v2/DeleteSecretRotationV2Modal.tsx
+++ b/frontend/src/components/secret-rotations-v2/DeleteSecretRotationV2Modal.tsx
@@ -1,7 +1,8 @@
import { useEffect, useState } from "react";
import { createNotification } from "@app/components/notifications";
-import { DeleteActionModal, Switch } from "@app/components/v2";
+import { Field, FieldContent, FieldDescription, FieldLabel, Toggle } from "@app/components/v3";
+import { DeleteConfirmDialog } from "@app/components/v3/platform";
import { SECRET_ROTATION_MAP } from "@app/helpers/secretRotationsV2";
import { TSecretRotationV2 } from "@app/hooks/api/secretRotationsV2";
import { useDeleteSecretRotationV2 } from "@app/hooks/api/secretRotationsV2/mutations";
@@ -56,40 +57,44 @@ export const DeleteSecretRotationV2Modal = ({
};
return (
- <DeleteActionModal
+ <DeleteConfirmDialog
isOpen={isOpen}
- onChange={onOpenChange}
+ onOpenChange={onOpenChange}
title={`Are you sure you want to delete ${name}?`}
- deleteKey={name}
- onDeleteApproved={handleDeleteSecretRotation}
+ description="This action is irreversible."
+ confirmKey={name}
+ onConfirm={handleDeleteSecretRotation}
>
- <Switch
- containerClassName="mt-4"
- className="bg-muted/50 shadow-inner data-[state=checked]:bg-danger/50"
- thumbClassName="bg-surface-raised"
- isChecked={revokeGeneratedCredentials}
- onCheckedChange={setRevokeGeneratedCredentials}
- id="revoke-credentials"
- >
- Revoke Credentials
- </Switch>
- <p className="mt-1 font-sans text-sm text-muted">
- Generated credentials will {revokeGeneratedCredentials ? "" : "not"} be revoked on deletion
- {revokeGeneratedCredentials ? "" : " and remain active"}.
- </p>
- <Switch
- containerClassName="mt-4"
- className="bg-muted/50 shadow-inner data-[state=checked]:bg-danger/50"
- thumbClassName="bg-surface-raised"
- isChecked={deleteSecrets}
- onCheckedChange={setDeleteSecrets}
- id="delete-secrets"
- >
- Delete Secrets
- </Switch>
- <p className="mt-1 font-sans text-sm text-muted">
- Rotation secrets will {deleteSecrets ? "" : "not"} be removed from your project on deletion.
- </p>
- </DeleteActionModal>
+ <Field orientation="horizontal">
+ <FieldContent>
+ <FieldLabel htmlFor="revoke-credentials">Revoke Credentials</FieldLabel>
+ <FieldDescription>
+ Generated credentials will {revokeGeneratedCredentials ? "" : "not"} be revoked on
+ deletion{revokeGeneratedCredentials ? "" : " and remain active"}.
+ </FieldDescription>
+ </FieldContent>
+ <Toggle
+ id="revoke-credentials"
+ variant="danger"
+ checked={revokeGeneratedCredentials}
+ onCheckedChange={setRevokeGeneratedCredentials}
+ />
+ </Field>
+ <Field orientation="horizontal">
+ <FieldContent>
+ <FieldLabel htmlFor="delete-secrets">Delete Secrets</FieldLabel>
+ <FieldDescription>
+ Rotation secrets will {deleteSecrets ? "" : "not"} be removed from your project on
+ deletion.
+ </FieldDescription>
+ </FieldContent>
+ <Toggle
+ id="delete-secrets"
+ variant="danger"
+ checked={deleteSecrets}
+ onCheckedChange={setDeleteSecrets}
+ />
+ </Field>
+ </DeleteConfirmDialog>
);
};
diff --git a/frontend/src/components/secret-rotations-v2/ReconcileLocalAccountRotationModal.tsx b/frontend/src/components/secret-rotations-v2/ReconcileLocalAccountRotationModal.tsx
index 273a163a22..06fb3bda62 100644
--- a/frontend/src/components/secret-rotations-v2/ReconcileLocalAccountRotationModal.tsx
+++ b/frontend/src/components/secret-rotations-v2/ReconcileLocalAccountRotationModal.tsx
@@ -1,10 +1,16 @@
import { createNotification } from "@app/components/notifications";
-import { Button, Modal, ModalClose, ModalContent } from "@app/components/v2";
+import {
+ Button,
+ Dialog,
+ DialogClose,
+ DialogContent,
+ DialogDescription,
+ DialogFooter,
+ DialogHeader,
+ DialogTitle
+} from "@app/components/v3";
import { SecretRotation, TSecretRotationV2 } from "@app/hooks/api/secretRotationsV2";
import { useReconcileLocalAccountRotation } from "@app/hooks/api/secretRotationsV2/mutations";
-import { THpIloRotation } from "@app/hooks/api/secretRotationsV2/types/hp-ilo-rotation";
-import { TUnixLinuxLocalAccountRotation } from "@app/hooks/api/secretRotationsV2/types/unix-linux-local-account-rotation";
-import { TWindowsLocalAccountRotation } from "@app/hooks/api/secretRotationsV2/types/windows-local-account-rotation";
type Props = {
secretRotation?: TSecretRotationV2;
@@ -12,30 +18,34 @@ type Props = {
onOpenChange: (isOpen: boolean) => void;
};
-type ContentProps = {
- secretRotation: TUnixLinuxLocalAccountRotation | TWindowsLocalAccountRotation | THpIloRotation;
- onComplete: () => void;
-};
-
const getRotationTypeName = (type: SecretRotation): string => {
if (type === SecretRotation.UnixLinuxLocalAccount) return "Unix/Linux Local Account";
if (type === SecretRotation.WindowsLocalAccount) return "Windows Local Account";
return "HP iLO Local Account";
};
-const Content = ({ secretRotation, onComplete }: ContentProps) => {
+export const ReconcileLocalAccountRotationModal = ({
+ isOpen,
+ onOpenChange,
+ secretRotation
+}: Props) => {
const reconcileLocalAccount = useReconcileLocalAccountRotation();
+ if (
+ !secretRotation ||
+ (secretRotation.type !== SecretRotation.UnixLinuxLocalAccount &&
+ secretRotation.type !== SecretRotation.WindowsLocalAccount &&
+ secretRotation.type !== SecretRotation.HpIloLocalAccount)
+ )
+ return null;
+
const { id: rotationId, projectId, folder, type } = secretRotation;
const rotationTypeName = getRotationTypeName(type);
const handleReconcile = async () => {
const result = await reconcileLocalAccount.mutateAsync({
rotationId,
- type: type as
- | SecretRotation.UnixLinuxLocalAccount
- | SecretRotation.WindowsLocalAccount
- | SecretRotation.HpIloLocalAccount,
+ type,
projectId,
secretPath: folder.path
});
@@ -47,69 +57,41 @@ const Content = ({ secretRotation, onComplete }: ContentProps) => {
type: "success"
});
- onComplete();
+ onOpenChange(false);
};
return (
- <div>
- <p className="mb-4 text-sm text-foreground-secondary">
- Reconciliation ensures the password stored in Infisical matches the actual password on the
- server.
- </p>
- <p className="mb-8 text-sm text-foreground-secondary">
- Use this if you suspect the credentials are out of sync, for example after a failed rotation
- or manual password change on the server.
- </p>
- <div className="mt-8 flex w-full items-center justify-between gap-2">
- <ModalClose asChild>
- <Button colorSchema="secondary" variant="plain">
- Cancel
+ <Dialog open={isOpen} onOpenChange={onOpenChange}>
+ <DialogContent isPending={reconcileLocalAccount.isPending}>
+ <DialogHeader>
+ <DialogTitle>Reconcile {rotationTypeName}</DialogTitle>
+ <DialogDescription>
+ Sync the {rotationTypeName} password between Infisical and the server.
+ </DialogDescription>
+ </DialogHeader>
+ <div className="flex flex-col gap-4 text-sm text-foreground-secondary">
+ <p>
+ Reconciliation ensures the password stored in Infisical matches the actual password on
+ the server.
+ </p>
+ <p>
+ Use this if you suspect the credentials are out of sync, for example after a failed
+ rotation or manual password change on the server.
+ </p>
+ </div>
+ <DialogFooter>
+ <DialogClose asChild>
+ <Button variant="ghost">Cancel</Button>
+ </DialogClose>
+ <Button
+ variant="project"
+ onClick={() => handleReconcile().catch(() => undefined)}
+ isPending={reconcileLocalAccount.isPending}
+ >
+ Reconcile
</Button>
- </ModalClose>
- <Button
- onClick={handleReconcile}
- isDisabled={reconcileLocalAccount.isPending}
- isLoading={reconcileLocalAccount.isPending}
- colorSchema="secondary"
- >
- Reconcile
- </Button>
- </div>
- </div>
- );
-};
-
-export const ReconcileLocalAccountRotationModal = ({
- isOpen,
- onOpenChange,
- secretRotation
-}: Props) => {
- if (
- !secretRotation ||
- (secretRotation.type !== SecretRotation.UnixLinuxLocalAccount &&
- secretRotation.type !== SecretRotation.WindowsLocalAccount &&
- secretRotation.type !== SecretRotation.HpIloLocalAccount)
- )
- return null;
-
- const rotationTypeName = getRotationTypeName(secretRotation.type);
-
- return (
- <Modal isOpen={isOpen} onOpenChange={onOpenChange}>
- <ModalContent
- title={`Reconcile ${rotationTypeName}`}
- subTitle={`Sync the ${rotationTypeName} password between Infisical and the server.`}
- >
- <Content
- secretRotation={
- secretRotation as
- | TUnixLinuxLocalAccountRotation
- | TWindowsLocalAccountRotation
- | THpIloRotation
- }
- onComplete={() => onOpenChange(false)}
- />
- </ModalContent>
- </Modal>
+ </DialogFooter>
+ </DialogContent>
+ </Dialog>
);
};
diff --git a/frontend/src/components/secret-rotations-v2/RotateSecretRotationV2Modal.tsx b/frontend/src/components/secret-rotations-v2/RotateSecretRotationV2Modal.tsx
index 2342e889f2..8e1dad54cf 100644
--- a/frontend/src/components/secret-rotations-v2/RotateSecretRotationV2Modal.tsx
+++ b/frontend/src/components/secret-rotations-v2/RotateSecretRotationV2Modal.tsx
@@ -1,5 +1,14 @@
import { createNotification } from "@app/components/notifications";
-import { Button, Modal, ModalClose, ModalContent } from "@app/components/v2";
+import {
+ Button,
+ Dialog,
+ DialogClose,
+ DialogContent,
+ DialogDescription,
+ DialogFooter,
+ DialogHeader,
+ DialogTitle
+} from "@app/components/v3";
import { SECRET_ROTATION_MAP } from "@app/helpers/secretRotationsV2";
import { TSecretRotationV2 } from "@app/hooks/api/secretRotationsV2";
import { useRotateSecretRotationV2 } from "@app/hooks/api/secretRotationsV2/mutations";
@@ -10,14 +19,11 @@ type Props = {
onOpenChange: (isOpen: boolean) => void;
};
-type ContentProps = {
- secretRotation: TSecretRotationV2;
- onComplete: () => void;
-};
-
-const Content = ({ secretRotation, onComplete }: ContentProps) => {
+export const RotateSecretRotationV2Modal = ({ isOpen, onOpenChange, secretRotation }: Props) => {
const rotateSecrets = useRotateSecretRotationV2();
+ if (!secretRotation) return null;
+
const { id: rotationId, type, projectId, folder } = secretRotation;
const rotationType = SECRET_ROTATION_MAP[type].name;
@@ -34,46 +40,32 @@ const Content = ({ secretRotation, onComplete }: ContentProps) => {
type: "success"
});
- onComplete();
+ onOpenChange(false);
};
return (
- <div>
- <p className="mb-8 text-sm text-foreground-secondary">
- Are you sure you want to rotate the secrets for this {rotationType} Rotation?
- </p>
- <div className="mt-8 flex w-full items-center justify-between gap-2">
- <ModalClose asChild>
- <Button colorSchema="secondary" variant="plain">
- Cancel
+ <Dialog open={isOpen} onOpenChange={onOpenChange}>
+ <DialogContent isPending={rotateSecrets.isPending}>
+ <DialogHeader>
+ <DialogTitle>Rotate Secrets</DialogTitle>
+ <DialogDescription>Rotate the secrets for this {rotationType}.</DialogDescription>
+ </DialogHeader>
+ <p className="text-sm text-foreground-secondary">
+ Are you sure you want to rotate the secrets for this {rotationType} Rotation?
+ </p>
+ <DialogFooter>
+ <DialogClose asChild>
+ <Button variant="ghost">Cancel</Button>
+ </DialogClose>
+ <Button
+ variant="project"
+ onClick={() => handleRotateSecrets().catch(() => undefined)}
+ isPending={rotateSecrets.isPending}
+ >
+ Rotate Secrets
</Button>
- </ModalClose>
- <Button
- onClick={handleRotateSecrets}
- isDisabled={rotateSecrets.isPending}
- isLoading={rotateSecrets.isPending}
- colorSchema="secondary"
- >
- Rotate Secrets
- </Button>
- </div>
- </div>
- );
-};
-
-export const RotateSecretRotationV2Modal = ({ isOpen, onOpenChange, secretRotation }: Props) => {
- if (!secretRotation) return null;
-
- const rotationType = SECRET_ROTATION_MAP[secretRotation.type].name;
-
- return (
- <Modal isOpen={isOpen} onOpenChange={onOpenChange}>
- <ModalContent
- title="Rotate Secrets"
- subTitle={`Rotate the secrets for this ${rotationType}.`}
- >
- <Content secretRotation={secretRotation} onComplete={() => onOpenChange(false)} />
- </ModalContent>
- </Modal>
+ </DialogFooter>
+ </DialogContent>
+ </Dialog>
);
};
diff --git a/frontend/src/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/ViewSecretRotationV2GeneratedCredentials.tsx b/frontend/src/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/ViewSecretRotationV2GeneratedCredentials.tsx
index 1576cd4ae7..0114a97862 100644
--- a/frontend/src/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/ViewSecretRotationV2GeneratedCredentials.tsx
+++ b/frontend/src/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/ViewSecretRotationV2GeneratedCredentials.tsx
@@ -2,14 +2,24 @@ import { ReactNode } from "react";
import { faRotate } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { format } from "date-fns";
+import { InfoIcon } from "lucide-react";
import { ViewAuth0ClientSecretRotationGeneratedCredentials } from "@app/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/ViewAuth0ClientSecretRotationGeneratedCredentials";
import { ViewAzureClientSecretRotationGeneratedCredentials } from "@app/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/ViewAzureClientSecretRotationGeneratedCredentials";
import { ViewConvexAccessKeyRotationGeneratedCredentials } from "@app/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/ViewConvexAccessKeyRotationGeneratedCredentials";
import { ViewDatabricksServicePrincipalSecretRotationGeneratedCredentials } from "@app/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/ViewDatabricksServicePrincipalSecretRotationGeneratedCredentials";
import { ViewLdapPasswordRotationGeneratedCredentials } from "@app/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/ViewLdapPasswordRotationGeneratedCredentials";
-import { Modal, ModalContent, Spinner } from "@app/components/v2";
-import { NoticeBannerV2 } from "@app/components/v2/NoticeBannerV2/NoticeBannerV2";
+import {
+ Alert,
+ AlertDescription,
+ AlertTitle,
+ Dialog,
+ DialogContent,
+ DialogDescription,
+ DialogHeader,
+ DialogTitle,
+ Spinner
+} from "@app/components/v3";
import { APP_CONNECTION_MAP } from "@app/helpers/appConnections";
import { IS_ROTATION_DUAL_CREDENTIALS, SECRET_ROTATION_MAP } from "@app/helpers/secretRotationsV2";
import {
@@ -62,7 +72,7 @@ const Content = ({ secretRotation }: ContentProps) => {
if (isPending) {
return (
<div className="flex h-full flex-col items-center justify-center py-2.5">
- <Spinner size="lg" className="text-surface-selected" />
+ <Spinner size="lg" label="Loading generated credentials" />
<p className="mt-4 text-sm text-muted">Loading generated credentials...</p>
</div>
);
@@ -274,21 +284,25 @@ const Content = ({ secretRotation }: ContentProps) => {
<div className="flex flex-col gap-y-4">
{Component}
{!IS_ROTATION_DUAL_CREDENTIALS[type] && (
- <NoticeBannerV2 title={`${appName} Retired Credentials Behavior`}>
- <p className="text-sm text-label">
- Due to {SECRET_ROTATION_MAP[type].name} Rotations utilizing a single credential set,
- retired credentials will not be able to authenticate with {appName} during their{" "}
- <a
- target="_blank"
- href="https://infisical.com/docs/documentation/platform/secret-rotation/overview#how-rotation-works"
- rel="noopener noreferrer"
- className="underline decoration-project underline-offset-2 hover:text-foreground-secondary"
- >
- inactive period
- </a>
- . This is a limitation of {appName} and cannot be rectified by Infisical.
- </p>
- </NoticeBannerV2>
+ <Alert variant="info">
+ <InfoIcon />
+ <AlertTitle>{appName} Retired Credentials Behavior</AlertTitle>
+ <AlertDescription>
+ <p>
+ Due to {SECRET_ROTATION_MAP[type].name} Rotations utilizing a single credential set,
+ retired credentials will not be able to authenticate with {appName} during their{" "}
+ <a
+ target="_blank"
+ href="https://infisical.com/docs/documentation/platform/secret-rotation/overview#how-rotation-works"
+ rel="noopener noreferrer"
+ className="underline underline-offset-2 hover:text-info"
+ >
+ inactive period
+ </a>
+ . This is a limitation of {appName} and cannot be rectified by Infisical.
+ </p>
+ </AlertDescription>
+ </Alert>
)}
{nextRotationAt && (
<div className="flex items-center gap-x-1.5 text-sm text-foreground-secondary">
@@ -313,16 +327,18 @@ export const ViewSecretRotationV2GeneratedCredentialsModal = ({
const rotationType = SECRET_ROTATION_MAP[secretRotation.type].name;
return (
- <Modal isOpen={isOpen} onOpenChange={onOpenChange}>
- <ModalContent
+ <Dialog open={isOpen} onOpenChange={onOpenChange}>
+ <DialogContent
onOpenAutoFocus={(event) => {
event.preventDefault();
}}
- title="Generated Credentials"
- subTitle={`View the current and retired ${rotationType}.`}
>
+ <DialogHeader>
+ <DialogTitle>Generated Credentials</DialogTitle>
+ <DialogDescription>View the current and retired {rotationType}.</DialogDescription>
+ </DialogHeader>
<Content secretRotation={secretRotation} />
- </ModalContent>
- </Modal>
+ </DialogContent>
+ </Dialog>
);
};
diff --git a/frontend/src/pages/pam/PamAccessControlPage/components/GroupsTab.tsx b/frontend/src/pages/pam/PamAccessControlPage/components/GroupsTab.tsx
index b42cdb6c77..807679a5ea 100644
--- a/frontend/src/pages/pam/PamAccessControlPage/components/GroupsTab.tsx
+++ b/frontend/src/pages/pam/PamAccessControlPage/components/GroupsTab.tsx
@@ -5,7 +5,6 @@ import { MoreHorizontalIcon, PencilIcon, Plus, SearchIcon, Trash2Icon } from "lu
import { createNotification } from "@app/components/notifications";
import { ProjectPermissionCan } from "@app/components/permissions";
import { HighlightText } from "@app/components/utilities/HighlightText";
-import { DeleteActionModal } from "@app/components/v2";
import {
Badge,
Button,
@@ -32,6 +31,7 @@ import {
TableHeader,
TableRow
} from "@app/components/v3";
+import { DeleteConfirmDialog } from "@app/components/v3/platform";
import { ProjectPermissionActions, ProjectPermissionSub, useProject } from "@app/context";
import { formatProjectRoleName } from "@app/helpers/roles";
import { useListWorkspaceGroups } from "@app/hooks/api";
@@ -219,15 +219,16 @@ export const GroupsTab = () => {
}}
/>
- <DeleteActionModal
+ <DeleteConfirmDialog
isOpen={!!groupToRemove}
- onChange={(isOpen) => {
+ onOpenChange={(isOpen) => {
if (!isOpen) setGroupToRemove(null);
}}
title={`Remove ${groupToRemove?.group.name ?? "group"}?`}
- deleteKey="remove"
- buttonText="Remove"
- onDeleteApproved={handleDeleteGroup}
+ description="This action is irreversible."
+ confirmKey="remove"
+ confirmLabel="Remove"
+ onConfirm={handleDeleteGroup}
/>
</div>
);
diff --git a/frontend/src/pages/pam/PamAccessControlPage/components/MembersTab.tsx b/frontend/src/pages/pam/PamAccessControlPage/components/MembersTab.tsx
index 5bf41dc914..6a7a09c9c6 100644
--- a/frontend/src/pages/pam/PamAccessControlPage/components/MembersTab.tsx
+++ b/frontend/src/pages/pam/PamAccessControlPage/components/MembersTab.tsx
@@ -5,7 +5,6 @@ import { MoreHorizontalIcon, PencilIcon, Plus, SearchIcon, Trash2Icon } from "lu
import { createNotification } from "@app/components/notifications";
import { ProjectPermissionCan } from "@app/components/permissions";
import { HighlightText } from "@app/components/utilities/HighlightText";
-import { DeleteActionModal } from "@app/components/v2";
import {
Badge,
Button,
@@ -32,6 +31,7 @@ import {
TableHeader,
TableRow
} from "@app/components/v3";
+import { DeleteConfirmDialog } from "@app/components/v3/platform";
import { ProjectPermissionActions, ProjectPermissionSub, useProject, useUser } from "@app/context";
import { formatProjectRoleName } from "@app/helpers/roles";
import { useGetWorkspaceUsers } from "@app/hooks/api";
@@ -253,15 +253,16 @@ export const MembersTab = () => {
<InviteMemberModal isOpen={isInviteOpen} onOpenChange={setIsInviteOpen} />
- <DeleteActionModal
+ <DeleteConfirmDialog
isOpen={!!memberToRemove}
- onChange={(isOpen) => {
+ onOpenChange={(isOpen) => {
if (!isOpen) setMemberToRemove(null);
}}
title={`Remove ${memberToRemove ? getDisplayName(memberToRemove) : "member"}?`}
- deleteKey="remove"
- buttonText="Remove"
- onDeleteApproved={handleRemoveMember}
+ description="This action is irreversible."
+ confirmKey="remove"
+ confirmLabel="Remove"
+ onConfirm={handleRemoveMember}
/>
</div>
);
diff --git a/frontend/src/pages/pam/PamApprovalRequestsPage/components/ApprovalRequestDetailSheet.tsx b/frontend/src/pages/pam/PamApprovalRequestsPage/components/ApprovalRequestDetailSheet.tsx
index e77b0a0d9a..1e5c22cfb0 100644
--- a/frontend/src/pages/pam/PamApprovalRequestsPage/components/ApprovalRequestDetailSheet.tsx
+++ b/frontend/src/pages/pam/PamApprovalRequestsPage/components/ApprovalRequestDetailSheet.tsx
@@ -3,7 +3,6 @@ import { format } from "date-fns";
import { Check, Clock, KeyRound, ShieldAlert, ShieldCheck, X } from "lucide-react";
import { createNotification } from "@app/components/notifications";
-import { DeleteActionModal } from "@app/components/v2";
import {
Alert,
AlertDescription,
@@ -14,6 +13,7 @@ import {
TooltipContent,
TooltipTrigger
} from "@app/components/v3";
+import { DeleteConfirmDialog } from "@app/components/v3/platform";
import { useUser } from "@app/context";
import {
PamAccessRequestDecision,
@@ -89,14 +89,14 @@ export const ApprovalRequestDetailSheet = ({ request, isOpen, onOpenChange }: Pr
return (
<>
- <DeleteActionModal
+ <DeleteConfirmDialog
isOpen={isRevokeConfirmOpen}
- onChange={setIsRevokeConfirmOpen}
+ onOpenChange={setIsRevokeConfirmOpen}
title="Revoke Access"
- subTitle="Are you sure you want to revoke this user's approved access?"
- deleteKey="revoke"
- buttonText="Revoke"
- onDeleteApproved={handleRevoke}
+ description="Are you sure you want to revoke this user's approved access?"
+ confirmKey="revoke"
+ confirmLabel="Revoke"
+ onConfirm={handleRevoke}
/>
<PamDetailSheet
isOpen={isOpen}
diff --git a/frontend/src/pages/pam/PamDiscoveryPage/PamDiscoveryPage.tsx b/frontend/src/pages/pam/PamDiscoveryPage/PamDiscoveryPage.tsx
index 7f2b66cbbb..8e5b919b40 100644
--- a/frontend/src/pages/pam/PamDiscoveryPage/PamDiscoveryPage.tsx
+++ b/frontend/src/pages/pam/PamDiscoveryPage/PamDiscoveryPage.tsx
@@ -5,7 +5,6 @@ import { MoreHorizontal, Plus, Radar, Search, Trash2 } from "lucide-react";
import { createNotification } from "@app/components/notifications";
import { HighlightText } from "@app/components/utilities/HighlightText";
-import { DeleteActionModal } from "@app/components/v2";
import {
Button,
Card,
@@ -37,7 +36,7 @@ import {
TableRow
} from "@app/components/v3";
import { Skeleton } from "@app/components/v3/generic/Skeleton";
-import { PageHeader } from "@app/components/v3/platform";
+import { DeleteConfirmDialog, PageHeader } from "@app/components/v3/platform";
import {
TPamDiscoverySource,
useDeletePamDiscoverySource,
@@ -286,12 +285,13 @@ export const PamDiscoveryPage = () => {
}}
/>
- <DeleteActionModal
+ <DeleteConfirmDialog
isOpen={popUp.deleteSource.isOpen}
- onChange={(isOpen) => handlePopUpToggle("deleteSource", isOpen)}
+ onOpenChange={(isOpen) => handlePopUpToggle("deleteSource", isOpen)}
title={`Delete ${(popUp.deleteSource.data as TPamDiscoverySource | undefined)?.name ?? "source"}?`}
- deleteKey="confirm"
- onDeleteApproved={handleDelete}
+ description="This action is irreversible."
+ confirmKey="confirm"
+ onConfirm={handleDelete}
/>
</>
);
diff --git a/frontend/src/pages/pam/PamSessionsPage/PamSessionsPage.tsx b/frontend/src/pages/pam/PamSessionsPage/PamSessionsPage.tsx
index 64435effab..0d903c4ebe 100644
--- a/frontend/src/pages/pam/PamSessionsPage/PamSessionsPage.tsx
+++ b/frontend/src/pages/pam/PamSessionsPage/PamSessionsPage.tsx
@@ -7,7 +7,6 @@ import { Activity, Ban, SearchIcon, Video } from "lucide-react";
import { createNotification } from "@app/components/notifications";
import { HighlightText } from "@app/components/utilities/HighlightText";
-import { DeleteActionModal } from "@app/components/v2";
import {
Badge,
Button,
@@ -39,7 +38,7 @@ import {
TableHeader,
TableRow
} from "@app/components/v3";
-import { PageHeader } from "@app/components/v3/platform";
+import { DeleteConfirmDialog, PageHeader } from "@app/components/v3/platform";
import { useOrganization, useProject } from "@app/context";
import {
getUserTablePreference,
@@ -385,16 +384,16 @@ export const PamSessionsPage = () => {
onTerminate={requestTerminate}
/>
- <DeleteActionModal
+ <DeleteConfirmDialog
isOpen={!!sessionToTerminate}
- onChange={(open) => {
+ onOpenChange={(open) => {
if (!open) setSessionToTerminate(null);
}}
title="Terminate Session"
- subTitle="Are you sure you want to terminate this session? The user's connection will be immediately dropped."
- deleteKey="terminate"
- buttonText="Terminate"
- onDeleteApproved={confirmTerminate}
+ description="Are you sure you want to terminate this session? The user's connection will be immediately dropped."
+ confirmKey="terminate"
+ confirmLabel="Terminate"
+ onConfirm={confirmTerminate}
/>
</div>
);
diff --git a/frontend/src/pages/secret-manager/IntegrationsDetailsByIDPage/IntegrationsDetailsByIDPage.tsx b/frontend/src/pages/secret-manager/IntegrationsDetailsByIDPage/IntegrationsDetailsByIDPage.tsx
index 9a32ade1e0..0be34700b5 100644
--- a/frontend/src/pages/secret-manager/IntegrationsDetailsByIDPage/IntegrationsDetailsByIDPage.tsx
+++ b/frontend/src/pages/secret-manager/IntegrationsDetailsByIDPage/IntegrationsDetailsByIDPage.tsx
@@ -1,24 +1,24 @@
import { Helmet } from "react-helmet";
import { useTranslation } from "react-i18next";
-import { faRefresh, faTrash } from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { useNavigate, useParams } from "@tanstack/react-router";
-import { twMerge } from "tailwind-merge";
+import { MoreVerticalIcon, RefreshCwIcon, TrashIcon } from "lucide-react";
import { createNotification } from "@app/components/notifications";
import { OrgPermissionCan } from "@app/components/permissions";
import {
Button,
Checkbox,
- DeleteActionModal,
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
- EmptyState,
- Tooltip
-} from "@app/components/v2";
-import { PageHeader } from "@app/components/v3/platform";
+ Empty,
+ EmptyHeader,
+ EmptyTitle,
+ Field,
+ FieldLabel
+} from "@app/components/v3";
+import { DeleteConfirmDialog, PageHeader } from "@app/components/v3/platform";
import { ROUTE_PATHS } from "@app/const/routes";
import { OrgPermissionActions, OrgPermissionSubjects, useProject } from "@app/context";
import { usePopUp, useToggle } from "@app/hooks";
@@ -90,14 +90,13 @@ export const IntegrationDetailsByIDPage = () => {
title={`${integrationSlugNameMapping[integration.integration]} Integration`}
>
<DropdownMenu>
- <DropdownMenuTrigger asChild className="rounded-lg">
- <div className="hover:text-project data-[state=open]:text-project">
- <Tooltip content="More options">
- <Button variant="outline_bg">More</Button>
- </Tooltip>
- </div>
+ <DropdownMenuTrigger asChild>
+ <Button variant="outline">
+ <MoreVerticalIcon />
+ More
+ </Button>
</DropdownMenuTrigger>
- <DropdownMenuContent align="end" className="p-1">
+ <DropdownMenuContent align="end">
<DropdownMenuItem
onClick={async () => {
await syncIntegration({
@@ -107,10 +106,8 @@ export const IntegrationDetailsByIDPage = () => {
});
}}
>
- <div className="flex items-center gap-2">
- <FontAwesomeIcon icon={faRefresh} />
- Manually Sync
- </div>
+ <RefreshCwIcon />
+ Manually Sync
</DropdownMenuItem>
<OrgPermissionCan
I={OrgPermissionActions.Delete}
@@ -118,21 +115,15 @@ export const IntegrationDetailsByIDPage = () => {
>
{(isAllowed) => (
<DropdownMenuItem
- className={twMerge(
- isAllowed
- ? "hover:bg-danger! hover:text-white!"
- : "pointer-events-none cursor-not-allowed opacity-50"
- )}
+ variant="danger"
onClick={() => {
setShouldDeleteSecrets.off();
handlePopUpOpen("deleteConfirmation", integration);
}}
- disabled={!isAllowed}
+ isDisabled={!isAllowed}
>
- <div className="flex items-center gap-2">
- <FontAwesomeIcon icon={faTrash} />
- Delete Integration
- </div>
+ <TrashIcon />
+ Delete Integration
</DropdownMenuItem>
)}
</OrgPermissionCan>
@@ -151,19 +142,22 @@ export const IntegrationDetailsByIDPage = () => {
</div>
</div>
) : (
- <div>
- <EmptyState title="Error: Unable to fetch integration." className="py-12" />
- </div>
+ <Empty>
+ <EmptyHeader>
+ <EmptyTitle>Error: Unable to fetch integration.</EmptyTitle>
+ </EmptyHeader>
+ </Empty>
)}
</div>
- <DeleteActionModal
+ <DeleteConfirmDialog
isOpen={popUp.deleteConfirmation.isOpen}
title={`Are you sure you want to remove ${integration?.integration || " "} integration for ${
integration?.app || "this project"
}?`}
- onChange={(isOpen) => handlePopUpToggle("deleteConfirmation", isOpen)}
- deleteKey={
+ description="This action is irreversible."
+ onOpenChange={(isOpen) => handlePopUpToggle("deleteConfirmation", isOpen)}
+ confirmKey={
(integration?.integration === "azure-app-configuration" &&
integration?.app?.split("//")[1]?.split(".")[0]) ||
integration?.app ||
@@ -172,7 +166,7 @@ export const IntegrationDetailsByIDPage = () => {
integration?.integration ||
""
}
- onDeleteApproved={async () => {
+ onConfirm={async () => {
if (shouldDeleteSecrets) {
handlePopUpOpen("deleteSecretsConfirmation");
return;
@@ -184,23 +178,26 @@ export const IntegrationDetailsByIDPage = () => {
}}
>
{integration?.integration === "github" && (
- <div className="mt-4">
+ <Field orientation="horizontal">
<Checkbox
id="delete-integration-secrets"
+ variant="danger"
+ isChecked={shouldDeleteSecrets}
onCheckedChange={() => setShouldDeleteSecrets.toggle()}
- >
+ />
+ <FieldLabel htmlFor="delete-integration-secrets">
Delete previously synced secrets from the destination
- </Checkbox>
- </div>
+ </FieldLabel>
+ </Field>
)}
- </DeleteActionModal>
- <DeleteActionModal
+ </DeleteConfirmDialog>
+ <DeleteConfirmDialog
isOpen={popUp.deleteSecretsConfirmation.isOpen}
title={`Are you sure you also want to delete secrets on ${integration?.integration}?`}
- subTitle="By confirming, you acknowledge that all secrets managed by this integration will be removed from the destination. This action is irreversible."
- onChange={(isOpen) => handlePopUpToggle("deleteSecretsConfirmation", isOpen)}
- deleteKey="confirm"
- onDeleteApproved={async () => {
+ description="By confirming, you acknowledge that all secrets managed by this integration will be removed from the destination. This action is irreversible."
+ onOpenChange={(isOpen) => handlePopUpToggle("deleteSecretsConfirmation", isOpen)}
+ confirmKey="confirm"
+ onConfirm={async () => {
await handleIntegrationDelete(true);
handlePopUpClose("deleteSecretsConfirmation");
handlePopUpClose("deleteConfirmation");
diff --git a/frontend/src/pages/secret-manager/IntegrationsListPage/components/NativeIntegrationsTab/NativeIntegrationsTab.tsx b/frontend/src/pages/secret-manager/IntegrationsListPage/components/NativeIntegrationsTab/NativeIntegrationsTab.tsx
index 376c8a571e..fd6a13d039 100644
--- a/frontend/src/pages/secret-manager/IntegrationsListPage/components/NativeIntegrationsTab/NativeIntegrationsTab.tsx
+++ b/frontend/src/pages/secret-manager/IntegrationsListPage/components/NativeIntegrationsTab/NativeIntegrationsTab.tsx
@@ -1,9 +1,8 @@
-import { faPlus } from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
+import { PlusIcon } from "lucide-react";
import { createNotification } from "@app/components/notifications";
-import { Button, Checkbox, DeleteActionModal } from "@app/components/v2";
-import { Spinner } from "@app/components/v3";
+import { Button, Checkbox, Field, FieldLabel, Spinner } from "@app/components/v3";
+import { DeleteConfirmDialog } from "@app/components/v3/platform";
import { useProject } from "@app/context";
import { usePopUp, useToggle } from "@app/hooks";
import {
@@ -63,12 +62,8 @@ export const NativeIntegrationsTab = () => {
<div className="w-full rounded-lg border border-border-control bg-surface-base p-4">
<div className="mb-4 flex items-center justify-between">
<p className="text-xl font-medium text-foreground">Native Integrations</p>
- <Button
- colorSchema="secondary"
- type="submit"
- leftIcon={<FontAwesomeIcon icon={faPlus} />}
- onClick={() => handlePopUpOpen("creationBlocked")}
- >
+ <Button variant="outline" onClick={() => handlePopUpOpen("creationBlocked")}>
+ <PlusIcon />
Add Integration
</Button>
</div>
@@ -88,15 +83,16 @@ export const NativeIntegrationsTab = () => {
isOpen={popUp.creationBlocked.isOpen}
onOpenChange={(isOpen) => handlePopUpToggle("creationBlocked", isOpen)}
/>
- <DeleteActionModal
+ <DeleteConfirmDialog
isOpen={popUp.deleteConfirmation.isOpen}
title={`Are you sure you want to remove ${
(popUp?.deleteConfirmation.data as TIntegration)?.integration || " "
} integration for ${
(popUp?.deleteConfirmation.data as TIntegration)?.app || "this project"
}?`}
- onChange={(isOpen) => handlePopUpToggle("deleteConfirmation", isOpen)}
- deleteKey={
+ description="This action is irreversible."
+ onOpenChange={(isOpen) => handlePopUpToggle("deleteConfirmation", isOpen)}
+ confirmKey={
((popUp?.deleteConfirmation?.data as TIntegration)?.integration ===
"azure-app-configuration" &&
(popUp?.deleteConfirmation?.data as TIntegration)?.app
@@ -108,7 +104,7 @@ export const NativeIntegrationsTab = () => {
(popUp?.deleteConfirmation?.data as TIntegration)?.integration ||
""
}
- onDeleteApproved={async () => {
+ onConfirm={async () => {
if (shouldDeleteSecrets) {
handlePopUpOpen("deleteSecretsConfirmation");
return;
@@ -122,25 +118,28 @@ export const NativeIntegrationsTab = () => {
}}
>
{(popUp?.deleteConfirmation?.data as TIntegration)?.integration === "github" && (
- <div className="mt-4">
+ <Field orientation="horizontal">
<Checkbox
id="delete-integration-secrets"
+ variant="danger"
+ isChecked={shouldDeleteSecrets}
onCheckedChange={() => setShouldDeleteSecrets.toggle()}
- >
+ />
+ <FieldLabel htmlFor="delete-integration-secrets">
Delete previously synced secrets from the destination
- </Checkbox>
- </div>
+ </FieldLabel>
+ </Field>
)}
- </DeleteActionModal>
- <DeleteActionModal
+ </DeleteConfirmDialog>
+ <DeleteConfirmDialog
isOpen={popUp.deleteSecretsConfirmation.isOpen}
title={`Are you sure you also want to delete secrets on ${
(popUp?.deleteConfirmation.data as TIntegration)?.integration
}?`}
- subTitle="By confirming, you acknowledge that all secrets managed by this integration will be removed from the destination. This action is irreversible."
- onChange={(isOpen) => handlePopUpToggle("deleteSecretsConfirmation", isOpen)}
- deleteKey="confirm"
- onDeleteApproved={async () => {
+ description="By confirming, you acknowledge that all secrets managed by this integration will be removed from the destination. This action is irreversible."
+ onOpenChange={(isOpen) => handlePopUpToggle("deleteSecretsConfirmation", isOpen)}
+ confirmKey="confirm"
+ onConfirm={async () => {
await handleIntegrationDelete(
(popUp?.deleteConfirmation.data as TIntegration).id,
true,