jesperct opened a new pull request, #40220:
URL: https://github.com/apache/superset/pull/40220
### SUMMARY
The Dynamic Group By customization showed a "Sort display control values"
option that exposed a **Sort Metric** dropdown. That setting only reordered the
host chart's query (`order_by_cols`) and never affected the control's own
option list — the displayed values were fetched unordered and never sorted, so
the sort UI did nothing visible to the control.
This change:
- Hides the Sort Metric dropdown for chart customizations (it has no meaning
for a list of column options).
- Sorts the control's option list by label, ascending or descending, based
on the existing Sort ascending/descending toggle — mirroring the behavior
already used by the Time Grain customization (`propertyComparator('label')` +
`sortComparator`).
- Drops the `sortAscending: true` default so that, when sorting is not
enabled, the source order is preserved (consistent with the Time Grain
customization).
Result: enabling "Sort display control values" now sorts the displayed
values A–Z / Z–A as expected, with no metric involved.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A — control behavior change; covered by unit tests.
### TESTING INSTRUCTIONS
1. Add a Dynamic Group By customization to a chart on a dashboard, pointing
at a column with several values.
2. Open the customization config and enable "Sort display control values".
3. Confirm there is no "Sort Metric" dropdown, only Sort ascending / Sort
descending.
4. Open the control on the dashboard and confirm the options are sorted A–Z
(ascending) and Z–A (descending), and that disabling the option restores the
source order.
Unit tests:
`superset-frontend/src/chartCustomizations/components/DynamicGroupBy/DynamicGroupByPlugin.test.tsx`.
### 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
- [x] 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]