Review main Merged

89040[TASK] Add GUI-managed map (keys+values) and list for Configuration

Garvin Hicking CR +2 V +2 Hard +301 −8 updated 05/13/25, 09:28

Commit message

This patch allows to manage PHP arrays with keys and values ("map")
and array with numerical keys and values ("element-list") in the
backend module "Admin Tools > Settings > Configure Installation-Wide
Options".

Currently, array values like GFX.processor_stripColorProfileParameters
contain an input box where array values need to be entered
by maintainers/integrators separated by a comma. This is prone to
errors and visually not appealing.

With this patch, key/value pairs (or just value lists) are shown inside
a table, where each row can be removed or new rows
added. This works both with string-indexed maps and also
numerical indexes.

For this, the type "map" has been created,
and a similar GUI is available for "element-list",
where only array values are maintained. Note that the
type "list" was already utilized for a single input text
with commaseparated values, so the new type needed a
distinct naming.

Some configuration options [1] have been converted from
"array" to "element-list" to showcase this, and a
demo option "GFX.imagefile_defaultProcessing" has been
added (see #93981, see patchsets up to PS11).

This allows for a resulting configuration like:

```
'imagefile_defaultProcessing' = [
  'default' => 'png',
  'jpg'     => 'avif',
  'webp'    => 'avif',
]
```

SCREENSHOTS:

https://www.dropbox.com/scl/fi/t8jcmbmadlzkh48oew2xd/Screenshot-2025-04-11-at-10.32.36.png?rlkey=5asx0y95u0rxqk0dw5y0aejbz&dl=1
https://www.dropbox.com/scl/fi/synvsizzrmnqzmq0iwyt6/Screenshot-2025-04-11-at-10.36.58.png?rlkey=24t7eunq9jtog70njl01vxb9r&dl=1

[1] GFX.processor_stripColorProfileParameters
    SYS.allowedPhpDisableFunctions
    BE.lockRootPath

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Georg Ringer +1
  • Verified V +2 Done
    • Benni Mack +2
    • Georg Ringer +1
    • core-ci +1 CI

Issues 2

Files 5

Review log 3750

Show 1725 earlier messages
  1. Garvin Hicking uploaded patch set 1 04/10/25, 15:58

  2. Garvin Hicking marked it work in progress 04/10/25, 15:59

  3. core-ci voted on patch set 1 V -1 04/10/25, 16:09 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/77444

  4. Markus Klein commented on patch set 1 04/11/25, 06:36

  5. Garvin Hicking commented on patch set 1 04/11/25, 07:01

    Reply

    This is more of a playground / PoC, I'm not expecting this patch to go anywhere. Ideally I'd like to make this a kick-off for an actual patch.
  6. Garvin Hicking uploaded patch set 2 V -1 04/11/25, 08:38

  7. core-ci voted on patch set 2 V -1 04/11/25, 08:45 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/77502

  8. Garvin Hicking uploaded patch set 3 V -1 04/11/25, 08:50

  9. Garvin Hicking uploaded patch set 4 04/11/25, 08:51

  10. core-ci voted on patch set 3 V -1 04/11/25, 08:59 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/77504

  11. core-ci voted on patch set 4 V +1 04/11/25, 09:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/77505

  12. Garvin Hicking uploaded patch set 5 V +1 04/22/25, 20:13

  13. core-ci voted on patch set 5 V +1 04/22/25, 20:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/78038

  14. Garvin Hicking uploaded patch set 6 V +1 04/23/25, 15:18

    scrubbing
  15. core-ci voted on patch set 6 V +1 04/23/25, 15:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/78071

  16. Garvin Hicking marked it ready for review 04/24/25, 12:24

  17. Benni Mack commented on patch set 6 04/24/25, 12:27

    First: Thank you for tackling this. However, I have to say - please do not label this as a feature. Originally this was never meant to be API, especially for integrators and site owners. I would say that the syntax and the options are internal. So, in my opinion this is a regular task - the information about the options should be documented somewhere (contribution guidelines or in PHP or in the DefaultConfiguration.yaml) and then this change can and should go in v13 as well, which makes complete sense to build on this. 2cts on naming: VERY good. Just call it "map" and "list" and we're good.
  18. Garvin Hicking uploaded patch set 7 V +1 04/24/25, 17:18

  19. Garvin Hicking commented on patch set 7 04/24/25, 17:19

    Reply

    Thank you. We settled on "map" (because this is the proper term) and "element-list", because "list" was sadly already taken. I reworked this to be a TASK, and removed the ReST file and instead moved my comments inside a phpdoc block. I'm not too fond of the JavaScript implementation; if anyone sees ways to make this sleeker, please feel free to address this here or with a follow-up.
  20. core-ci voted on patch set 7 V -1 04/24/25, 17:26 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/78139

  21. Garvin Hicking uploaded patch set 8 V -1 04/24/25, 17:36

  22. core-ci voted on patch set 8 V +1 04/24/25, 17:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/78141

  23. Benni Mack commented on patch set 8 04/29/25, 07:50

    DefaultConfigurationDescription.yaml:16

    this somehow does not work for me...
  24. Benni Mack voted on patch set 8 CR -1 04/29/25, 07:50

  25. Garvin Hicking uploaded patch set 9 CR -1 V +1 04/29/25, 08:29

  1. Garvin Hicking uploaded patch set 10 04/29/25, 08:33

  2. core-ci voted on patch set 9 V +1 04/29/25, 08:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/78332

  3. Garvin Hicking uploaded patch set 11 04/29/25, 08:36

  4. core-ci voted on patch set 10 V +1 04/29/25, 08:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/78333

  5. core-ci voted on patch set 11 V +1 04/29/25, 08:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/78334

  6. Garvin Hicking uploaded patch set 12 V +1 04/29/25, 08:59

  7. Garvin Hicking commented on patch set 12 04/29/25, 08:59

    DefaultConfigurationDescription.yaml:16 Reply

    My bad, I made a config option into an array that is an actual string list. Reverted this.
  8. core-ci voted on patch set 12 V +1 04/29/25, 09:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/78335

  9. Maximilian Schell commented on patch set 12 V -1 05/05/25, 21:37

    Could not reproduce it like shown in the screenshots. There is only the value field shown and plus and minus fields also dont work.
  10. Garvin Hicking commented on patch set 12 05/05/25, 23:27

    Reply

    Do you get browser console errors? which config field did you try it with? @maximilian.schell@snk.de
  11. Maximilian Schell commented on patch set 12 05/06/25, 08:42

    Reply

    No console errors on my end. Tried it with processor_stripColorProfileParameters and lockRootPath.
  12. Garvin Hicking commented on patch set 12 05/06/25, 08:47

    Reply

    @maximilian.schell@snk.de Ok - did you flush the browser cache (not typo3 cache), eg shift-reload? Which browser did you test it with? and just to be sure, you enter a value in the field next to the button and then click on the plus next to the row, and then no new row occurs? or does a new row get added and then you save and the values do not get stored? does your settings.php contain any value for these settings yet, or are they missing? does it work after you add dummy values tos ettungs and try again? I'd be happy to rework this but am a bit lost what exactly is (not) happening.
  13. Benni Mack uploaded patch set 13 V +1 05/09/25, 16:57

  14. Benni Mack commented on patch set 13 CR +1 V +1 05/09/25, 16:58

    Reply

    we need to clear the cache, @maximilian.schell@snk.de then it works.
  15. Benni Mack commented on patch set 13 05/09/25, 16:58

    Reply

    Done
  16. Garvin Hicking commented on patch set 13 05/09/25, 17:02

    Reply

    thx so much, also for spotting my leftover <3
  17. core-ci voted on patch set 13 V +1 05/09/25, 17:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/78738

  18. Georg Ringer voted on patch set 13 CR +1 V +1 05/10/25, 08:28

  19. Benni Mack voted on patch set 13 CR +2 V +2 05/10/25, 13:49

  20. Benni Mack merged patch set 14 05/10/25, 13:49

  21. Andreas Kienast commented on patch set 14 05/13/25, 08:24

    Post -1 The usage is a bit weird to me. In my scenario, I have an empty field with the placeholder "(required value)" and a "+" button. I can now enter a value without requiring to click "+", the value is persisted. If I close and re-open the configuration modal, the list is re-rendered with a new empty field below.

    local-configuration.ts:133

    This is specific to the record list!
  22. Andreas Kienast commented on patch set 14 05/13/25, 08:40

    Another things I spotted: * the "list" is in `localconf-item-heading`, but belongs into `localconf-item-body` * since a table is used, the columns are not properly aligned and there's a huge whitespace between the "+" icons and the right-hand border.

    LocalConfigurationValueService.php:132

    Compatibility for what?
  23. Andreas Kienast commented on patch set 14 05/13/25, 08:41

    Reply

    Using an input group would've been the better solution here, IMO.
  24. Garvin Hicking commented on patch set 14 05/13/25, 09:00

    Reply

    That must've broke during the map/list refactoring, I think I had this working. This needs to be fixed I agree.

    Reply Unresolved

    Will need to check out how we handle input groups (probably some bootstrappy construct?), but I think this should be salvageable.

    local-configuration.ts:133 Reply

    Can you elaborate, not sure what you mean?

    LocalConfigurationValueService.php:132 Reply Unresolved

    The "value" and "values" keys arw differently handled, so I adjusted both keys here. I could enhance that comment for clarity.
  25. Andreas Kienast commented on patch set 14 05/13/25, 09:28

    local-configuration.ts:133 Reply Unresolved

    `record-pulse` is a custom animation built exclusively for the record list, it's also defined in _recordlist.scss.