fix: prevent duplicate submit and unlock on validation failure in deploy/update modals
This commit is contained in:
@@ -66,6 +66,7 @@ interface DataFormProps {
|
||||
onOk: (values: FormData) => void;
|
||||
onBackendChange?: (value: string) => void;
|
||||
onClusterChange?: (value: number) => void;
|
||||
onFinishFailed?: (errorInfo: any) => void;
|
||||
}
|
||||
|
||||
const TABKeysMap = {
|
||||
@@ -91,6 +92,7 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
|
||||
onSourceChange,
|
||||
onValuesChange,
|
||||
onClusterChange,
|
||||
onFinishFailed,
|
||||
onOk
|
||||
} = props;
|
||||
const { getScrollElementScrollableHeight } = useWrapperContext();
|
||||
@@ -285,6 +287,7 @@ const DataForm: React.FC<DataFormProps> = forwardRef((props, ref) => {
|
||||
|
||||
const handleOnFinishFailed = (errorInfo: any) => {
|
||||
setSubmitAttempted(true);
|
||||
onFinishFailed?.(errorInfo);
|
||||
console.log('Failed:', errorInfo);
|
||||
const { errorFields } = errorInfo;
|
||||
if (errorFields && errorFields.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user