charliefrantowski opened a new pull request, #45935:
URL: https://github.com/apache/superset/pull/45935
### SUMMARY
Fixes #45934.
`FilterBar` treated any truthy `requiredFirst` as on. Stored dashboard
metadata can hold a non-boolean value such as `{}`, so the filter applied the
user's first pick before Apply. `DashboardBuilder/state.ts` and
`FilterValue.tsx` already compare with `=== true`. This adds a small
`isRequiredFirst` helper in `FilterBar/utils.ts` and uses it in the
first-initialization check.
Two other truthy reads remain (`FilterBar/state.ts`, `FilterControls.tsx`).
I left them unchanged to keep this PR small and can align them here if
reviewers prefer.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A (behavior change; see testing instructions)
### TESTING INSTRUCTIONS
- `npx jest src/dashboard/components/nativeFilters/FilterBar/utils.test.ts`
(41 pass; the new test fails against the old truthy check).
- Manual: set a filter's `"requiredFirst": {}` in the dashboard JSON
metadata, reload, and pick a value. Before: it applies at once. After: it waits
for Apply.
### ADDITIONAL INFORMATION
- [x] Has associated issue: Fixes #45934
- [ ] 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-by: 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]