gabotorresruiz opened a new pull request, #43802:
URL: https://github.com/apache/superset/pull/43802
### SUMMARY
Time Grain is an aggregate only concept, and `buildQuery` already ignores it
outside aggregate mode, but the control kept rendering in **Raw Records**. Its
visibility check in both table control panels only asked whether a temporal
column was picked as a dimension:
```ts
visibility: ({ controls }) => {
const dttmLookup = ...; // does any `groupby` selection resolve to a
temporal column?
}
```
`groupby` survives a switch to raw records, in the control state and in a
saved chart's form data alike, so the combobox reappeared under a "Raw records"
query mode, both right after the switch and after reloading a chart saved that
way. Every other aggregate only control in the same panels (`metrics`,
`percent_metrics`, `timeseries_limit_metric`, `show_totals`, the groupby
control itself) already gates on `isAggMode`.
This gates the check on the query mode first, matching those siblings. The
control still behaves exactly as before in aggregate mode.
The same panel exists in two plugins, `plugin-chart-table` and
`plugin-chart-ag-grid-table`, and both had the identical predicate, so both are
fixed.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before, on a chart with a temporal dimension and query mode set to Raw
records, the Time Grain combobox renders alongside the "Raw records" radio.
After, it is gone, while aggregate mode is unchanged.
### TESTING INSTRUCTIONS
1. Create a Table chart on a dataset with a temporal column (for example
`birth_names`).
2. In **Aggregate** mode, add the temporal column as a dimension and set a
**Time Grain** (for example Month). Save.
3. Switch **Query mode** to **Raw records**. Save.
4. Hard reload the Explore page.
5. The Time Grain control is not rendered. On master it reappears after the
reload. Switching back to Aggregate shows it again.
6. Unit coverage:
```bash
npx jest plugins/plugin-chart-table/test/controlPanel.test.ts
plugins/plugin-chart-ag-grid-table/test/controlPanel.test.ts
```
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [x] Changes UI
- [ ] Includes DB Migration (follow approval process in
[SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
--
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]