muditagrawal2007 commented on code in PR #75818:
URL: https://github.com/apache/airflow/pull/75818#discussion_r4403472624
##########
airflow-core/src/airflow/ui/src/components/FlexibleForm/FieldNumber.tsx:
##########
@@ -32,20 +36,44 @@ export const FieldNumber = ({ name, namespace = "default",
onUpdate }: FlexibleF
// "undefined" values are removed from params, so we set it to null to
avoid falling back to DAG defaults.
paramsDict[name].value = null;
}
- } else {
- // Convert the string to a number if a valid value is entered
- if (paramsDict[name]) {
- paramsDict[name].value = Number(value);
- }
+
+ setParamsDict(paramsDict);
+ onUpdate(value);
+
+ return;
+ }
+
+ // Convert the string to a number if a valid value is entered
+ const numericValue = Number(value);
+
+ if (paramsDict[name]) {
+ paramsDict[name].value = numericValue;
}
setParamsDict(paramsDict);
+
+ const violation = getParamRangeViolation(numericValue, param.schema);
Review Comment:
Good catch, thanks for the report — fixed in `a0e6e7e366`.
The flexible form kept all validation errors in a single flag, so a
successful
edit of *any* other param cleared that flag and the Trigger button was
re-enabled even though the out-of-range value was still in place. The errors
are now tracked per param, and the form-level error state is derived from the
whole set instead of from the error of the param that was edited last.
Two tests were added in `TriggerDAGForm.test.tsx`:
- the flow you described — type `6666` into the numeric param, then edit the
other param: the inline error stays, the Trigger button stays disabled and
no Dag run is created.
- the opposite direction — correcting the value re-enables the Trigger, so
the
error is not sticky.
---
Drafted-by: OpenCode (MiniMax-M3); reviewed by @muditagrawal2007 before
posting
--
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]