Project

General

Profile

Actions

Feature #102337

open

Make columnsToRender in RecordListDownloadController changable

Added by Henrik Ziegenhain 6 months ago. Updated 2 days ago.

Status:
Under Review
Priority:
Should have
Assignee:
-
Category:
Backend API
Start date:
2023-11-07
Due date:
% Done:

0%

Estimated time:
PHP Version:
8.2
Tags:
Complexity:
Sprint Focus:

Description

This is a Feature-Request.

For e.g. custom csv-download requests it would be really nice to use existing core functionality.
The download settings modal is a very handy and user-friendly feature to download the currently displayed or even all columns.

It would be even more cool if one could hook into this, to change the "columnsToRender".

Short description of our task:
We created a new backend module to offer different data export possibilities.
One downloads should include the fields "a,b,c" from my table and the other the fields "d,e,f".
A click on the download link opens the known download settings modal from list view to set a filename, choose export format and may make some settings changes.
After click on "download", guess what, the download starts. This has the same look and feel as in list view.


Files

Actions #1

Updated by Garvin Hicking 6 months ago

I wonder if that could be an extension to the 'ctrl' array of the TCA of any table.

Different presets could be configured:

[
  'downloadPresets' => [
      'personalData' => ['first_name','last_name','city','zip','email']
      'interests'    => ['profile','bio','hobby'],
      'meta'         => ['uid', 'importID', 'last_login']
  ]
]

Then the popup could offer a checkable list of all presets, so the user could check either one or multiple of these presets.

If fields occur in multiple presets, they would be collapsed into only being used once.

Extensions could then both override core/foreign/third-party presets.

Combined with UserTSConfig maybe even user-specific presets could be implemented, if those also get evaluated for presets.

(Ideally we'd add proper events to populate/evaluate the RecordDownloadSettings Fluid template, and evaluate them in the action, so additional customization can be achieved by adding other things and not just presets, like: custom filters, record transformations, additional download formats, ...)

What do you think? It's a larger scope, but I'd be pretty interested in implementing this.

Actions #2

Updated by Benni Mack 6 months ago

I would recommend to not extend TCA for such a specific feature, but rather use TSconfig to customize this functionality.

Why? TCA is loaded on every every request (frontend, BE Ajax), and we do not need this. There are certain things we can put into TCA, but I'd say not this.

Actions #3

Updated by Garvin Hicking 6 months ago

Understood. I've got to check if I can access TSconfig within the Controller populating the modal as well as the actual download request (TCA would be accessible easily due to reasons you mentioned).

Actions #4

Updated by Henrik Ziegenhain 6 months ago

Thanks for your comments.

The much bigger approach of Galvin to combine TsConfig with some presets and a Hook to manipulte the settings by PHP would indeed be very smart.
Maybe we could join forces. I also could offer some help.

Actions #5

Updated by Gerrit Code Review 30 days ago

  • Status changed from New to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/83713

Actions #6

Updated by Garvin Hicking 30 days ago

It took some time, but here's a first implementation:

https://review.typo3.org/c/Packages/TYPO3.CMS/+/83713

See the screenshot how the modal is enhanced. Configuration done via TSConfig:

mod.web_list.recordListDownloadPresets {
    pages {
        10 {
            label = Test-Preset-1
            columns = uid, title, crdate, slug, bodytext
        }

        20 {
            label = Test-Preset-2
            columns = uid, title, slug
        }
    }
}

Actions #7

Updated by Gerrit Code Review 25 days ago

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/83713

Actions #8

Updated by Gerrit Code Review 23 days ago

Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/83713

Actions #10

Updated by Gerrit Code Review 2 days ago

Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/83713

Actions

Also available in: Atom PDF