Skip to content

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

requested changes

varonix02f4d98272c4a
diff --git a/frontend/src/pages/secret-manager/SecretApprovalsPage/components/SecretApprovalRequest/components/SecretApprovalRequestAction.tsx b/frontend/src/pages/secret-manager/SecretApprovalsPage/components/SecretApprovalRequest/components/SecretApprovalRequestAction.tsx
index 79c2120720..3e201c9007 100644
--- a/frontend/src/pages/secret-manager/SecretApprovalsPage/components/SecretApprovalRequest/components/SecretApprovalRequestAction.tsx
+++ b/frontend/src/pages/secret-manager/SecretApprovalsPage/components/SecretApprovalRequest/components/SecretApprovalRequestAction.tsx
@@ -102,6 +102,8 @@ export const SecretApprovalRequestAction = ({
// and policy approvers can all merge once the required approvals are met.
const canMerge = canApprove || isCommitter || hasProjectRole(ProjectMembershipRole.Admin);
+ const isBypassMerge = isSoftEnforcement && !isMergable;
+
if (!hasMerged && status === "open") {
return (
<div className="flex w-full flex-col gap-3">
@@ -181,10 +183,10 @@ export const SecretApprovalRequestAction = ({
}
isPending={isMerging}
onClick={handleSecretApprovalRequestMerge}
- variant={isSoftEnforcement && !canMerge ? "danger" : "project"}
+ variant={isBypassMerge ? "warning" : "project"}
size="sm"
>
- {!canMerge ? <ShieldAlertIcon /> : <GitMergeIcon />}
+ {isBypassMerge ? <ShieldAlertIcon /> : <GitMergeIcon />}
Merge
</Button>
</div>
diff --git a/frontend/src/pages/secret-manager/SecretApprovalsPage/components/SecretApprovalRequest/components/SecretApprovalRequestChanges.tsx b/frontend/src/pages/secret-manager/SecretApprovalsPage/components/SecretApprovalRequest/components/SecretApprovalRequestChanges.tsx
index 578f4a3637..869bb5df42 100644
--- a/frontend/src/pages/secret-manager/SecretApprovalsPage/components/SecretApprovalRequest/components/SecretApprovalRequestChanges.tsx
+++ b/frontend/src/pages/secret-manager/SecretApprovalsPage/components/SecretApprovalRequest/components/SecretApprovalRequestChanges.tsx
@@ -184,7 +184,10 @@ export const SecretApprovalRequestChanges = ({
const { mutateAsync: performSecretApprovalMerge } = usePerformSecretApprovalRequestMerge();
- const handleReview = async (status: ApprovalStatus) => {
+ const handleReview = async (
+ status: ApprovalStatus,
+ { notify = true }: { notify?: boolean } = {}
+ ) => {
if (!secretApprovalRequestDetails) return;
await updateSecretApprovalRequestStatus({
id: approvalRequestId,
@@ -192,10 +195,12 @@ export const SecretApprovalRequestChanges = ({
comment,
projectId
});
- createNotification({
- type: "success",
- text: `Successfully ${status} the request`
- });
+ if (notify) {
+ createNotification({
+ type: "success",
+ text: `Successfully ${status} the request`
+ });
+ }
setComment("");
setIsReviewPopoverOpen(false);
};
@@ -204,8 +209,12 @@ export const SecretApprovalRequestChanges = ({
if (!secretApprovalRequestDetails) return;
try {
setWillMerge(true);
- await handleReview(ApprovalStatus.APPROVED);
+ await handleReview(ApprovalStatus.APPROVED, { notify: false });
await performSecretApprovalMerge({ projectId, id: secretApprovalRequestDetails.id });
+ createNotification({
+ type: "success",
+ text: "Successfully merged the request"
+ });
} catch {
// Approval or merge failed, error already shown via mutation
} finally {