minor style updates to approvals

This commit is contained in:
Vladyslav Matsiiako
2023-10-03 20:32:34 -07:00
committed by Akhil Mohan
parent df636c91b4
commit 7caac2e64c
8 changed files with 27 additions and 24 deletions

View File

@@ -26,7 +26,7 @@ export const CreateSecretApprovalRule = z.object({
}) })
.refine((data) => data.approvals <= data.approvers.length, { .refine((data) => data.approvals <= data.approvers.length, {
path: ["approvals"], path: ["approvals"],
message: "Approvals should be lower than approvals" message: "The number of approvals should be lower than the number of approvers."
}) })
}); });
@@ -43,7 +43,7 @@ export const UpdateSecretApprovalRule = z.object({
}) })
.refine((data) => data.approvals <= data.approvers.length, { .refine((data) => data.approvals <= data.approvers.length, {
path: ["approvals"], path: ["approvals"],
message: "Approvals should be lower than approvals" message: "The number of approvals should be lower than the number of approvers."
}) })
}); });

File diff suppressed because one or more lines are too long

View File

@@ -70,7 +70,7 @@ const buttonVariants = cva(
{ {
colorSchema: "primary", colorSchema: "primary",
variant: "solid", variant: "solid",
className: "bg-primary-500 bg-opacity-90 hover:bg-primary-500 hover:text-black" className: "text-black bg-primary-500 bg-opacity-90 hover:bg-primary-500 hover:text-black"
}, },
{ {
colorSchema: "primary", colorSchema: "primary",

View File

@@ -484,7 +484,7 @@ export const AppLayout = ({ children }: LayoutProps) => {
isSelected={ isSelected={
router.asPath === `/project/${currentWorkspace?._id}/approval` router.asPath === `/project/${currentWorkspace?._id}/approval`
} }
icon="system-outline-126-verified" icon="system-outline-189-domain-verification"
> >
Secret Approval Secret Approval
</MenuItem> </MenuItem>

View File

@@ -81,7 +81,7 @@ export const SecretApprovalPolicyRow = ({
style={{ width: "var(--radix-dropdown-menu-trigger-width)" }} style={{ width: "var(--radix-dropdown-menu-trigger-width)" }}
align="start" align="start"
> >
<DropdownMenuLabel>Select members that must approve changes</DropdownMenuLabel> <DropdownMenuLabel>Select members that are allowed to approve changes</DropdownMenuLabel>
{members?.map(({ _id, user }) => { {members?.map(({ _id, user }) => {
const isChecked = selectedApprovers.includes(_id); const isChecked = selectedApprovers.includes(_id);
return ( return (

View File

@@ -43,7 +43,7 @@ const formSchema = z
}) })
.refine((data) => data.approvals <= data.approvers.length, { .refine((data) => data.approvals <= data.approvers.length, {
path: ["approvals"], path: ["approvals"],
message: "Approvals should be lower than approvals" message: "The number of approvals should be lower than the number of approvers."
}); });
type TFormSchema = z.infer<typeof formSchema>; type TFormSchema = z.infer<typeof formSchema>;
@@ -183,7 +183,7 @@ export const SecretPolicyForm = ({
name="approvers" name="approvers"
render={({ field: { value, onChange }, fieldState: { error } }) => ( render={({ field: { value, onChange }, fieldState: { error } }) => (
<FormControl <FormControl
label="Approvals Required" label="Approvers Required"
isError={Boolean(error)} isError={Boolean(error)}
errorText={error?.message} errorText={error?.message}
> >
@@ -199,7 +199,7 @@ export const SecretPolicyForm = ({
style={{ width: "var(--radix-dropdown-menu-trigger-width)" }} style={{ width: "var(--radix-dropdown-menu-trigger-width)" }}
align="start" align="start"
> >
<DropdownMenuLabel>Select members that must approve changes</DropdownMenuLabel> <DropdownMenuLabel>Select members that are allowed to approve changes</DropdownMenuLabel>
{members.map(({ _id, user }) => { {members.map(({ _id, user }) => {
const isChecked = value?.includes(_id); const isChecked = value?.includes(_id);
return ( return (

View File

@@ -90,12 +90,12 @@ export const SecretApprovalRequest = () => {
<motion.div <motion.div
key="approval-changes-list" key="approval-changes-list"
transition={{ duration: 0.1 }} transition={{ duration: 0.1 }}
initial={{ opacity: 0, translateX: -30 }} initial={{ opacity: 0, translateX: 30 }}
animate={{ opacity: 1, translateX: 0 }} animate={{ opacity: 1, translateX: 0 }}
exit={{ opacity: 0, translateX: -30 }} exit={{ opacity: 0, translateX: 30 }}
className="rounded-md text-gray-300" className="rounded-md text-gray-300"
> >
<div className="p-4 px-8 flex items-center space-x-8 bg-mineshaft-800"> <div className="p-4 px-8 flex items-center space-x-8 bg-mineshaft-800 rounded-t-md border-t border-x border-mineshaft-600">
<div <div
role="button" role="button"
tabIndex={0} tabIndex={0}
@@ -103,13 +103,13 @@ export const SecretApprovalRequest = () => {
onKeyDown={(evt) => { onKeyDown={(evt) => {
if (evt.key === "Enter") setStatusFilter("open"); if (evt.key === "Enter") setStatusFilter("open");
}} }}
className={statusFilter === "close" ? "text-gray-500" : ""} className={statusFilter === "close" ? "text-gray-500 hover:text-gray-400 duration-100" : ""}
> >
<FontAwesomeIcon icon={faCodeBranch} className="mr-2" /> <FontAwesomeIcon icon={faCodeBranch} className="mr-2" />
Open Open
</div> </div>
<div <div
className={statusFilter === "open" ? "text-gray-500" : ""} className={statusFilter === "open" ? "text-gray-500 hover:text-gray-400 duration-100" : ""}
role="button" role="button"
tabIndex={0} tabIndex={0}
onClick={() => setStatusFilter("close")} onClick={() => setStatusFilter("close")}
@@ -175,7 +175,7 @@ export const SecretApprovalRequest = () => {
</DropdownMenu> </DropdownMenu>
</div> </div>
</div> </div>
<div className="flex flex-col border-t border-mineshaft-600 bg-mineshaft-800"> <div className="flex flex-col border-t border-mineshaft-600 bg-mineshaft-800 rounded-b-md border-b border-x border-mineshaft-600">
{isRequestListEmpty && ( {isRequestListEmpty && (
<div className="py-12"> <div className="py-12">
<EmptyState title="No more requests pending." /> <EmptyState title="No more requests pending." />

View File

@@ -96,24 +96,26 @@ export const SecretApprovalRequestAction = ({
</span> </span>
</span> </span>
</div> </div>
<div className="flex items-center space-x-6"> <div className="flex items-center space-x-2">
<Button
onClick={() => handleSecretApprovalStatusChange("close")}
isLoading={isStatusChanging}
variant="outline_bg"
colorSchema="secondary"
leftIcon={<FontAwesomeIcon icon={faClose} />}
>
Close request
</Button>
<Button <Button
leftIcon={<FontAwesomeIcon icon={faCheck} />} leftIcon={<FontAwesomeIcon icon={faCheck} />}
isDisabled={!isMergable} isDisabled={!isMergable}
isLoading={isMerging} isLoading={isMerging}
onClick={handleSecretApprovalRequestMerge} onClick={handleSecretApprovalRequestMerge}
colorSchema="primary"
variant="solid"
> >
Merge Merge
</Button> </Button>
<Button
onClick={() => handleSecretApprovalStatusChange("close")}
isLoading={isStatusChanging}
variant="outline_bg"
colorSchema="danger"
leftIcon={<FontAwesomeIcon icon={faClose} />}
>
Close request
</Button>
</div> </div>
</div> </div>
); );