mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-04 12:26:13 +00:00
fix(secret-approval): resolved update failure in secret approval mode and number not increasing on frontend
This commit is contained in:
@@ -429,6 +429,9 @@ export const UpdateSecretByNameBatchV3 = z.object({
|
|||||||
secretValueCiphertext: z.string().trim(),
|
secretValueCiphertext: z.string().trim(),
|
||||||
secretValueIV: z.string().trim(),
|
secretValueIV: z.string().trim(),
|
||||||
secretValueTag: z.string().trim(),
|
secretValueTag: z.string().trim(),
|
||||||
|
secretKeyCiphertext: z.string().trim(),
|
||||||
|
secretKeyIV: z.string().trim(),
|
||||||
|
secretKeyTag: z.string().trim(),
|
||||||
secretCommentCiphertext: z.string().trim().optional(),
|
secretCommentCiphertext: z.string().trim().optional(),
|
||||||
secretCommentIV: z.string().trim().optional(),
|
secretCommentIV: z.string().trim().optional(),
|
||||||
secretCommentTag: z.string().trim().optional(),
|
secretCommentTag: z.string().trim().optional(),
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import { Button, Modal, ModalContent } from "@app/components/v2";
|
|||||||
import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context";
|
import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context";
|
||||||
import { usePopUp, useToggle } from "@app/hooks";
|
import { usePopUp, useToggle } from "@app/hooks";
|
||||||
import { useCreateSecretBatch, useUpdateSecretBatch } from "@app/hooks/api";
|
import { useCreateSecretBatch, useUpdateSecretBatch } from "@app/hooks/api";
|
||||||
|
import { secretApprovalRequestKeys } from "@app/hooks/api/secretApprovalRequest/queries";
|
||||||
import { secretKeys } from "@app/hooks/api/secrets/queries";
|
import { secretKeys } from "@app/hooks/api/secrets/queries";
|
||||||
import { DecryptedSecret, UserWsKeyPair } from "@app/hooks/api/types";
|
import { DecryptedSecret, UserWsKeyPair } from "@app/hooks/api/types";
|
||||||
|
|
||||||
@@ -194,6 +195,7 @@ export const SecretDropzone = ({
|
|||||||
queryClient.invalidateQueries(
|
queryClient.invalidateQueries(
|
||||||
secretKeys.getProjectSecret({ workspaceId, environment, secretPath })
|
secretKeys.getProjectSecret({ workspaceId, environment, secretPath })
|
||||||
);
|
);
|
||||||
|
queryClient.invalidateQueries(secretApprovalRequestKeys.count({ workspaceId }));
|
||||||
handlePopUpClose("overlapKeyWarning");
|
handlePopUpClose("overlapKeyWarning");
|
||||||
createNotification({
|
createNotification({
|
||||||
type: "success",
|
type: "success",
|
||||||
@@ -222,9 +224,9 @@ export const SecretDropzone = ({
|
|||||||
onDragOver={handleDrag}
|
onDragOver={handleDrag}
|
||||||
onDrop={handleDrop}
|
onDrop={handleDrop}
|
||||||
className={twMerge(
|
className={twMerge(
|
||||||
"relative mx-0.5 mb-4 mt-4 flex cursor-pointer items-center justify-center rounded-md bg-mineshaft-900 py-4 text-sm px-2 text-mineshaft-200 opacity-60 outline-dashed outline-2 outline-chicago-600 duration-200 hover:opacity-100",
|
"relative mx-0.5 mb-4 mt-4 flex cursor-pointer items-center justify-center rounded-md bg-mineshaft-900 py-4 px-2 text-sm text-mineshaft-200 opacity-60 outline-dashed outline-2 outline-chicago-600 duration-200 hover:opacity-100",
|
||||||
isDragActive && "opacity-100",
|
isDragActive && "opacity-100",
|
||||||
!isSmaller && "w-full max-w-3xl flex-col space-y-4 py-20 mx-auto",
|
!isSmaller && "mx-auto w-full max-w-3xl flex-col space-y-4 py-20",
|
||||||
isLoading && "bg-bunker-800"
|
isLoading && "bg-bunker-800"
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
@@ -238,7 +240,7 @@ export const SecretDropzone = ({
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="flex items-center justify-cente flex-col space-y-2">
|
<div className="justify-cente flex flex-col items-center space-y-2">
|
||||||
<div>
|
<div>
|
||||||
<FontAwesomeIcon icon={faUpload} size={isSmaller ? "2x" : "5x"} />
|
<FontAwesomeIcon icon={faUpload} size={isSmaller ? "2x" : "5x"} />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import { CreateTagModal } from "@app/components/tags/CreateTagModal";
|
|||||||
import { DeleteActionModal } from "@app/components/v2";
|
import { DeleteActionModal } from "@app/components/v2";
|
||||||
import { usePopUp } from "@app/hooks";
|
import { usePopUp } from "@app/hooks";
|
||||||
import { useCreateSecretV3, useDeleteSecretV3, useUpdateSecretV3 } from "@app/hooks/api";
|
import { useCreateSecretV3, useDeleteSecretV3, useUpdateSecretV3 } from "@app/hooks/api";
|
||||||
|
import { secretApprovalRequestKeys } from "@app/hooks/api/secretApprovalRequest/queries";
|
||||||
import { secretKeys } from "@app/hooks/api/secrets/queries";
|
import { secretKeys } from "@app/hooks/api/secrets/queries";
|
||||||
import { DecryptedSecret } from "@app/hooks/api/secrets/types";
|
import { DecryptedSecret } from "@app/hooks/api/secrets/types";
|
||||||
import { secretSnapshotKeys } from "@app/hooks/api/secretSnapshots/queries";
|
import { secretSnapshotKeys } from "@app/hooks/api/secretSnapshots/queries";
|
||||||
@@ -262,6 +263,7 @@ export const SecretListView = ({
|
|||||||
queryClient.invalidateQueries(
|
queryClient.invalidateQueries(
|
||||||
secretSnapshotKeys.count({ workspaceId, environment, directory: secretPath })
|
secretSnapshotKeys.count({ workspaceId, environment, directory: secretPath })
|
||||||
);
|
);
|
||||||
|
queryClient.invalidateQueries(secretApprovalRequestKeys.count({ workspaceId }));
|
||||||
handlePopUpClose("secretDetail");
|
handlePopUpClose("secretDetail");
|
||||||
createNotification({
|
createNotification({
|
||||||
type: "success",
|
type: "success",
|
||||||
@@ -284,6 +286,7 @@ export const SecretListView = ({
|
|||||||
const { key, _id: secretId } = popUp.deleteSecret?.data as DecryptedSecret;
|
const { key, _id: secretId } = popUp.deleteSecret?.data as DecryptedSecret;
|
||||||
try {
|
try {
|
||||||
await handleSecretOperation("delete", "shared", key, { secretId });
|
await handleSecretOperation("delete", "shared", key, { secretId });
|
||||||
|
// wrap this in another function and then reuse
|
||||||
queryClient.invalidateQueries(
|
queryClient.invalidateQueries(
|
||||||
secretKeys.getProjectSecret({ workspaceId, environment, secretPath })
|
secretKeys.getProjectSecret({ workspaceId, environment, secretPath })
|
||||||
);
|
);
|
||||||
@@ -293,6 +296,7 @@ export const SecretListView = ({
|
|||||||
queryClient.invalidateQueries(
|
queryClient.invalidateQueries(
|
||||||
secretSnapshotKeys.count({ workspaceId, environment, directory: secretPath })
|
secretSnapshotKeys.count({ workspaceId, environment, directory: secretPath })
|
||||||
);
|
);
|
||||||
|
queryClient.invalidateQueries(secretApprovalRequestKeys.count({ workspaceId }));
|
||||||
handlePopUpClose("deleteSecret");
|
handlePopUpClose("deleteSecret");
|
||||||
handlePopUpClose("secretDetail");
|
handlePopUpClose("secretDetail");
|
||||||
createNotification({
|
createNotification({
|
||||||
|
|||||||
Reference in New Issue
Block a user