mikebridge opened a new pull request, #45832:
URL: https://github.com/apache/superset/pull/45832
### SUMMARY
**TL;DR:** A new chart on a semantic view no longer opens behind the
"re-pick your fields" banner. The banner, which saved charts with older field
names still see, now uses plain wording.
**Background:** Semantic views record which naming format a chart's fields
use (`semantic_selection_version`). When a chart's format is missing or older
than the view's current one, Explore shows a banner asking the user to re-pick
fields, because an old display title can't be safely mapped to a current field
ID.
**Problem:** A brand-new chart has no format recorded yet, so every new
chart on a versioned semantic view opened behind that banner, even though it
had no fields to lose. The banner copy also used internal terms ("member IDs",
"display titles").
**What this changes:**
- When Explore loads a new chart (no saved chart, no hidden form data) whose
incoming form data holds only identity and empty fields, it records the view's
current format before controls and the first query are built. The allowed
fields are `datasource`, `viz_type`, an empty `adhoc_filters`, an empty
`applied_time_extras`, and `url_params` limited to `datasource_id`,
`datasource_type`, `viz_type`, `slice_id` and `form_data_key` (string values).
Anything else, such as a filter, a metric, a column, or a URL parameter that
could name a field, leaves today's behaviour in place.
- Saved charts, datasource switches and the reset action are unchanged, so
legacy charts still get the banner.
- New banner copy:
- Title: "Re-pick fields for this chart"
- Body: "This chart was saved with an older format of field names for this
semantic view, so the fields it refers to can't be confirmed. Re-pick the
metrics and dimensions to keep using it. The saved chart doesn't change until
you save."
- Button: "Re-pick fields"
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before: opening a new chart on a versioned semantic view shows "Choose
current semantic fields" instead of the query controls. After: the controls
show straight away. Saved legacy charts show the banner with the new copy.
### TESTING INSTRUCTIONS
- `npm run test -- src/explore/actions/hydrateExplore.test.ts
src/explore/components/ControlPanelsContainer.test.tsx src/explore/reducers`
- Manually, with `SEMANTIC_LAYERS` on:
1. From the semantic view list, create a new chart. No banner; the chart
query's extras carry the view's selection version.
2. Open a saved chart whose selection version is missing or older. The
banner shows with the new copy and "Re-pick fields" resets the selections.
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [x] Required feature flags: `SEMANTIC_LAYERS`
- [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
No backend, provider or migration change. Saved charts are never upgraded
automatically.
--
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]