choo121600 commented on code in PR #77486:
URL: https://github.com/apache/airflow/pull/77486#discussion_r4693784368
##########
airflow-core/src/airflow/ui/src/components/FlexibleForm/FlexibleForm.tsx:
##########
@@ -115,19 +115,29 @@ export const FlexibleForm = ({
const newSectionError = computeSectionErrors(params,
flexibleFormDefaultSection);
setSectionError(newSectionError);
- setError(hasValidationError || newSectionError.size > 0);
- }, [params, flexibleFormDefaultSection, setError, hasValidationError]);
+ setError(Object.keys(params).some((name) => invalidFields.has(name)) ||
newSectionError.size > 0);
+ }, [params, flexibleFormDefaultSection, setError, invalidFields]);
useEffect(() => {
setDisabled(disabled ?? false);
}, [disabled, setDisabled]);
- const onUpdate = (_value?: string, error?: unknown) => {
- const newSectionError = computeSectionErrors(params,
flexibleFormDefaultSection);
+ const onUpdate = (name: string, error?: unknown) => {
Review Comment:
Filling an empty required field no longer enables Trigger (try "Required
text field" in `example_params_ui_tutorial`; works on `main`). `onUpdate` no
longer recomputes the section errors, and most fields mutate `paramsDict` in
place, so the effect doesn't catch it either.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]