Review main Merged

84749[BUGFIX] Properly handle checkbox state changes in FormEngine

Oli Bartsch CR +2 V +2 Easy +29 −18 updated 06/21/24, 11:44

Commit message

Using the multi record selection, it's possible
to change the state of checkboxes via multiple
ways, e.g. by clicking on the table row.

The central functionality for changing the
connected checkbox state now also considers
the disabled attribute and therefore only
changes the checked state in case the
checkbox is not disabled.

Additionally, next to the custom event, which
is triggered on checkbox state changes, the
multi record selection now also dispatches
the standard "change" event. FormEngine
validation for example is listening on
this event to mark the field as changed.

The JS component is also migrated to a proper
custom element (web component).

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
    • Stefan Bürk +1
    • Ayke Halder +1
  • Verified V +2 Done
    • Oli Bartsch +2
    • Stefan Bürk +1
    • Ayke Halder +1
    • core-ci +1 CI

Issues 1

Files 5

Review log 1420

  1. Oli Bartsch uploaded patch set 1 06/18/24, 08:42

  2. core-ci voted on patch set 1 V +1 06/18/24, 08:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59784

  3. Oli Bartsch uploaded patch set 2 V +1 06/18/24, 15:09

  4. core-ci voted on patch set 2 V -1 06/18/24, 15:18 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59814

  5. Oli Bartsch uploaded patch set 3 V -1 06/18/24, 15:28

  6. core-ci voted on patch set 3 V +1 06/18/24, 15:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59815

  7. Ayke Halder commented on patch set 3 V +1 06/19/24, 07:02

    This is working! But is there a feasable way to keep functionality inside `MultiRecordSelection` and not add it to `SelectCheckBoxElement`?

    select-check-box-element.ts:49

    This implements functionality into `SelectCheckBoxElement` that is only neccessary for `MultiRecordSelection`. Is there a feasable way to not couple `SelectCheckBoxElement` with `MultiRecordSelection`, and implement this inside `MultiRecordSelection` instead? `form-engine-validation.ts` adds a `change` event listener: ``` // Bind to field changes new RegularEvent('change', (e: Event, target: FormEngineFieldElement): void => { FormEngineValidation.validateField(target); FormEngineValidation.markFieldAsChanged(target); }).delegateTo(formEngineFormElement, FormEngineValidation.rulesSelector); ``` Can we trigger this `change` event for the checkbox from inside `MultiRecordSelection`?
  8. Oli Bartsch uploaded patch set 4 V +1 06/19/24, 08:57

  9. core-ci voted on patch set 4 V +1 06/19/24, 09:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59843

  10. Oli Bartsch updated the commit message in patch set 5 V +1 06/19/24, 09:04

  11. Oli Bartsch commented on patch set 5 06/19/24, 09:05

    select-check-box-element.ts:49 Reply

    Actually it's usually the way to go for components, using multi record selection, to listen to the events, dispatched by the multi record selection. Since `SelectCheckBoxElement` is using `MultiRecordSelection` it would be fine to also implement the corresponding functionality. However, in this case it might be a better idea to let multi record selection also dispatch the usual "change" event on state changes. This will allow to use `MultiRecordSelection` generally in FormEngine without the need to adjust any JS. I integrated it this way now.
  12. Ayke Halder commented on patch set 5 CR +1 V +1 06/19/24, 09:08

    Perfect!
  13. Ayke Halder commented on patch set 5 V -1 06/19/24, 09:11

    Is it now neccessary to replace all occurences of t3js-formengine-field-item with the new web component tag?
  14. core-ci voted on patch set 5 V -1 06/19/24, 09:12 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59844

  15. Oli Bartsch commented on patch set 5 06/19/24, 09:20

    Reply

    I don't understand the question. The mentioned class has nothing to do with the tag. There is no need for any change in this area
  16. Ayke Halder voted on patch set 5 V +1 06/19/24, 09:21

  17. core-ci voted on patch set 5 V +1 06/19/24, 09:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59844

  18. Stefan Bürk voted on patch set 5 CR +1 V +1 06/21/24, 10:05

  19. Oli Bartsch voted on patch set 5 CR +2 V +2 06/21/24, 11:44

  20. Oli Bartsch merged patch set 6 06/21/24, 11:44