sadpandajoe opened a new pull request, #38054:
URL: https://github.com/apache/superset/pull/38054
### SUMMARY
When editing an existing report with saved dashboard filters, the filter
dropdown shows raw native filter IDs (e.g.,
`NATIVE_FILTER-HX2lV--YaAZRQfJ_yfYB2`) instead of friendly names (e.g.,
"Country").
**Root cause:** Race condition between two useEffect hooks in
`AlertReportModal.tsx`:
1. The resource useEffect sets `nativeFilterData` (with `nativeFilterId` +
`filterName`) synchronously from saved data
2. The dashboard tabs useEffect fetches `/api/v1/dashboard/{id}/tabs`
asynchronously and populates `nativeFilterOptions` (with `{value, label}` pairs)
3. The `Select` component renders with `value={nativeFilterId}` but
`options` is still empty — so it can't match the ID to a label and displays the
raw ID
**Fix:** Seed `nativeFilterOptions` from the saved `filterName` values in
the resource useEffect, so the Select has matching options immediately. When
the dashboard tabs API responds later, it overwrites with the full filter list.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
| Before | After |
|--------|-------|
| Filter dropdowns show raw `NATIVE_FILTER-*` IDs | Filter dropdowns show
friendly names ("Country", "State") |
<!-- Drag-drop the screenshots from pr-screenshots/ directory:
- before: pr-screenshots/before-raw-filter-ids.png
- after: pr-screenshots/after-filter-names-scrolled.png
-->
### TESTING INSTRUCTIONS
1. Create a report with dashboard filters (select a dashboard with native
filters, add filter rows with values)
2. Save the report
3. Re-open the report in edit mode
4. Expand "Report contents" section
5. Verify filter dropdowns show friendly names (e.g., "Country") instead of
raw IDs (e.g., `NATIVE_FILTER-HX2lV--YaAZRQfJ_yfYB2`)
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [x] Required feature flags: `ALERT_REPORTS_FILTER`, `ALERT_REPORT_TABS`
- [x] 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]