Skip to content

[V3-1-test] Fix Trigger UI form rendering for null enum values (#62060)#62767

Merged
vatsrahul1001 merged 1 commit into
v3-1-testfrom
backport-62060
Mar 3, 2026
Merged

[V3-1-test] Fix Trigger UI form rendering for null enum values (#62060)#62767
vatsrahul1001 merged 1 commit into
v3-1-testfrom
backport-62060

Conversation

@vatsrahul1001

Copy link
Copy Markdown
Contributor

Backport of #62060

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

* Fix Trigger UI form rendering for null enum values

* fix: preserve original type when selecting numeric enum in FieldDropdown

When a numeric enum value (e.g. 6) was selected, the Select component
returned a string ('6'). The old code stored the string directly, causing
a 400 Bad Request since backend validation expects the integer 6.

Fix: look up the original typed value from schema.enum using the string
as a key, and store that instead of the raw string from the UI.

Regression test added to FieldDropdown.test.tsx.

* fix: resolve ts-compile-lint-ui ESLint errors in FieldDropdown

- Broaden ParamSchema.enum type to Array<boolean | number | string | null>
  to accurately reflect JSON Schema enum values (fixes no-unnecessary-condition)
- Update labelLookup signature to accept boolean
- Switch null-check ternaries to nullish coalescing (??) in FieldDropdown.tsx
- Add eslint-disable for no-unsafe-member-access on any-typed mockParamsDict access
- Remove stale/unused eslint-disable-next-line comments

* fix: handle null enum values in FieldMultiSelect TypeScript types

(cherry picked from commit 4d3230c)
@boring-cyborg boring-cyborg Bot added the area:UI Related to UI/UX. For Frontend Developers. label Mar 3, 2026
@vatsrahul1001 vatsrahul1001 merged commit fd081ba into v3-1-test Mar 3, 2026
64 checks passed
@vatsrahul1001 vatsrahul1001 deleted the backport-62060 branch March 3, 2026 09:58
@vatsrahul1001 vatsrahul1001 added the type:bug-fix Changelog: Bug Fixes label Mar 3, 2026
@vatsrahul1001 vatsrahul1001 added this to the Airflow 3.1.8 milestone Mar 3, 2026
vatsrahul1001 added a commit that referenced this pull request Mar 4, 2026
* Fix Trigger UI form rendering for null enum values

* fix: preserve original type when selecting numeric enum in FieldDropdown

When a numeric enum value (e.g. 6) was selected, the Select component
returned a string ('6'). The old code stored the string directly, causing
a 400 Bad Request since backend validation expects the integer 6.

Fix: look up the original typed value from schema.enum using the string
as a key, and store that instead of the raw string from the UI.

Regression test added to FieldDropdown.test.tsx.

* fix: resolve ts-compile-lint-ui ESLint errors in FieldDropdown

- Broaden ParamSchema.enum type to Array<boolean | number | string | null>
  to accurately reflect JSON Schema enum values (fixes no-unnecessary-condition)
- Update labelLookup signature to accept boolean
- Switch null-check ternaries to nullish coalescing (??) in FieldDropdown.tsx
- Add eslint-disable for no-unsafe-member-access on any-typed mockParamsDict access
- Remove stale/unused eslint-disable-next-line comments

* fix: handle null enum values in FieldMultiSelect TypeScript types

(cherry picked from commit 4d3230c)

Co-authored-by: Subham <subhamsangwan26@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UI Related to UI/UX. For Frontend Developers. type:bug-fix Changelog: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants