Skip to content

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

improvement(ui): migrate remaining v2 confirm modals to DeleteConfirmDialog (#8716)

Andrew Huang94628724ea30
diff --git a/frontend/src/components/COMPONENT_LIFECYCLE.md b/frontend/src/components/COMPONENT_LIFECYCLE.md
index dd568a9cbf..4d5225bb15 100644
--- a/frontend/src/components/COMPONENT_LIFECYCLE.md
+++ b/frontend/src/components/COMPONENT_LIFECYCLE.md
@@ -11,7 +11,8 @@ The [V3 migration ledger](V3_MIGRATION.md) tracks source removal, coverage, and
| `FilterableSelect` | Deprecated | Use V3 `Combobox` where its contract fits. |
| `Button`, `Card`, `Checkbox`, `EmptyState`, `IconButton`, `Input`, `Pagination`, `Select`, `Switch`, `TextArea`, `Tooltip` | Ready for focused deprecation | Supported V3 replacements exist. Check representative consumers before adding component-specific guidance. |
| `Accordion`, `Alert`, `CopyButton`, `Dropdown`, `HoverCardv2`, `Skeleton`, `Spinner`, `Table`, `Tabs` | Blocked | Composition, interaction, or state parity still needs verification. |
-| `ConfirmActionModal`, `DeleteActionModal`, `Modal` | Ready for focused deprecation | Follow the overlay recipe in the [V3 migration ledger](V3_MIGRATION.md#overlay-migration-recipe). |
+| `ConfirmActionModal`, `DeleteActionModal` | Deprecated | Use V3 `DeleteConfirmDialog` and follow the overlay recipe in the [V3 migration ledger](V3_MIGRATION.md#overlay-migration-recipe). `ConfirmActionModal` has no remaining consumers. The last `DeleteActionModal` consumer is under Secret Scanning, so removal waits for that area. |
+| `Modal` | Ready for focused deprecation | Follow the overlay recipe in the [V3 migration ledger](V3_MIGRATION.md#overlay-migration-recipe). |
| `ContentLoader`, `FormControl`, `GenericFieldLabel`, `Tag` | Blocked | The V3 replacements require consumer-specific composition or accessibility changes. |
| `SecretInput` | Blocked | Security-sensitive or specialist behavior needs workflow-level parity validation. |
| `SecretPathInput` | Removed in candidate | Deleted the unused V2 implementation and family index. No incoming module or declaration references remained at `13f5e7fe562a803a9b6de1d512cb27f67868ea6d`. The independent V3 implementation and its consumers are unchanged; this does not certify workflow parity or removal on merged main. |
diff --git a/frontend/src/components/v2/ConfirmActionModal/ConfirmActionModal.tsx b/frontend/src/components/v2/ConfirmActionModal/ConfirmActionModal.tsx
index 4ec04cb2b0..078c7ccbca 100644
--- a/frontend/src/components/v2/ConfirmActionModal/ConfirmActionModal.tsx
+++ b/frontend/src/components/v2/ConfirmActionModal/ConfirmActionModal.tsx
@@ -21,6 +21,10 @@ type Props = {
confirmationMessage?: ReactNode;
};
+/**
+ * @deprecated Use the v3 `DeleteConfirmDialog` from `@app/components/v3` with a non-danger
+ * `confirmVariant`. See the overlay recipe in `components/V3_MIGRATION.md` for the prop mapping.
+ */
export const ConfirmActionModal = ({
isOpen,
onClose,
diff --git a/frontend/src/components/v2/DeleteActionModal/DeleteActionModal.tsx b/frontend/src/components/v2/DeleteActionModal/DeleteActionModal.tsx
index 7ba593f581..edc133d0a4 100644
--- a/frontend/src/components/v2/DeleteActionModal/DeleteActionModal.tsx
+++ b/frontend/src/components/v2/DeleteActionModal/DeleteActionModal.tsx
@@ -23,6 +23,10 @@ type Props = {
isDisabled?: boolean;
};
+/**
+ * @deprecated Use the v3 `DeleteConfirmDialog` from `@app/components/v3`. See the overlay recipe in
+ * `components/V3_MIGRATION.md` for the prop mapping.
+ */
export const DeleteActionModal = ({
isOpen,
onClose,
diff --git a/frontend/src/components/v3/platform/DeleteConfirmDialog/DeleteConfirmDialog.tsx b/frontend/src/components/v3/platform/DeleteConfirmDialog/DeleteConfirmDialog.tsx
index 535fb73415..a9e390241a 100644
--- a/frontend/src/components/v3/platform/DeleteConfirmDialog/DeleteConfirmDialog.tsx
+++ b/frontend/src/components/v3/platform/DeleteConfirmDialog/DeleteConfirmDialog.tsx
@@ -1,4 +1,4 @@
-import { FormEvent, ReactNode, useEffect, useId, useState } from "react";
+import { FormEvent, ReactNode, useEffect, useId, useRef, useState } from "react";
import {
AlertDialog,
@@ -31,15 +31,20 @@ type Props = {
export const DeleteConfirmDialog = ({
isOpen,
onOpenChange,
- title,
- description,
- confirmKey,
- confirmLabel = "Delete",
- confirmVariant = "danger",
isPending,
onConfirm,
- children
+ ...contentProps
}: Props) => {
+ const lastOpenContent = useRef(contentProps);
+ if (isOpen) lastOpenContent.current = contentProps;
+ const {
+ title,
+ description,
+ confirmKey,
+ confirmLabel = "Delete",
+ confirmVariant = "danger",
+ children
+ } = isOpen ? contentProps : lastOpenContent.current;
const [typedValue, setTypedValue] = useState("");
const [isConfirming, setIsConfirming] = useState(false);
const confirmationInputId = useId();
diff --git a/frontend/src/pages/cert-manager/AlertingPage/components/PkiAlertsSection.tsx b/frontend/src/pages/cert-manager/AlertingPage/components/PkiAlertsSection.tsx
index b33595305a..5dbb3c4392 100644
--- a/frontend/src/pages/cert-manager/AlertingPage/components/PkiAlertsSection.tsx
+++ b/frontend/src/pages/cert-manager/AlertingPage/components/PkiAlertsSection.tsx
@@ -1,5 +1,5 @@
import { createNotification } from "@app/components/notifications";
-import { DeleteActionModal } from "@app/components/v2";
+import { DeleteConfirmDialog } from "@app/components/v3";
import { useProject } from "@app/context";
import { useDeletePkiAlert } from "@app/hooks/api";
import { usePopUp } from "@app/hooks/usePopUp";
@@ -45,14 +45,15 @@ export const PkiAlertsSection = () => {
</div>
<PkiAlertsTable handlePopUpOpen={handlePopUpOpen} />
<PkiAlertModal popUp={popUp} handlePopUpToggle={handlePopUpToggle} />
- <DeleteActionModal
+ <DeleteConfirmDialog
isOpen={popUp.deletePkiAlert.isOpen}
+ description="This action is irreversible."
title={`Are you sure you want to remove the alert ${
(popUp?.deletePkiAlert?.data as { name: string })?.name || ""
}?`}
- onChange={(isOpen) => handlePopUpToggle("deletePkiAlert", isOpen)}
- deleteKey="confirm"
- onDeleteApproved={() =>
+ onOpenChange={(isOpen) => handlePopUpToggle("deletePkiAlert", isOpen)}
+ confirmKey="confirm"
+ onConfirm={() =>
onRemoveAlertSubmit((popUp?.deletePkiAlert?.data as { alertId: string })?.alertId)
}
/>
diff --git a/frontend/src/pages/cert-manager/AlertingPage/components/PkiCollectionSection.tsx b/frontend/src/pages/cert-manager/AlertingPage/components/PkiCollectionSection.tsx
index edde2b229a..1472ca812e 100644
--- a/frontend/src/pages/cert-manager/AlertingPage/components/PkiCollectionSection.tsx
+++ b/frontend/src/pages/cert-manager/AlertingPage/components/PkiCollectionSection.tsx
@@ -3,7 +3,8 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { createNotification } from "@app/components/notifications";
import { ProjectPermissionCan } from "@app/components/permissions";
-import { Button, DeleteActionModal } from "@app/components/v2";
+import { Button } from "@app/components/v2";
+import { DeleteConfirmDialog } from "@app/components/v3";
import { ProjectPermissionActions, ProjectPermissionSub, useProject } from "@app/context";
import { useDeletePkiCollection } from "@app/hooks/api";
import { usePopUp } from "@app/hooks/usePopUp";
@@ -59,14 +60,15 @@ export const PkiCollectionSection = () => {
</div>
<PkiCollectionTable handlePopUpOpen={handlePopUpOpen} />
<PkiCollectionModal popUp={popUp} handlePopUpToggle={handlePopUpToggle} />
- <DeleteActionModal
+ <DeleteConfirmDialog
isOpen={popUp.deletePkiCollection.isOpen}
+ description="This action is irreversible."
title={`Are you sure you want to remove the alert ${
(popUp?.deletePkiCollection?.data as { name: string })?.name || ""
}?`}
- onChange={(isOpen) => handlePopUpToggle("deletePkiCollection", isOpen)}
- deleteKey="confirm"
- onDeleteApproved={() =>
+ onOpenChange={(isOpen) => handlePopUpToggle("deletePkiCollection", isOpen)}
+ confirmKey="confirm"
+ onConfirm={() =>
onRemovePkiCollectionSubmit(
(popUp?.deletePkiCollection?.data as { collectionId: string })?.collectionId
)
diff --git a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationMembersTab.tsx b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationMembersTab.tsx
index 36d46cfa80..f2c47b50db 100644
--- a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationMembersTab.tsx
+++ b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationMembersTab.tsx
@@ -2,7 +2,6 @@ import { useState } from "react";
import { MoreHorizontalIcon, Trash2Icon, UserPlusIcon } from "lucide-react";
import { createNotification } from "@app/components/notifications";
-import { DeleteActionModal } from "@app/components/v2";
import {
Badge,
Button,
@@ -12,6 +11,7 @@ import {
CardDescription,
CardHeader,
CardTitle,
+ DeleteConfirmDialog,
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
@@ -225,13 +225,13 @@ export const ApplicationMembersTab = ({ members, applicationId }: Props) => {
existingMembers={members}
/>
- <DeleteActionModal
+ <DeleteConfirmDialog
isOpen={popUp.removeMember.isOpen}
title="Remove member?"
- subTitle="The member loses access to this application immediately. Their access to other applications is unchanged."
- onChange={(o) => handlePopUpToggle("removeMember", o)}
- deleteKey="confirm"
- onDeleteApproved={async () => {
+ description="The member loses access to this application immediately. Their access to other applications is unchanged."
+ onOpenChange={(o) => handlePopUpToggle("removeMember", o)}
+ confirmKey="confirm"
+ onConfirm={async () => {
const m = popUp.removeMember.data as TPkiApplicationMember | undefined;
if (!m) return;
try {
diff --git a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationSettingsTab.tsx b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationSettingsTab.tsx
index 606e8009c3..5abd01ff61 100644
--- a/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationSettingsTab.tsx
+++ b/frontend/src/pages/cert-manager/ApplicationDetailsByIDPage/components/ApplicationSettingsTab.tsx
@@ -12,7 +12,6 @@ import {
useUpgradeGate
} from "@app/components/license/UpgradeGate";
import { createNotification } from "@app/components/notifications";
-import { DeleteActionModal } from "@app/components/v2";
import {
Badge,
Button,
@@ -22,6 +21,7 @@ import {
CardDescription,
CardHeader,
CardTitle,
+ DeleteConfirmDialog,
Dialog,
DialogContent,
DialogDescription,
@@ -637,12 +637,13 @@ export const ApplicationSettingsTab = ({ application, profiles }: Props) => {
applicationId={application.id}
/>
{upgradeGate}
- <DeleteActionModal
+ <DeleteConfirmDialog
isOpen={popUp.deletePolicy.isOpen}
- deleteKey="delete"
+ description="This action is irreversible."
+ confirmKey="delete"
title={`Delete approval policy ${(popUp.deletePolicy.data as TApprovalPolicy | undefined)?.name ?? ""}?`}
- onChange={(isOpen) => handlePopUpToggle("deletePolicy", isOpen)}
- onDeleteApproved={handleDeletePolicy}
+ onOpenChange={(isOpen) => handlePopUpToggle("deletePolicy", isOpen)}
+ onConfirm={handleDeletePolicy}
/>
<Dialog
@@ -685,15 +686,15 @@ export const ApplicationSettingsTab = ({ application, profiles }: Props) => {
</DialogContent>
</Dialog>
- <DeleteActionModal
+ <DeleteConfirmDialog
isOpen={Boolean(profileToDetach)}
title={`Detach profile ${profileToDetach?.profileSlug ?? ""}?`}
- subTitle="This application will no longer be able to issue from this Profile. Existing certificates remain."
- deleteKey="confirm"
- onChange={(open) => {
+ description="This application will no longer be able to issue from this Profile. Existing certificates remain."
+ confirmKey="confirm"
+ onOpenChange={(open) => {
if (!open) setProfileToDetach(null);
}}
- onDeleteApproved={handleDetach}
+ onConfirm={handleDetach}
/>
<CreateProfileModal
diff --git a/frontend/src/pages/cert-manager/ApprovalRequestDetailPage/ApprovalRequestDetailPage.tsx b/frontend/src/pages/cert-manager/ApprovalRequestDetailPage/ApprovalRequestDetailPage.tsx
index ddb6b4c3ad..3d6c73ce1f 100644
--- a/frontend/src/pages/cert-manager/ApprovalRequestDetailPage/ApprovalRequestDetailPage.tsx
+++ b/frontend/src/pages/cert-manager/ApprovalRequestDetailPage/ApprovalRequestDetailPage.tsx
@@ -7,8 +7,8 @@ import { format } from "date-fns";
import { twMerge } from "tailwind-merge";
import { createNotification } from "@app/components/notifications";
-import { ConfirmActionModal, ContentLoader, EmptyState } from "@app/components/v2";
-import { Badge, Button } from "@app/components/v3";
+import { ContentLoader, EmptyState } from "@app/components/v2";
+import { Badge, Button, DeleteConfirmDialog } from "@app/components/v3";
import { useOrganization, useProject, useUser } from "@app/context";
import { usePopUp } from "@app/hooks";
import { ApprovalPolicyScope, ApprovalPolicyType } from "@app/hooks/api/approvalPolicies";
@@ -411,13 +411,15 @@ const PageContent = () => {
</div>
</div>
</div>
- <ConfirmActionModal
+ <DeleteConfirmDialog
isOpen={popUp.cancelRequest.isOpen}
+ confirmVariant="project"
+ description="This action is irreversible."
confirmKey="cancel"
title="Do you want to cancel this approval request?"
- onChange={(isOpen) => handlePopUpToggle("cancelRequest", isOpen)}
- onConfirmed={handleRequestCancel}
- buttonText="Confirm"
+ onOpenChange={(isOpen) => handlePopUpToggle("cancelRequest", isOpen)}
+ onConfirm={handleRequestCancel}
+ confirmLabel="Confirm"
/>
</div>
);
diff --git a/frontend/src/pages/cert-manager/ApprovalsPage/components/PolicyTab/PolicyTab.tsx b/frontend/src/pages/cert-manager/ApprovalsPage/components/PolicyTab/PolicyTab.tsx
index ae55aa478c..b0ef8fdaec 100644
--- a/frontend/src/pages/cert-manager/ApprovalsPage/components/PolicyTab/PolicyTab.tsx
+++ b/frontend/src/pages/cert-manager/ApprovalsPage/components/PolicyTab/PolicyTab.tsx
@@ -1,6 +1,5 @@
import { createNotification } from "@app/components/notifications";
-import { DeleteActionModal } from "@app/components/v2";
-import { AccessRestrictedDialog } from "@app/components/v3";
+import { AccessRestrictedDialog, DeleteConfirmDialog } from "@app/components/v3";
import { useProject, useProjectPermission } from "@app/context";
import { usePopUp } from "@app/hooks";
import { ApprovalPolicyType, useDeleteApprovalPolicy } from "@app/hooks/api/approvalPolicies";
@@ -62,12 +61,13 @@ export const PolicyTab = () => {
<PoliciesTable handlePopUpOpen={handlePopUpOpen} />
<PolicyModal popUp={popUp} handlePopUpToggle={handlePopUpToggle} />
- <DeleteActionModal
+ <DeleteConfirmDialog
isOpen={popUp.deletePolicy.isOpen}
- deleteKey="delete"
+ description="This action is irreversible."
+ confirmKey="delete"
title="Are you sure you want to delete this policy?"
- onChange={(isOpen) => handlePopUpToggle("deletePolicy", isOpen)}
- onDeleteApproved={handleDeletePolicy}
+ onOpenChange={(isOpen) => handlePopUpToggle("deletePolicy", isOpen)}
+ onConfirm={handleDeletePolicy}
/>
</div>
);
diff --git a/frontend/src/pages/cert-manager/DiscoveryDetailsByIDPage/DiscoveryDetailsByIDPage.tsx b/frontend/src/pages/cert-manager/DiscoveryDetailsByIDPage/DiscoveryDetailsByIDPage.tsx
index 32b0f99b96..89ef28c1d1 100644
--- a/frontend/src/pages/cert-manager/DiscoveryDetailsByIDPage/DiscoveryDetailsByIDPage.tsx
+++ b/frontend/src/pages/cert-manager/DiscoveryDetailsByIDPage/DiscoveryDetailsByIDPage.tsx
@@ -5,10 +5,10 @@ import { Link, useNavigate, useParams } from "@tanstack/react-router";
import { ChevronLeftIcon, EllipsisIcon } from "lucide-react";
import { ProjectPermissionCan } from "@app/components/permissions";
-import { DeleteActionModal } from "@app/components/v2";
import {
Badge,
Button,
+ DeleteConfirmDialog,
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
@@ -198,13 +198,13 @@ const Page = () => {
discovery={popUp.editJob.data as TPkiDiscovery | undefined}
/>
- <DeleteActionModal
+ <DeleteConfirmDialog
isOpen={popUp.deleteJob.isOpen}
title="Are you sure you want to delete this discovery job?"
- subTitle="This action cannot be undone. The discovery configuration will be permanently deleted."
- onChange={(isOpen) => handlePopUpToggle("deleteJob", isOpen)}
- deleteKey="confirm"
- onDeleteApproved={handleDelete}
+ description="This action cannot be undone. The discovery configuration will be permanently deleted."
+ onOpenChange={(isOpen) => handlePopUpToggle("deleteJob", isOpen)}
+ confirmKey="confirm"
+ onConfirm={handleDelete}
/>
</div>
);
diff --git a/frontend/src/pages/cert-manager/InstallationDetailsByIDPage/InstallationDetailsByIDPage.tsx b/frontend/src/pages/cert-manager/InstallationDetailsByIDPage/InstallationDetailsByIDPage.tsx
index 7e150f3510..d55260d489 100644
--- a/frontend/src/pages/cert-manager/InstallationDetailsByIDPage/InstallationDetailsByIDPage.tsx
+++ b/frontend/src/pages/cert-manager/InstallationDetailsByIDPage/InstallationDetailsByIDPage.tsx
@@ -3,9 +3,9 @@ import { Link, useNavigate, useParams } from "@tanstack/react-router";
import { ChevronLeftIcon, EllipsisIcon } from "lucide-react";
import { ProjectPermissionCan } from "@app/components/permissions";
-import { DeleteActionModal } from "@app/components/v2";
import {
Button,
+ DeleteConfirmDialog,
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
@@ -127,13 +127,13 @@ const Page = () => {
</div>
</div>
- <DeleteActionModal
+ <DeleteConfirmDialog
isOpen={popUp.deleteInstallation.isOpen}
title="Are you sure you want to delete this installation?"
- subTitle="This action cannot be undone. The installation record will be permanently deleted."
- onChange={(isOpen) => handlePopUpToggle("deleteInstallation", isOpen)}
- deleteKey="confirm"
- onDeleteApproved={handleDelete}
+ description="This action cannot be undone. The installation record will be permanently deleted."
+ onOpenChange={(isOpen) => handlePopUpToggle("deleteInstallation", isOpen)}
+ confirmKey="confirm"
+ onConfirm={handleDelete}
/>
</div>
);
diff --git a/frontend/src/pages/cert-manager/PkiCollectionDetailsByIDPage/PkiCollectionDetailsByIDPage.tsx b/frontend/src/pages/cert-manager/PkiCollectionDetailsByIDPage/PkiCollectionDetailsByIDPage.tsx
index d82ed78a01..f1b0f37792 100644
--- a/frontend/src/pages/cert-manager/PkiCollectionDetailsByIDPage/PkiCollectionDetailsByIDPage.tsx
+++ b/frontend/src/pages/cert-manager/PkiCollectionDetailsByIDPage/PkiCollectionDetailsByIDPage.tsx
@@ -9,14 +9,13 @@ import { createNotification } from "@app/components/notifications";
import { ProjectPermissionCan } from "@app/components/permissions";
import {
Button,
- DeleteActionModal,
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
Tooltip
} from "@app/components/v2";
-import { PageHeader } from "@app/components/v3";
+import { DeleteConfirmDialog, PageHeader } from "@app/components/v3";
import { ROUTE_PATHS } from "@app/const/routes";
import {
ProjectPermissionActions,
@@ -165,12 +164,13 @@ export const PkiCollectionPage = () => {
</div>
)}
<PkiCollectionModal popUp={popUp} handlePopUpToggle={handlePopUpToggle} />
- <DeleteActionModal
+ <DeleteConfirmDialog
isOpen={popUp.deletePkiCollection.isOpen}
+ description="This action is irreversible."
title={`Are you sure you want to delete the PKI collection ${data?.name ?? ""}?`}
- onChange={(isOpen) => handlePopUpToggle("deletePkiCollection", isOpen)}
- deleteKey="confirm"
- onDeleteApproved={() =>
+ onOpenChange={(isOpen) => handlePopUpToggle("deletePkiCollection", isOpen)}
+ confirmKey="confirm"
+ onConfirm={() =>
onDeletePkiCollectionSubmit(
(popUp.deletePkiCollection.data as { collectionId: string })?.collectionId
)
diff --git a/frontend/src/pages/cert-manager/PkiSubscriberDetailsByIDPage/PkiSubscriberDetailsByIDPage.tsx b/frontend/src/pages/cert-manager/PkiSubscriberDetailsByIDPage/PkiSubscriberDetailsByIDPage.tsx
index bf4821cd58..71ff57bf20 100644
--- a/frontend/src/pages/cert-manager/PkiSubscriberDetailsByIDPage/PkiSubscriberDetailsByIDPage.tsx
+++ b/frontend/src/pages/cert-manager/PkiSubscriberDetailsByIDPage/PkiSubscriberDetailsByIDPage.tsx
@@ -9,14 +9,13 @@ import { createNotification } from "@app/components/notifications";
import { ProjectPermissionCan } from "@app/components/permissions";
import {
Button,
- DeleteActionModal,
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
Tooltip
} from "@app/components/v2";
-import { PageHeader } from "@app/components/v3";
+import { DeleteConfirmDialog, PageHeader } from "@app/components/v3";
import { LegacyPkiResource } from "@app/const/legacyPkiDeprecation";
import { ROUTE_PATHS } from "@app/const/routes";
import {
@@ -144,14 +143,15 @@ const Page = () => {
</div>
)}
<PkiSubscriberModal popUp={popUp} handlePopUpToggle={handlePopUpToggle} />
- <DeleteActionModal
+ <DeleteConfirmDialog
isOpen={popUp.deletePkiSubscriber.isOpen}
+ description="This action is irreversible."
title={`Are you sure you want to remove the PKI subscriber: ${
(popUp?.deletePkiSubscriber?.data as { name: string })?.name || ""
}?`}
- onChange={(isOpen) => handlePopUpToggle("deletePkiSubscriber", isOpen)}
- deleteKey="confirm"
- onDeleteApproved={() =>
+ onOpenChange={(isOpen) => handlePopUpToggle("deletePkiSubscriber", isOpen)}
+ confirmKey="confirm"
+ onConfirm={() =>
onRemoveSubscriberSubmit(
(popUp?.deletePkiSubscriber?.data as { subscriberName: string })?.subscriberName
)
diff --git a/frontend/src/pages/cert-manager/PkiSubscribersPage/components/PkiSubscriberSection.tsx b/frontend/src/pages/cert-manager/PkiSubscribersPage/components/PkiSubscriberSection.tsx
index 44f62b1ff1..fe4d08a39c 100644
--- a/frontend/src/pages/cert-manager/PkiSubscribersPage/components/PkiSubscriberSection.tsx
+++ b/frontend/src/pages/cert-manager/PkiSubscribersPage/components/PkiSubscriberSection.tsx
@@ -3,7 +3,8 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { createNotification } from "@app/components/notifications";
import { ProjectPermissionCan } from "@app/components/permissions";
-import { Button, DeleteActionModal } from "@app/components/v2";
+import { Button } from "@app/components/v2";
+import { DeleteConfirmDialog } from "@app/components/v3";
import { LegacyPkiResource } from "@app/const/legacyPkiDeprecation";
import {
ProjectPermissionPkiSubscriberActions,
@@ -100,26 +101,27 @@ export const PkiSubscriberSection = () => {
isOpen={popUp.creationBlocked.isOpen}
onOpenChange={(isOpen) => handlePopUpToggle("creationBlocked", isOpen)}
/>
- <DeleteActionModal
+ <DeleteConfirmDialog
isOpen={popUp.pkiSubscriberStatus.isOpen}
title={`Are you sure you want to ${isEnabling ? "enable" : "disable"} the subscriber ${subscriberName}?`}
- subTitle={
+ description={
isEnabling
? "This action will allow issuing certificates for this subscriber again."
: "This action will prevent issuing certificates for this subscriber."
}
- onChange={(isOpen) => handlePopUpToggle("pkiSubscriberStatus", isOpen)}
- deleteKey="confirm"
- buttonColorSchema={isEnabling ? "primary" : "danger"}
- buttonText={isEnabling ? "Enable" : "Disable"}
- onDeleteApproved={() => onUpdatePkiSubscriberStatus(subscriberStatusData)}
+ onOpenChange={(isOpen) => handlePopUpToggle("pkiSubscriberStatus", isOpen)}
+ confirmKey="confirm"
+ confirmVariant={isEnabling ? "project" : "danger"}
+ confirmLabel={isEnabling ? "Enable" : "Disable"}
+ onConfirm={() => onUpdatePkiSubscriberStatus(subscriberStatusData)}
/>
- <DeleteActionModal
+ <DeleteConfirmDialog
isOpen={popUp.deletePkiSubscriber.isOpen}
+ description="This action is irreversible."
title="Are you sure you want to remove the PKI subscriber?"
- onChange={(isOpen) => handlePopUpToggle("deletePkiSubscriber", isOpen)}
- deleteKey="confirm"
- onDeleteApproved={() =>
+ onOpenChange={(isOpen) => handlePopUpToggle("deletePkiSubscriber", isOpen)}
+ confirmKey="confirm"
+ onConfirm={() =>
onRemovePkiSubscriberSubmit(
(popUp?.deletePkiSubscriber?.data as { subscriberName: string })?.subscriberName
)
diff --git a/frontend/src/pages/cert-manager/PkiTemplateListPage/PkiTemplateListPage.tsx b/frontend/src/pages/cert-manager/PkiTemplateListPage/PkiTemplateListPage.tsx
index 44db60ca5e..c0722ef23e 100644
--- a/frontend/src/pages/cert-manager/PkiTemplateListPage/PkiTemplateListPage.tsx
+++ b/frontend/src/pages/cert-manager/PkiTemplateListPage/PkiTemplateListPage.tsx
@@ -22,7 +22,6 @@ import { createNotification } from "@app/components/notifications";
import { ProjectPermissionCan } from "@app/components/permissions";
import {
Button,
- DeleteActionModal,
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
@@ -42,7 +41,7 @@ import {
Tooltip,
Tr
} from "@app/components/v2";
-import { PageHeader } from "@app/components/v3";
+import { DeleteConfirmDialog, PageHeader } from "@app/components/v3";
import { LegacyPkiResource } from "@app/const/legacyPkiDeprecation";
import {
ProjectPermissionCertificateActions,
@@ -297,12 +296,13 @@ export const PkiTemplateListPage = () => {
/>
)}
</TableContainer>
- <DeleteActionModal
+ <DeleteConfirmDialog
isOpen={popUp.deleteTemplate.isOpen}
+ description="This action is irreversible."
title="Are you sure you want to remove the PKI Template?"
- onChange={(isOpen) => handlePopUpToggle("deleteTemplate", isOpen)}
- deleteKey="confirm"
- onDeleteApproved={() => onRemovePkiSubscriberSubmit()}
+ onOpenChange={(isOpen) => handlePopUpToggle("deleteTemplate", isOpen)}
+ confirmKey="confirm"
+ onConfirm={() => onRemovePkiSubscriberSubmit()}
/>
</div>
</div>
diff --git a/frontend/src/pages/cert-manager/PoliciesPage/components/CertificatePoliciesTab/CertificatePoliciesTab.tsx b/frontend/src/pages/cert-manager/PoliciesPage/components/CertificatePoliciesTab/CertificatePoliciesTab.tsx
index 5746767d03..40f32d4de1 100644
--- a/frontend/src/pages/cert-manager/PoliciesPage/components/CertificatePoliciesTab/CertificatePoliciesTab.tsx
+++ b/frontend/src/pages/cert-manager/PoliciesPage/components/CertificatePoliciesTab/CertificatePoliciesTab.tsx
@@ -3,7 +3,6 @@ import { PlusIcon } from "lucide-react";
import { createNotification } from "@app/components/notifications";
import { ProjectPermissionCan } from "@app/components/permissions";
-import { DeleteActionModal } from "@app/components/v2";
import {
Button,
Card,
@@ -12,6 +11,7 @@ import {
CardDescription,
CardHeader,
CardTitle,
+ DeleteConfirmDialog,
DocumentationLinkBadge
} from "@app/components/v3";
import {
@@ -109,15 +109,16 @@ export const CertificatePoliciesTab = () => {
mode="edit"
/>
- <DeleteActionModal
+ <DeleteConfirmDialog
isOpen={isDeleteModalOpen}
+ description="This action is irreversible."
title={`Delete Certificate Policy ${selectedPolicy.name}?`}
- onChange={(isOpen) => {
+ onOpenChange={(isOpen) => {
setIsDeleteModalOpen(isOpen);
if (!isOpen) setSelectedPolicy(null);
}}
- deleteKey={selectedPolicy.name}
- onDeleteApproved={handleDeleteConfirm}
+ confirmKey={selectedPolicy.name}
+ onConfirm={handleDeleteConfirm}
/>
</>
)}
diff --git a/frontend/src/pages/pam/PamAccountsPage/components/FolderApprovalsTab.tsx b/frontend/src/pages/pam/PamAccountsPage/components/FolderApprovalsTab.tsx
index aaa2eebc48..941d1ff2dc 100644
--- a/frontend/src/pages/pam/PamAccountsPage/components/FolderApprovalsTab.tsx
+++ b/frontend/src/pages/pam/PamAccountsPage/components/FolderApprovalsTab.tsx
@@ -12,7 +12,6 @@ import { twMerge } from "tailwind-merge";
import { PamEnterpriseAlertingUpgradeIntent } from "@app/components/license/UpgradeGate";
import { createNotification } from "@app/components/notifications";
-import { DeleteActionModal } from "@app/components/v2";
import {
Badge,
Button,
@@ -22,6 +21,7 @@ import {
CardDescription,
CardHeader,
CardTitle,
+ DeleteConfirmDialog,
DropdownMenu,
DropdownMenuCheckboxItem,
DropdownMenuContent,
@@ -724,16 +724,16 @@ export const FolderApprovalsTab = ({ folderId, onDirtyChange }: Props) => {
</CardContent>
</Card>
- <DeleteActionModal
+ <DeleteConfirmDialog
isOpen={!!requestToRevoke}
- onChange={(open) => {
+ onOpenChange={(open) => {
if (!open) setRequestToRevoke(null);
}}
title="Revoke Access"
- subTitle="Are you sure you want to revoke this user's approved access?"
- deleteKey="revoke"
- buttonText="Revoke"
- onDeleteApproved={confirmRevoke}
+ description="Are you sure you want to revoke this user's approved access?"
+ confirmKey="revoke"
+ confirmLabel="Revoke"
+ onConfirm={confirmRevoke}
/>
<div aria-hidden className="h-8 shrink-0" />
diff --git a/frontend/src/views/PkiAlertsV2Page/PkiAlertsV2Page.tsx b/frontend/src/views/PkiAlertsV2Page/PkiAlertsV2Page.tsx
index 9d7bbe512e..3217512970 100644
--- a/frontend/src/views/PkiAlertsV2Page/PkiAlertsV2Page.tsx
+++ b/frontend/src/views/PkiAlertsV2Page/PkiAlertsV2Page.tsx
@@ -4,7 +4,6 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { createNotification } from "@app/components/notifications";
import {
- DeleteActionModal,
Input,
Pagination,
Skeleton,
@@ -16,6 +15,7 @@ import {
THead,
Tr
} from "@app/components/v2";
+import { DeleteConfirmDialog } from "@app/components/v3";
import { useDebounce } from "@app/hooks";
import { useDeletePkiAlertV2, useGetPkiAlertsV2 } from "@app/hooks/api/pkiAlertsV2";
@@ -189,12 +189,13 @@ export const PkiAlertsV2Page = ({ hideContainer = false }: Props) => {
alertId={viewModal.alertId}
/>
- <DeleteActionModal
+ <DeleteConfirmDialog
isOpen={deleteModal.isOpen}
- deleteKey="delete"
+ description="This action is irreversible."
+ confirmKey="delete"
title={`Delete PKI Alert "${deleteModal.name}"`}
- onChange={(isOpen) => setDeleteModal({ isOpen, alertId: undefined, name: undefined })}
- onDeleteApproved={handleDeleteAlert}
+ onOpenChange={(isOpen) => setDeleteModal({ isOpen, alertId: undefined, name: undefined })}
+ onConfirm={handleDeleteAlert}
/>
</div>
);