[6.x] Forms 2: Allow choosing which columns to export - #15347
Open
duncanmcclean wants to merge 3 commits into
Open
[6.x] Forms 2: Allow choosing which columns to export#15347duncanmcclean wants to merge 3 commits into
duncanmcclean wants to merge 3 commits into
Conversation
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HrcGLCVm5ViW18SiRMjhU2
…umn picker Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HrcGLCVm5ViW18SiRMjhU2
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HrcGLCVm5ViW18SiRMjhU2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request implements the ability to choose which columns are included when exporting form submissions.
Previously, the export modal let you pick a format and whether to export all or filtered submissions, but every export included every field. Now there's a "Columns" section in the modal, with all fields (plus the date) selected by default and a "Select All" / "Deselect All" toggle.
Column selection lives in the modal, rather than on individual exporters, since it's a property of the request in the same way filtering is. The selected columns are passed to the exporter, which decides how to honour them.
Exporters
The base
Exporterclass gains acolumns()helper which returns the selected column handles in form order, defaulting to every field plusdatewhen nothing has been selected. The built-in CSV and JSON exporters use it, and custom exporters can too.Custom exporters with a fixed schema can opt out of column selection by overriding
supportsColumnSelection()to returnfalse, which hides the "Columns" section when that exporter is chosen.This PR also extracts the export modal into its own
ExportSubmissionsModalcomponent.Before
After