mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
fix: ui state
This commit is contained in:
@@ -45,25 +45,21 @@ export const EnvKeyPlatformModal = ({ onClose }: Props) => {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await importEnvKey({
|
||||
file: data.file,
|
||||
decryptionKey: data.encryptionKey
|
||||
});
|
||||
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"
|
||||
});
|
||||
await importEnvKey({
|
||||
file: data.file,
|
||||
decryptionKey: data.encryptionKey
|
||||
});
|
||||
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();
|
||||
onClose();
|
||||
reset();
|
||||
|
||||
if (fileUploadRef.current) {
|
||||
fileUploadRef.current.value = "";
|
||||
}
|
||||
} catch {
|
||||
reset();
|
||||
if (fileUploadRef.current) {
|
||||
fileUploadRef.current.value = "";
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -74,30 +74,33 @@ export const VaultPlatformModal = ({ onClose }: Props) => {
|
||||
control,
|
||||
handleSubmit,
|
||||
reset,
|
||||
formState: { isLoading, isDirty, isSubmitting, isValid }
|
||||
formState: { isLoading, isDirty, isSubmitting, isValid, errors }
|
||||
} = useForm<TFormData>({
|
||||
resolver: zodResolver(formSchema)
|
||||
});
|
||||
|
||||
const onSubmit = async (data: TFormData) => {
|
||||
try {
|
||||
await importVault({
|
||||
vaultAccessToken: data.vaultAccessToken,
|
||||
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"
|
||||
});
|
||||
console.log({
|
||||
isSubmitting,
|
||||
isLoading,
|
||||
isValid,
|
||||
errors
|
||||
});
|
||||
|
||||
onClose();
|
||||
reset();
|
||||
} catch {
|
||||
reset();
|
||||
}
|
||||
const onSubmit = async (data: TFormData) => {
|
||||
await importVault({
|
||||
vaultAccessToken: data.vaultAccessToken,
|
||||
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 (
|
||||
|
||||
Reference in New Issue
Block a user