mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Merge pull request #3395 from Infisical/feat/addCommentToAccessRequests
Add access request note and change secret request to change request
This commit is contained in:
@@ -79,6 +79,8 @@ export type TAccessApprovalRequest = {
|
||||
member: string;
|
||||
status: string;
|
||||
}[];
|
||||
|
||||
note?: string;
|
||||
};
|
||||
|
||||
export type TAccessApproval = {
|
||||
@@ -119,6 +121,7 @@ export type TProjectUserPrivilege = {
|
||||
|
||||
export type TCreateAccessRequestDTO = {
|
||||
projectSlug: string;
|
||||
note?: string;
|
||||
} & Omit<TProjectUserPrivilege, "id" | "createdAt" | "updatedAt" | "slug" | "projectMembershipId">;
|
||||
|
||||
export type TGetAccessApprovalRequestsDTO = {
|
||||
|
||||
@@ -67,7 +67,8 @@ const secretPermissionSchema = z.object({
|
||||
z.object({
|
||||
isTemporary: z.literal(false)
|
||||
})
|
||||
])
|
||||
]),
|
||||
note: z.string().optional()
|
||||
});
|
||||
type TSecretPermissionForm = z.infer<typeof secretPermissionSchema>;
|
||||
export const SpecificPrivilegeSecretForm = ({
|
||||
@@ -231,7 +232,8 @@ export const SpecificPrivilegeSecretForm = ({
|
||||
action,
|
||||
subject: [ProjectPermissionSub.Secrets],
|
||||
conditions
|
||||
}))
|
||||
})),
|
||||
note: data.note
|
||||
});
|
||||
|
||||
createNotification({
|
||||
@@ -541,6 +543,18 @@ export const SpecificPrivilegeSecretForm = ({
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<div className="mb-4 flex w-full">
|
||||
<Controller
|
||||
control={privilegeForm.control}
|
||||
name="note"
|
||||
render={({ field }) => (
|
||||
<div className="w-full">
|
||||
<FormLabel label="Note" className="mb-2" />
|
||||
<Input {...field} isDisabled={isMemberEditDisabled} maxLength={255} />
|
||||
</div>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
{!!policies && (
|
||||
<Button
|
||||
type="submit"
|
||||
|
||||
@@ -64,7 +64,7 @@ export const SecretApprovalsPage = () => {
|
||||
<Tabs defaultValue={defaultTab}>
|
||||
<TabList>
|
||||
<Tab value={TabSection.SecretApprovalRequests}>
|
||||
Secret Requests
|
||||
Change Requests
|
||||
{Boolean(secretApprovalReqCount?.open) && (
|
||||
<Badge className="ml-2">{secretApprovalReqCount?.open}</Badge>
|
||||
)}
|
||||
|
||||
@@ -136,6 +136,13 @@ export const ReviewAccessRequestModal = ({
|
||||
<span className="font-bold">Access Type: </span>
|
||||
<span>{getAccessLabel()}</span>
|
||||
</div>
|
||||
|
||||
{request.note && (
|
||||
<div className="mt-1">
|
||||
<span className="font-bold">User Note: </span>
|
||||
<span>{request.note}</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="space-x-2">
|
||||
|
||||
Reference in New Issue
Block a user