mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 17:27:40 +00:00
fix: ui state
This commit is contained in:
+13
-17
@@ -45,25 +45,21 @@ export const EnvKeyPlatformModal = ({ onClose }: Props) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
await importEnvKey({
|
||||||
await importEnvKey({
|
file: data.file,
|
||||||
file: data.file,
|
decryptionKey: data.encryptionKey
|
||||||
decryptionKey: data.encryptionKey
|
});
|
||||||
});
|
createNotification({
|
||||||
createNotification({
|
title: "Import started",
|
||||||
title: "Import started",
|
text: "Your data is being imported. You will receive an email when the import is complete or if the import fails. This may take up to 10 minutes.",
|
||||||
text: "Your data is being imported. You will receive an email when the import is complete or if the import fails. This may take up to 10 minutes.",
|
type: "info"
|
||||||
type: "info"
|
});
|
||||||
});
|
|
||||||
|
|
||||||
onClose();
|
onClose();
|
||||||
reset();
|
reset();
|
||||||
|
|
||||||
if (fileUploadRef.current) {
|
if (fileUploadRef.current) {
|
||||||
fileUploadRef.current.value = "";
|
fileUploadRef.current.value = "";
|
||||||
}
|
|
||||||
} catch {
|
|
||||||
reset();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+22
-19
@@ -74,30 +74,33 @@ export const VaultPlatformModal = ({ onClose }: Props) => {
|
|||||||
control,
|
control,
|
||||||
handleSubmit,
|
handleSubmit,
|
||||||
reset,
|
reset,
|
||||||
formState: { isLoading, isDirty, isSubmitting, isValid }
|
formState: { isLoading, isDirty, isSubmitting, isValid, errors }
|
||||||
} = useForm<TFormData>({
|
} = useForm<TFormData>({
|
||||||
resolver: zodResolver(formSchema)
|
resolver: zodResolver(formSchema)
|
||||||
});
|
});
|
||||||
|
|
||||||
const onSubmit = async (data: TFormData) => {
|
console.log({
|
||||||
try {
|
isSubmitting,
|
||||||
await importVault({
|
isLoading,
|
||||||
vaultAccessToken: data.vaultAccessToken,
|
isValid,
|
||||||
vaultNamespace: data.vaultNamespace,
|
errors
|
||||||
vaultUrl: data.vaultUrl,
|
});
|
||||||
mappingType: data.mappingType
|
|
||||||
});
|
|
||||||
createNotification({
|
|
||||||
title: "Import started",
|
|
||||||
text: "Your data is being imported. You will receive an email when the import is complete or if the import fails. This may take up to 10 minutes.",
|
|
||||||
type: "info"
|
|
||||||
});
|
|
||||||
|
|
||||||
onClose();
|
const onSubmit = async (data: TFormData) => {
|
||||||
reset();
|
await importVault({
|
||||||
} catch {
|
vaultAccessToken: data.vaultAccessToken,
|
||||||
reset();
|
vaultNamespace: data.vaultNamespace,
|
||||||
}
|
vaultUrl: data.vaultUrl,
|
||||||
|
mappingType: data.mappingType
|
||||||
|
});
|
||||||
|
createNotification({
|
||||||
|
title: "Import started",
|
||||||
|
text: "Your data is being imported. You will receive an email when the import is complete or if the import fails. This may take up to 10 minutes.",
|
||||||
|
type: "info"
|
||||||
|
});
|
||||||
|
|
||||||
|
onClose();
|
||||||
|
reset();
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user