Review main Merged

64243[TASK] Avoid inline JavaScript generated by BackendUtility:viewOnClick

Oliver Hader CR +2 V +2 Expert +829 −193 updated 12/13/20, 10:01

Commit message

Inline JavaScript produced by BackendUtility:viewOnClick is substituted
with markup based instructions and static JavaScript event handlers.

// basically delivers window.open(generatedUri)
BackendUtility::viewOnClick($pageId, $backPath, $rootLine, $section,
    $viewUri, $getVars, $switchFocus);

can be substituted with e.g.

\TYPO3\CMS\Backend\Routing\PreviewUriBuilder::create($pageId, $viewUri)
    ->withRootLine($rootLine)
    ->withSection($section)
    ->withAdditionalQueryParameters($getVars)
    ->serializeDispatcherAttributes([
        PreviewUriBuilder::OPTION_SWITCH_FOCUS => $switchFocus,
    ]);

which results in the following HTML data attributes
(data can be retrieved as array of complete element as well)

data-dispatch-action="TYPO3.WindowManager.localOpen"
data-dispatch-args="["https://...",null,"previewWin"]"

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Andreas Kienast +1
  • Verified V +2 Done
    • Benni Mack +2
    • Andreas Kienast +1
    • TYPO3com +1 CI

Issues 1

Files 35

Show 15 more files

Review log 3756

