diff --git a/frontend/src/pages/secret-manager/SecretApprovalsPage/components/AccessApprovalRequest/components/ReviewAccessModal.tsx b/frontend/src/pages/secret-manager/SecretApprovalsPage/components/AccessApprovalRequest/components/ReviewAccessModal.tsx index f93eaa9ab..edaff1f00 100644 --- a/frontend/src/pages/secret-manager/SecretApprovalsPage/components/AccessApprovalRequest/components/ReviewAccessModal.tsx +++ b/frontend/src/pages/secret-manager/SecretApprovalsPage/components/AccessApprovalRequest/components/ReviewAccessModal.tsx @@ -445,7 +445,7 @@ export const ReviewAccessRequestModal = ({ onCheckedChange={(checked) => setBypassApproval(checked === true)} isChecked={bypassApproval} id="byPassApproval" - className={twMerge("mr-2", bypassApproval ? "border-red/30 bg-red/10" : "")} + className={twMerge("mr-2", bypassApproval ? "!border-red/30 !bg-red/10" : "")} > Approve without waiting for requirements to be met (bypass policy protection) 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 d08fb20b4..4853f7cae 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,43 +102,73 @@ export const SecretApprovalRequestAction = ({ if (!hasMerged && status === "open") { return ( -
-
-
- +
+
+
+
+ +
+ +

+ {isMergable ? "Good to merge" : "Merging is blocked"} +

+ {!isMergable && ( + + At least {approvals} approving review{`${approvals > 1 ? "s" : ""}`} required by + eligible reviewers. + {Boolean(statusChangeByEmail) && `. Reopened by ${statusChangeByEmail}`} + + )} +
- -

- {isMergable ? "Good to merge" : "Merging is blocked"} -

- {!isMergable && ( - - At least {approvals} approving review{`${approvals > 1 ? "s" : ""}`} required by - eligible reviewers. - {Boolean(statusChangeByEmail) && `. Reopened by ${statusChangeByEmail}`} - +
+ {canApprove || isSoftEnforcement ? ( +
+ + +
+ ) : ( +
Only approvers can merge
)} - +
{isSoftEnforcement && !isMergable && isBypasser && ( -
+
setByPassApproval(checked === true)} isChecked={byPassApproval} id="byPassApproval" checkIndicatorBg="text-white" - className={twMerge( - "mr-2", - byPassApproval ? "border-red bg-red hover:bg-red-600" : "" - )} + className={twMerge("mr-2", byPassApproval ? "!border-red/30 !bg-red/10" : "")} > Merge without waiting for approval (bypass secret change policy) @@ -162,51 +192,18 @@ export const SecretApprovalRequestAction = ({
)} -
- {canApprove || isSoftEnforcement ? ( -
- - -
- ) : ( -
Only approvers can merge
- )} -
); } if (hasMerged && status === "close") return ( -
-
- +
+
+ Change request merged - + Merged by {statusChangeByEmail}. @@ -215,26 +212,26 @@ export const SecretApprovalRequestAction = ({ ); return ( -
-
- +
+
+ Secret approval has been closed - + Closed by {statusChangeByEmail}
-
- -
+
); }; diff --git a/frontend/src/pages/secret-manager/SecretApprovalsPage/components/SecretApprovalRequest/components/SecretApprovalRequestChangeItem.tsx b/frontend/src/pages/secret-manager/SecretApprovalsPage/components/SecretApprovalRequest/components/SecretApprovalRequestChangeItem.tsx index 3720b63dc..3701a4f86 100644 --- a/frontend/src/pages/secret-manager/SecretApprovalsPage/components/SecretApprovalRequest/components/SecretApprovalRequestChangeItem.tsx +++ b/frontend/src/pages/secret-manager/SecretApprovalsPage/components/SecretApprovalRequest/components/SecretApprovalRequestChangeItem.tsx @@ -3,6 +3,7 @@ /* eslint-disable no-nested-ternary */ import { useState } from "react"; import { + faCircleCheck, faCircleXmark, faExclamationTriangle, faEye, @@ -29,14 +30,14 @@ export type Props = { }; const generateItemTitle = (op: CommitType) => { - let text = { label: "", color: "" }; - if (op === CommitType.CREATE) text = { label: "create", color: "#60DD00" }; - else if (op === CommitType.UPDATE) text = { label: "change", color: "#F8EB30" }; - else text = { label: "deletion", color: "#F83030" }; + let text = { label: "", className: "" }; + if (op === CommitType.CREATE) text = { label: "create", className: "text-green-600" }; + else if (op === CommitType.UPDATE) text = { label: "change", className: "text-yellow-600" }; + else text = { label: "deletion", className: "text-red-600" }; return (
- Request for secret {text.label} + Request for secret {text.label}
); }; @@ -215,7 +216,7 @@ export const SecretApprovalRequestChangeItem = ({
New Secret
- + New
@@ -281,15 +282,15 @@ export const SecretApprovalRequestChangeItem = ({
Tags
-
+
{(newVersion?.tags?.length ?? 0) ? ( newVersion?.tags?.map(({ slug, id: tagId, color }) => (
{slug}
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 466a06c84..e1bcabe78 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 @@ -3,12 +3,12 @@ import { Controller, useForm } from "react-hook-form"; import { faAngleDown, faArrowLeft, - faCheckCircle, - faCircle, + faBan, + faCheck, faCodeBranch, faComment, faFolder, - faXmarkCircle + faHourglass } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { zodResolver } from "@hookform/resolvers/zod"; @@ -26,6 +26,7 @@ import { DropdownMenuTrigger, EmptyState, FormControl, + GenericFieldLabel, IconButton, TextArea, Tooltip @@ -81,10 +82,10 @@ export const generateCommitText = (commits: { op: CommitType }[] = [], isReplica const getReviewedStatusSymbol = (status?: ApprovalStatus) => { if (status === ApprovalStatus.APPROVED) - return ; + return ; if (status === ApprovalStatus.REJECTED) - return ; - return ; + return ; + return ; }; type Props = { @@ -242,17 +243,17 @@ export const SecretApprovalRequestChanges = ({ : secretApprovalRequestDetails.status}
-
+
{generateCommitText( secretApprovalRequestDetails.commits, secretApprovalRequestDetails.isReplicated )}
-
+ By {secretApprovalRequestDetails?.committerUser?.firstName} ( {secretApprovalRequestDetails?.committerUser?.email}) -
+
{!hasMerged && secretApprovalRequestDetails.status === "open" && @@ -262,7 +263,10 @@ export const SecretApprovalRequestChanges = ({ onOpenChange={(isOpen) => handlePopUpToggle("reviewChanges", isOpen)} > - @@ -279,82 +283,87 @@ export const SecretApprovalRequestChanges = ({ {...field} placeholder="Leave a comment..." reSize="none" - className="text-md mt-2 h-40 border border-mineshaft-600 bg-bunker-800" + className="text-md mt-2 h-40 border border-mineshaft-600 bg-mineshaft-800 placeholder:text-mineshaft-400" /> )} /> - ( - - + ( + -
- - - - field.onChange(ApprovalStatus.APPROVED)} - onKeyDown={(e) => { - if (e.key === "Enter" || e.key === " ") { - e.preventDefault(); - field.onChange(ApprovalStatus.APPROVED); - } - }} - tabIndex={0} - role="button" - > - Approve - -
-
- - - - field.onChange(ApprovalStatus.REJECTED)} - onKeyDown={(e) => { - if (e.key === "Enter" || e.key === " ") { - e.preventDefault(); - field.onChange(ApprovalStatus.REJECTED); - } - }} - tabIndex={0} - role="button" - > - Reject - -
-
-
- )} - /> -
+ +
+ + + + field.onChange(ApprovalStatus.APPROVED)} + onKeyDown={(e) => { + if (e.key === "Enter" || e.key === " ") { + e.preventDefault(); + field.onChange(ApprovalStatus.APPROVED); + } + }} + tabIndex={0} + role="button" + > + Approve + +
+
+ + + + field.onChange(ApprovalStatus.REJECTED)} + onKeyDown={(e) => { + if (e.key === "Enter" || e.key === " ") { + e.preventDefault(); + field.onChange(ApprovalStatus.REJECTED); + } + }} + tabIndex={0} + role="button" + > + Reject + +
+
+ + )} + /> @@ -371,14 +380,14 @@ export const SecretApprovalRequestChanges = ({
A secret import in

{secretApprovalRequestDetails?.environment}

-
-

- +

+

+

has pending changes to be accepted from its source at{" "}

{replicatedImport?.importEnv?.slug}

-
-

- +

+

+

Secret(s) in

{secretApprovalRequestDetails?.environment}

-
-

- +

+

+

@@ -477,14 +486,16 @@ export const SecretApprovalRequestChanges = ({ {reviewer?.status === ApprovalStatus.APPROVED ? "approved" : "rejected"} {" "} the request on{" "} - {format(new Date(secretApprovalRequestDetails.createdAt), "PPpp zzz")}. + {format( + new Date(secretApprovalRequestDetails.createdAt), + "MM/dd/yyyy h:mm:ss aa" + )} + .
{reviewer?.comment && ( - - - + + {reviewer?.comment && reviewer.comment} + )}
); @@ -505,7 +516,7 @@ export const SecretApprovalRequestChanges = ({ />
-
+
Reviewers
{secretApprovalRequestDetails?.policy?.approvers