feat(dashboard): add column allowlist to Group By native filter - #43736
feat(dashboard): add column allowlist to Group By native filter#43736eschutho wants to merge 4 commits into
Conversation
…19327] Let dashboard builders curate which columns viewers may group by in a Dynamic Group By native filter (chart_customization_dynamic_groupby). - Add a multi-select "Groupable columns" control to the filter's config panel (reusing ColumnSelect in mode="multiple"), stored in the customization's controlValues.columnsAllowlist. - Respect the allowlist in the viewer (GroupByFilterCard): only allowed columns are offered. An unset or empty allowlist means no restriction, so existing filters behave exactly as before (backwards compatible). - The allowlist rides along in controlValues, so it survives save/reload and dashboard export/import with no backend changes. - Clear the allowlist when the builder changes the dataset to avoid stale, dataset-specific column entries. - Add unit/RTL tests for the filtering helper, the viewer rendering, the config-form control, and controlValues persistence. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Code Review Agent Run #3d365cActionable Suggestions - 0Additional Suggestions - 2
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #43736 +/- ##
==========================================
+ Coverage 79.26% 79.29% +0.02%
==========================================
Files 2888 2888
Lines 166456 166489 +33
Branches 38532 38544 +12
==========================================
+ Hits 131938 132014 +76
+ Misses 32030 31987 -43
Partials 2488 2488
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…nfig [sc-119327] Wrap the new "Groupable columns" allowlist Form.Item in the same StyledRowContainer used by the Datasource control directly above it, so it inherits the standard padded container (sizeUnit * 4) and its left edge lines up with the sibling sections instead of stretching toward the panel edge. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…[sc-119327] Seed a newly created Dynamic Group By display control's "Groupable columns" allowlist with every groupable column of the chosen dataset, so it defaults to "all selected" and builders deselect to restrict. - Add an onColumnsLoaded callback to ColumnSelect that reports the exact column names backing the rendered options (already narrowed by filterValues), so the seeded default matches the available options. - In FiltersConfigForm, seed controlValues.columnsAllowlist from that callback, but only when no allowlist is set yet. An existing selection, including a deliberately narrowed or emptied one, is never overwritten, so editing a configured control is untouched. Seeding does not mark the form changed, so editing a legacy control that never stored an allowlist stays a no-op unless the builder narrows the selection. - On dataset switch, keep clearing the allowlist to undefined so the seeding effect re-seeds all columns of the new dataset (dropping stale, dataset-specific entries). - Viewer semantics are unchanged: an unset/empty allowlist still means "no restriction", preserving backwards compatibility. - Add config-form tests for the new-control seed and the no-overwrite edit cases; existing viewer tests already cover empty/unset = no restriction. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Code Review Agent Run #6f4af7Actionable Suggestions - 0Additional Suggestions - 1
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
…[sc-119327] Relocate the "Groupable columns" control from the top Settings area (under Datasource) into the collapsible "Display control configuration" section, above the Sort display control values checkbox. Drop the StyledRowContainer wrapper so it aligns with the section's other items (e.g. dependencies, Sort type) via StyledRowFormItem. Pure reposition/restyle; the create-time seeding, no-clobber-on-edit rule, dataset-switch re-seed, and viewer empty=no-restriction behavior are unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Code Review Agent Run #571669Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
SUMMARY
Dashboard builders can configure a Group By native filter (the Dynamic Group By chart customization,
chart_customization_dynamic_groupby), but until now viewers could group by any groupable column of the underlying dataset. This PR lets the builder curate an allowlist of columns that viewers are allowed to group by.Tracking: Shortcut sc-119327
What changed
FiltersConfigForm.tsx): adds a multi-select "Groupable columns" control for the Group By filter, reusing the existingColumnSelectinmode="multiple". The selection is the allowlist. It renders only for the Dynamic Group By customization and only once a dataset is chosen. Changing the dataset clears the allowlist so it can't hold stale, dataset-specific column names.controlValues.columnsAllowlist.controlValuesis already serialized with the customization, so the allowlist survives save/reload and dashboard export/import with no backend changes.GroupByFilterCard.tsx): filters the offered column options through the allowlist via a small pure helperapplyColumnAllowlist.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
sc-119327-groupby-allowlist-demo.webm
TESTING INSTRUCTIONS
Automated (frontend):
Covers: the filtering helper (allowlist unset/empty → all columns; non-empty → only allowlisted, ignoring non-existent entries), the viewer only rendering allowlisted options (and all options when unconfigured), the config-form control rendering and reading back its persisted value, and
controlValues.columnsAllowlistsurviving the save transform.Manual:
ADDITIONAL INFORMATION