Show 1931 earlier messages
  1. Oliver Hader uploaded patch set 1 04/18/20, 21:02

  2. Oliver Hader wrote 04/18/20, 21:03

    Topic set to inline-javascript
  3. TYPO3com voted on patch set 1 V -1 04/18/20, 21:03 Completed build in 20s on Sat, 18 Apr, 09:03 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2826

  4. Oliver Hader marked it work in progress 04/18/20, 21:04

  5. Oliver Hader uploaded patch set 2 04/22/20, 09:31

  6. TYPO3com voted on patch set 2 V -1 04/22/20, 09:32 Completed build in 31s on Wed, 22 Apr, 09:32 AM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2976

  7. Oliver Hader uploaded patch set 3 04/22/20, 09:35

  8. Oliver Hader commented on patch set 3 V -1 04/22/20, 09:38

    New page layout stuff fails...
  9. Oliver Hader uploaded patch set 4 04/22/20, 09:43

  10. TYPO3com voted on patch set 3 V -1 04/22/20, 09:44 Completed build in 08m 25s on Wed, 22 Apr, 09:44 AM Test Summary: 186 of 70283 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2978

  11. TYPO3com voted on patch set 4 V -1 04/22/20, 09:47 Completed build in 03m 54s on Wed, 22 Apr, 09:47 AM Test Summary: 52737 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2979

  12. Oliver Hader uploaded patch set 5 04/22/20, 09:50

  13. Oliver Hader commented on patch set 5 04/22/20, 09:50

    This change is ready for review.
  14. TYPO3com voted on patch set 5 V -1 04/22/20, 10:02 Completed build in 11m 55s on Wed, 22 Apr, 10:02 AM Test Summary: 28 of 74141 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2980

  15. TYPO3com commented on patch set 5 04/22/20, 10:15 Completed build in 36m 55s on Wed, 22 Apr, 10:15 AM Test Summary: 27 of 74141 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2980

  16. TYPO3com commented on patch set 5 04/22/20, 11:08 Completed build in 1h 55m 16s on Wed, 22 Apr, 11:08 AM Test Summary: 27 of 74141 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2980

  17. Oliver Hader uploaded patch set 6 04/22/20, 11:39

  18. TYPO3com voted on patch set 6 V +1 04/22/20, 11:50 Completed build in 11m 42s on Wed, 22 Apr, 11:50 AM Test Summary: 73657 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2984

  19. Oliver Hader uploaded patch set 7 04/25/20, 08:43

  20. TYPO3com voted on patch set 7 V +1 04/25/20, 08:57 Completed build in 13m 39s on Sat, 25 Apr, 08:57 AM Test Summary: 73657 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3025

  21. Jonas Eberle commented on patch set 7 V +1 04/26/20, 10:47

    Sweet! I love it.
  22. Oliver Hader commented on patch set 7 CR -1 07/13/20, 11:28

    Requires https://review.typo3.org/c/Packages/TYPO3.CMS/+/64675 to be merged first (since it will be based on that "immediate action" handling)
  23. Oliver Hader uploaded patch set 8 07/15/20, 22:09

  24. TYPO3com voted on patch set 8 V -1 07/15/20, 22:09 Completed build in 29s on Wed, 15 Jul, 10:09 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4106

  25. Oliver Hader uploaded patch set 9 07/15/20, 22:20

  26. TYPO3com voted on patch set 9 V -1 07/15/20, 22:32 Completed build in 12m 00s on Wed, 15 Jul, 10:32 PM Test Summary: 7 of 73432 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4110

  27. Andreas Kienast commented on patch set 9 07/16/20, 06:18

    WindowManager.ts:25

    You may use `windowName: string = 'previewWin'` here
  28. TYPO3com commented on patch set 9 07/16/20, 06:35 Completed build in 8h 26m 40s on Thu, 16 Jul, 06:35 AM Test Summary: 6 of 73432 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4110

  29. Oliver Hader voted on patch set 9 CR -1 07/16/20, 08:19

  30. Oliver Hader uploaded patch set 10 07/16/20, 09:00

  31. Oliver Hader commented on patch set 10 07/16/20, 09:02

    WindowManager.ts:25 Reply Unresolved

    Thx, switched to `newTYPO3frontendWindow` which was the default of `BackendUtility::viewOnClick`
  1. TYPO3com voted on patch set 10 V +1 07/16/20, 09:12 Completed build in 11m 42s on Thu, 16 Jul, 09:12 AM Test Summary: 72951 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4111

  2. Andreas Kienast uploaded patch set 11 07/16/20, 11:21

  3. TYPO3com voted on patch set 11 V +1 07/16/20, 11:33 Completed build in 11m 58s on Thu, 16 Jul, 11:33 AM Test Summary: 72951 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4112

  4. Andreas Kienast voted on patch set 11 V +1 CR +1 07/16/20, 11:49

  5. Oliver Hader voted on patch set 11 CR -1 07/17/20, 14:37

  6. Oliver Hader uploaded patch set 12 07/17/20, 14:39

  7. Oliver Hader commented on patch set 12 07/17/20, 14:40

    Adjusted for nitpick comment in 10.4 branch
  8. TYPO3com voted on patch set 12 V +1 07/17/20, 14:50 Completed build in 11m 40s on Fri, 17 Jul, 02:50 PM Test Summary: 72951 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4134

  9. Andreas Kienast uploaded patch set 13 08/06/20, 08:08

  10. TYPO3com voted on patch set 13 V +1 08/06/20, 08:22 Completed build in 13m 34s on Thu, 6 Aug, 08:22 AM Test Summary: 72963 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4433

  11. Andreas Kienast uploaded patch set 14 08/08/20, 13:46

  12. TYPO3com voted on patch set 14 V +1 08/08/20, 14:13 Completed build in 24m 39s on Sat, 8 Aug, 02:13 PM Test Summary: 72975 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4499

  13. Andreas Kienast voted on patch set 14 V +1 CR +1 08/08/20, 16:03

  14. Oliver Hader uploaded patch set 15 12/03/20, 19:53

  15. TYPO3com voted on patch set 15 V +1 12/03/20, 20:03 Completed build in 09m 24s on Thu, 3 Dec, 08:03 PM Test Summary: 32407 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7767

  16. Andreas Kienast commented on patch set 15 V +1 CR +1 12/04/20, 08:55

    ActionDispatcher.ts:71

    I think we need some kind of a registry than can get extended from the "outside". We get more and more dependencies into this single module which is already loaded in the backend login but cannot be used anyway. However, this can be done later™.

    ImmediateActionElement.ts:38 Unresolved

    My comment in ActionDispatcher.ts applies here as well.

    WindowManager.ts:21

    Would this work as well? public open = this.localOpen;

    Backend.ts:913 Unresolved

    Hooray
  17. Andreas Kienast uploaded patch set 16 12/04/20, 13:55

  18. Andreas Kienast voted on patch set 16 V +1 CR +1 12/04/20, 13:55

  19. TYPO3com voted on patch set 16 V +1 12/04/20, 14:04 Completed build in 08m 53s on Fri, 4 Dec, 02:04 PM Test Summary: 32407 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7785

  20. Oliver Hader commented on patch set 16 12/04/20, 17:05

    ActionDispatcher.ts:71 Reply Unresolved

    Yepp, was at this point as well... we "need" (could have) dependency injection for our "components" as well - in order to change/adjust those constraints in a flexible way (not necessarily with configuration). later™ or tomorrow's-problem™

    WindowManager.ts:21 Reply Unresolved

    Most probably due to scoping of `thisArg` and explicitly not using `this.localOpen.bind(this)` (that's the part I cannot remember in detail anymore)
  21. Benni Mack voted on patch set 16 V +2 CR +2 12/10/20, 11:39

  22. Benni Mack merged patch set 17 12/10/20, 11:39

  23. Markus Klein commented on patch set 17 12/12/20, 09:56

    PageLayoutController.php:755

    regression: this is a string if you use SQLITE.
  24. Markus Klein commented on patch set 17 12/12/20, 10:01

    PageLayoutController.php:755 Reply

  25. Oliver Hader commented on patch set 17 12/13/20, 10:01

    PageLayoutController.php:755 Reply

    Done