feat(infisical-pg): changed frontend api types _id to normal id

This commit is contained in:
Akhil Mohan
2024-01-27 12:38:22 +05:30
parent f3b37de3f3
commit aaba4a0895
161 changed files with 5358 additions and 4510 deletions
@@ -59,7 +59,7 @@ export const SecretApprovalPolicyList = ({ workspaceId }: Props) => {
const { mutateAsync: deleteSecretApprovalPolicy } = useDeleteSecretApprovalPolicy();
const handleDeletePolicy = async () => {
const { id: id } = popUp.deletePolicy.data as TSecretApprovalPolicy;
const { id } = popUp.deletePolicy.data as TSecretApprovalPolicy;
try {
await deleteSecretApprovalPolicy({
workspaceId,
@@ -81,10 +81,10 @@ export const SecretApprovalPolicyList = ({ workspaceId }: Props) => {
return (
<div>
<div className="flex justify-between mb-6">
<div className="mb-6 flex justify-between">
<div className="flex flex-col">
<span className="text-xl font-semibold text-mineshaft-100">Approval Policies</span>
<div className="text-bunker-300 mt-2 text-sm">
<div className="mt-2 text-sm text-bunker-300">
Implement policies to prevent unauthorized secret changes.
</div>
</div>
@@ -50,7 +50,7 @@ export const SecretApprovalPolicyRow = ({
updateSecretApprovalPolicy(
{
workspaceId,
id: policy._id,
id: policy.id,
approvers: selectedApprovers
},
{
@@ -81,18 +81,20 @@ export const SecretApprovalPolicyRow = ({
style={{ width: "var(--radix-dropdown-menu-trigger-width)" }}
align="start"
>
<DropdownMenuLabel>Select members that are allowed to approve changes</DropdownMenuLabel>
{members?.map(({ _id, user }) => {
const isChecked = selectedApprovers.includes(_id);
<DropdownMenuLabel>
Select members that are allowed to approve changes
</DropdownMenuLabel>
{members?.map(({ id, user }) => {
const isChecked = selectedApprovers.includes(id);
return (
<DropdownMenuItem
onClick={(evt) => {
evt.preventDefault();
setSelectedApprovers((state) =>
isChecked ? state.filter((el) => el !== _id) : [...state, _id]
isChecked ? state.filter((el) => el !== id) : [...state, id]
);
}}
key={`create-policy-members-${_id}`}
key={`create-policy-members-${id}`}
iconPos="right"
icon={isChecked && <FontAwesomeIcon icon={faCheckCircle} />}
>
@@ -98,10 +98,10 @@ export const SecretPolicyForm = ({
};
const handleUpdatePolicy = async (data: TFormSchema) => {
if (!editValues?._id) return;
if (!editValues?.id) return;
try {
await updateSecretApprovalPolicy({
id: editValues?._id,
id: editValues?.id,
...data,
secretPath: data.secretPath || null,
workspaceId
@@ -199,20 +199,20 @@ export const SecretPolicyForm = ({
style={{ width: "var(--radix-dropdown-menu-trigger-width)" }}
align="start"
>
<DropdownMenuLabel>Select members that are allowed to approve changes</DropdownMenuLabel>
{members.map(({ _id, user }) => {
const isChecked = value?.includes(_id);
<DropdownMenuLabel>
Select members that are allowed to approve changes
</DropdownMenuLabel>
{members.map(({ id, user }) => {
const isChecked = value?.includes(id);
return (
<DropdownMenuItem
onClick={(evt) => {
evt.preventDefault();
onChange(
isChecked
? value?.filter((el) => el !== _id)
: [...(value || []), _id]
isChecked ? value?.filter((el) => el !== id) : [...(value || []), id]
);
}}
key={`create-policy-members-${_id}`}
key={`create-policy-members-${id}`}
iconPos="right"
icon={isChecked && <FontAwesomeIcon icon={faCheckCircle} />}
>
@@ -243,7 +243,7 @@ export const SecretPolicyForm = ({
</FormControl>
)}
/>
<div className="flex mt-8 space-x-4 items-center">
<div className="mt-8 flex items-center space-x-4">
<Button type="submit" isLoading={isSubmitting} isDisabled={isSubmitting}>
Save
</Button>