BE: Work Items - Ability to reorder work items in the Child Items widget
Problem to solve
The order in which records appear in the child widget is important because it can represents the sequence in which they should be worked on.
Proposal
Allow users to re-order (drag and drop) child records in the child items widget. Noting that users should be able to reparent child items through drag and drop similar to the epic child feature.
Acceptance Criteria
Tasks within work items
-
Move an existing task to the top of the list -
Move an existing task to the bottom of the list -
Move an existing task to the middle of the list -
Move an existing task to another work item and set a manual position -
Every newly created task is added to the bottom of the hierarchy
Hierarchy Widget for any work item type
-
Move an existing child to the top of the Hierarchy -
Move an existing child to the bottom of the Hierarchy -
Move an existing child to the middle of the Hierarchy -
Move an existing child to another Hierarchy and set a manual position -
Every newly created work item is added to the bottom of the hierarchy
Please prepare Work Item Hierarchy Widget backend to mimic the current experience found in Epics when dragging and dropping records.
Tech design
- Add
adjacentWorkItemIdandrelativePosition(with possible values beingBEFORE,AFTER) fields to Types::WorkItems::Widgets::HierarchyUpdateInputType - Types::WorkItems::Widgets::HierarchyCreateInputType should handle default behavior: newly created work item is added to the bottom of the hierarchy.
- handle error cases:
Relative position is not valid.Relative position cannot be combined with childrenIds.The adjacent work item\'s parent must match the new parent work item.The adjacent work item\'s parent must match the current parent work item.
- It can be helpful for inspiration to look at the way that
Reordermutation works and usesEpicTreeNodeInputTypestructure. - Please, keep in mind:
- Inside
LooksAhead#apply_lookaheadwe use preload . It allows preloading of its args, in the same way, that includes does and accepts associations but not scopes. - RelativePositioning concern and respective relative positioning shared examples may be a great option to move forward
- Complex order configuration for keyset pagination is probably needed.
- WorkItems::ParentLinks::CreateService inherits from IssuableLinks::CreateService and some methods there may require attention.
- In Work items positioning within children field in... (#367525 - closed) ordering by
created_athad been introduced. Until manual reordering in used by frontend code, we should usework_itemscreated_atvalue to setrelative_positionvalues for all existingwork_item_parent_linksrecords.
- Inside
Information to note
Per this comment for manual reordering these children need to support relative positioning.
We have the DB column relative_position needed for this feature but it doesn't include RelativePositioning yet.
This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.
