Skip to content

Ability to remove parent/child link in hierarchy widget

Rajat Jain requested to merge 362861-remove-link into master

What does this MR do and why?

This MR adds remove actions under a 3 dot menu in work item links on the issue page. The remove button unlinks the parent/child relationship

Screenshots or screen recordings

Dropdown Toast
a b

How to set up and validate locally

  1. Enable the feature flags.
Feature.enable(:work_items)
Feature.enable(:work_items_hierarchy)
  1. Create a new issue

Run Issue.last in the console and note the Issue id eg. #<Issue id:316 ...>. Here ID is 316.

  1. Edit the description, and add a few task items using the "Convert to work item" button. After each successful creation, run Issue.last and keep note of the id.
  2. Run this command in console to create parent/child relationship WorkItems::ParentLink.create!(work_item_id: CHILD_ID, work_item_parent_id: 316)
  3. Reload and see the child items listed.
  4. Click on the ellipsis (3 dot menu) on the right hand side and click remove.
  5. Notice the work item is removed. Click undo on the toast to add back to the list.

Related to #362861 (closed)

Edited by Rajat Jain

Merge request reports