84749[BUGFIX] Properly handle checkbox state changes in FormEngine
Commit message
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
- Build/Sources/TypeScript/backend/form-engine/element/select-check-box-element.ts2+19 −11
- Build/Sources/TypeScript/backend/multi-record-selection.ts+5 −2
- typo3/sysext/backend/Classes/Form/Element/SelectCheckBoxElement.php+3 −3
- typo3/sysext/backend/Resources/Public/JavaScript/form-engine/element/select-check-box-element.js+1 −1
- typo3/sysext/backend/Resources/Public/JavaScript/multi-record-selection.js+1 −1
Review log 1420
-
Oli Bartsch uploaded patch set 1 06/18/24, 08:42
-
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
-
Oli Bartsch uploaded patch set 2
V +106/18/24, 15:09 -
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
-
Oli Bartsch uploaded patch set 3
V -106/18/24, 15:28 -
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
-
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:49This 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`? -
Oli Bartsch uploaded patch set 4
V +106/19/24, 08:57 -
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
-
Oli Bartsch updated the commit message in patch set 5
V +106/19/24, 09:04 -
Oli Bartsch commented on patch set 5 06/19/24, 09:05
select-check-box-element.ts:49ReplyActually 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. -
Ayke Halder commented on patch set 5 CR +1 V +1 06/19/24, 09:08
Perfect! -
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? -
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
-
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 -
Ayke Halder voted on patch set 5 V +1 06/19/24, 09:21
-
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
-
Stefan Bürk voted on patch set 5 CR +1 V +1 06/21/24, 10:05
-
Oli Bartsch voted on patch set 5 CR +2 V +2 06/21/24, 11:44
-
Oli Bartsch merged patch set 6 06/21/24, 11:44