feat: added support for recursive file creation

This commit is contained in:
Akhil Mohan
2023-10-11 17:19:34 +05:30
parent 5e4d4f56e3
commit 4f5946b252
13 changed files with 138 additions and 66 deletions
@@ -12,13 +12,14 @@ import { useToggle } from "@app/hooks";
type Props = {
defaultValue?: string | null;
secretName: string;
secretId?: string;
isCreatable?: boolean;
isVisible?: boolean;
environment: string;
secretPath: string;
onSecretCreate: (env: string, key: string, value: string) => Promise<void>;
onSecretUpdate: (env: string, key: string, value: string) => Promise<void>;
onSecretDelete: (env: string, key: string) => Promise<void>;
onSecretDelete: (env: string, key: string, secretId?: string) => Promise<void>;
};
export const SecretEditRow = ({
@@ -30,7 +31,8 @@ export const SecretEditRow = ({
onSecretDelete,
environment,
secretPath,
isVisible
isVisible,
secretId
}: Props) => {
const {
handleSubmit,
@@ -77,7 +79,7 @@ export const SecretEditRow = ({
const handleDeleteSecret = async () => {
setIsDeleting.on();
try {
await onSecretDelete(environment, secretName);
await onSecretDelete(environment, secretName, secretId);
reset({ value: undefined });
} finally {
setIsDeleting.off();
@@ -24,7 +24,7 @@ type Props = {
getSecretByKey: (slug: string, key: string) => DecryptedSecret | undefined;
onSecretCreate: (env: string, key: string, value: string) => Promise<void>;
onSecretUpdate: (env: string, key: string, value: string) => Promise<void>;
onSecretDelete: (env: string, key: string) => Promise<void>;
onSecretDelete: (env: string, key: string, secretId?: string) => Promise<void>;
};
export const SecretOverviewTableRow = ({
@@ -149,6 +149,7 @@ export const SecretOverviewTableRow = ({
isVisible={isSecretVisible}
secretName={secretKey}
defaultValue={secret?.value}
secretId={secret?._id}
isCreatable={isCreatable}
onSecretDelete={onSecretDelete}
onSecretCreate={onSecretCreate}