Merge pull request #340 from Hexastack/338-issue-context-var-edit-dialog-issue

fix(frontend): contextVar edit dialog states
This commit is contained in:
Med Marrouchi 2024-11-17 10:13:36 +01:00 committed by GitHub
commit 3b33dd4bd9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -66,7 +66,11 @@ export const ContextVarDialog: FC<ContextVarDialogProps> = ({
formState: { errors },
control,
} = useForm<IContextVarAttributes>({
defaultValues: { name: data?.name || "", label: data?.label || "" },
defaultValues: {
name: data?.name || "",
label: data?.label || "",
permanent: data?.permanent || false,
},
});
const validationRules = {
label: {
@ -96,6 +100,7 @@ export const ContextVarDialog: FC<ContextVarDialogProps> = ({
reset({
label: data.label,
name: data.name,
permanent: data.permanent,
});
} else {
reset();