Review main Abandoned

58623[FEATURE] Extend FieldControls to use RequireJS modules

Andreas Kienast CR 0 V 0 Normal +54 −4 updated 10/29/18, 20:21

Commit message

FormEngine's FieldControls are now able to register their own RequireJS
modules. To do so, add the `requireJsModule` array key to the
FieldControl payload.

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 2

Review log 1417

  1. Andreas Kienast uploaded patch set 1 10/13/18, 10:54

  2. TYPO3com voted on patch set 1 V +1 10/13/18, 11:05 Completed build in 10m 45s on Sat, 13 Oct, 01:05 PM Test Summary: 37801 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-29439

  3. Stefan Neufeind voted on patch set 1 CR +1 10/13/18, 11:13

  4. Andreas Kienast rebased onto patch set 2 10/18/18, 13:20

  5. TYPO3com voted on patch set 2 V +1 10/18/18, 13:32 Completed build in 11m 52s on Thu, 18 Oct, 03:32 PM Test Summary: 37801 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-29474

  6. Andreas Kienast uploaded patch set 3 10/18/18, 14:12

  7. TYPO3com voted on patch set 3 V +1 10/18/18, 14:26 Completed build in 14m 04s on Thu, 18 Oct, 04:26 PM Test Summary: 37801 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-29481

  8. Tymoteusz Motylewski commented on patch set 3 10/23/18, 14:49

    Hi can you provide some testing instructions?
  9. Andreas Kienast commented on patch set 3 10/23/18, 16:29

    Sure, you need another patch on top with this. I think testing with https://review.typo3.org/c/58651/ is the easiest one. After applying both patches, head to "styleguide TCA demo" > "elements select" and edit any record. In the tab "selectSingleBox", do any selection and click the "Revert selection" button. Also, you should see in your network tab that typo3/sysext/backend/Resources/Public/JavaScript/FormEngine/FieldControl/ResetSelection.js gets loaded.
  10. Anja Leichsenring voted on patch set 3 V +1 CR +1 10/23/18, 19:56

  11. Stefan Neufeind voted on patch set 3 V +1 CR +1 10/23/18, 21:51

  12. Christian Kuhn commented on patch set 3 CR -1 10/25/18, 20:36

    FieldControl.php:141

    hmmm. at other places, it's possible to init the requirejs with own code. is there a special reason we derive from that standard? mergeChildReturnIntoExistingResult() does the require merging already and single controls have enough information to hand over context on their own if needed. i'd tend to prefer to use that general solution here as well. did i miss something?
  13. Andreas Kienast commented on patch set 3 10/25/18, 20:52

    FieldControl.php:141 Reply

    The basic idea is that each instance of a field control creates a independent instance of the control on JS side. I already do a similar approach in my "Split FormEngine.js" patch, where each fild instance creates an independent JavaScript instance.
  14. Christian Kuhn commented on patch set 3 10/25/18, 21:16

    FieldControl.php:141 Reply

    hmmm. hard coding the init removes freedom on that side, too. maybe you're right, but i'm not fully convinced we should start with that detail at this place: i'd see this patch rather as a task that adds a missing option that is available on all other places. if we want to scope the requirejs better by default, i feel this should be done on a broader level and coordinated better since we should adapt all places then. unsure on how to proceed here.
  15. Andreas Kienast commented on patch set 3 10/26/18, 05:47

    FieldControl.php:141 Reply

    Let's have a call next week, what do you think?
  16. Andreas Kienast abandoned the change 10/29/18, 20:21

    Feature not necessary, FormEngine is already capable of merging the RequireJS modules, if the correct key is used.
  17. Christian Kuhn commented on patch set 3 10/29/18, 20:21

    FieldControl.php:145

    note: this call already takes care that requireJsModules from children are merged and loaded.