Review main Merged

67650[TASK] Clean up Drag&Drop Handling in PageTree

Benni Mack CR +2 V +2 Expert +909 −923 updated 02/08/21, 07:36

Commit message

The PageTree components for the navigation area consists of:
* PageTreeElement (container for rendering the navigation area w. toolbar + dragdrop + tree)
* PageTreeToolbar (uses DnD for creating new items)
* PageTree (JS, subclass of SvgTree)
* PageTreeDragDrop

This patch aims to rework the "PageTreeDragDrop" javascript file
by moving separate logic into separate classes (as much as possible)
and into a more stable API, being a first part.

PageTreeDragDrop is a mixed code class currently,
and is now split up in various separate classes:
* DragDropHandler (interface)
* ToolbarDragHandler -> used as the Toolbar Draggable Handler for new pages
* PageTreeNodeDragHandler => used for moving/copying and deleting existing pages/nodes
* PageTreeDragDrop now acts as a simple wrapper for d3-drag but still has some shared state

For Future Reference:
It is still up to decide on how to further decouple the code.

Idea 1: Putting the d3-drag initialization into the right
place and avoiding cross-dependencies. In general "initializeDragForNode"
would also be handled via events, and all options / settings would be
moved into the PageTreeDragDrop class.

Ideally the PageTreeDragDrop contains the status of the
current drag+drop action (position, node etc), so the PageTree
would not know of anything itself.

Idea 2: Another possibility is to use the current "PageTreeDragDrop"
as a generic "TreeDragDropManager" because it does not
contain any Page-Tree specific code anymore, but could be carried
on later-on.

The current change is already a good step as it moves all code
to TypeScript and minimizes injection via constructors (except
for the Tree itself).

Review

  • Code review CR +2 Done
    • Georg Ringer +2
    • Andreas Kienast +1
  • Verified V +2 Done
    • Georg Ringer +2
    • Andreas Kienast +1
    • TYPO3com +1 CI

Issues 1

Files 13

Review log 713

  1. Benni Mack uploaded patch set 1 02/05/21, 14:51

  2. TYPO3com voted on patch set 1 V -1 02/05/21, 14:58 Completed build in 07m 18s on Fri, 5 Feb, 02:58 PM Test Summary: 4 of 32826 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-9298

  3. core-ci voted on patch set 1 V -1 02/05/21, 15:01 Core CI is not happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/415

  4. Benni Mack uploaded patch set 2 02/05/21, 16:09

  5. TYPO3com voted on patch set 2 V -1 02/05/21, 16:18 Completed build in 08m 49s on Fri, 5 Feb, 04:18 PM Test Summary: 4 of 32826 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-9302

  6. core-ci voted on patch set 2 V -1 02/05/21, 16:24 Core CI is not happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/419

  7. Benni Mack uploaded patch set 3 02/05/21, 17:23

  8. TYPO3com voted on patch set 3 V -1 02/05/21, 17:30 Completed build in 07m 36s on Fri, 5 Feb, 05:30 PM Test Summary: 3 of 32826 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-9308

  9. Benni Mack updated the commit message in patch set 4 02/05/21, 19:25

  10. TYPO3com voted on patch set 4 V +1 02/05/21, 19:33 Completed build in 07m 49s on Fri, 5 Feb, 07:33 PM Test Summary: 32585 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-9316

  11. Andreas Kienast voted on patch set 4 V +1 CR +1 02/06/21, 16:22

  12. Georg Ringer voted on patch set 4 V +2 CR +2 02/08/21, 07:36

  13. Georg Ringer merged patch set 5 02/08/21, 07:36