rusackas opened a new pull request, #41841:
URL: https://github.com/apache/superset/pull/41841

   ### SUMMARY
   
   Test-only PR, closes #34617.
   
   Issue #34617 reported that on a dashboard with required filters that have 
default values, the "Apply filters" button stayed unclickable unless *every* 
filter was updated — the defaults looked selected but were never actually 
applied, and a stale `validateStatus` error kept the button disabled (as 
diagnosed in the issue thread via `checkIsApplyDisabled` → 
`checkIsValidateError`).
   
   This was fixed by #36927 (merged 2026-01-19), which taught 
`FilterBar.handleFilterSelectionChange` to auto-apply a filter whose applied 
state has a default value but an empty `extraFormData`: as soon as the filter 
control finishes loading and emits the dataMask derived from the default, 
FilterBar dispatches `updateDataMask` itself instead of waiting for a manual 
Apply.
   
   This PR adds a regression test that encodes the exact scenario from the 
issue's repro and passes on current `master`, proving the issue is fixed:
   
   - a **required** native select filter (`enableEmptyFilter: true`) with a 
**default value** whose `extraFormData` has not been derived yet (the state 
right after a dashboard loads), plus a second **untouched** filter
   - asserts FilterBar auto-dispatches `updateDataMask` for the required filter 
with the derived `extraFormData` (`{ filters: [{ col: 'region', op: 'IN', val: 
['East'] }] }`) and the default value
   - asserts no dispatch happens for the untouched filter — the user never has 
to touch it
   - asserts the Apply button ends up with nothing pending (the default is 
already applied, not held hostage behind a disabled Apply)
   
   No production code is changed.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A (test only)
   
   ### TESTING INSTRUCTIONS
   
   ```bash
   cd superset-frontend
   npm run test -- 
src/dashboard/components/nativeFilters/FilterBar/FilterBar.test.tsx 
--maxWorkers=2
   ```
   
   All 27 tests in the file pass, including the new `required filter with a 
default value auto-applies on load without touching other filters`.
   
   ### ADDITIONAL INFORMATION
   
   - [x] Has associated issue: closes #34617 (fixed by #36927; this adds the 
missing regression coverage)
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to