Support setting ancestor in work items parent widget
What does this MR do and why?
Parent widget for work items currently gets items only related to the project. This MR adds ability to also get items from ancestor group to be set as Parent of work items.
Currently, we are allowing following parent-child relationship as per &6286
Type | Can be parent of | Can be child of |
---|---|---|
Epic | Epic | Epic |
Issue | Task | Epic |
Task | None | Issue |
Objective | Objective | Objective |
Key result | None | Objective |
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Add parent to any work item as per above table
Type | Detail page | Drawer |
---|---|---|
Issue | Screen Recording 2024-05-28 at 7.29.12 PM.mov | Screen Recording 2024-05-28 at 7.37.17 PM.mov |
Epic/Objective/Key result/Task | Screen Recording 2024-05-28 at 7.28.19 PM.mov | Screen Recording 2024-05-28 at 7.38.41 PM.mov |
How to set up and validate locally
Prerequisites:
- Enable the OKRs feature as mentioned in the OKRs docs (e.g.
Feature.enabled?(:okrs_mvc, Project.find(<PROJECT_ID>))
and the namespace must have Ultimate plan). - Enable issue list drawer
Feature.enable(:issues_list_drawer)
- Enable Epics on group items
Feature.enable(:namespace_level_work_items)
- To list epic work items on Issues
Feature.enable(:display_work_item_epic_issue_sidebar)
- (Optional) To edit legacy epics as work items
Feature.disable(:make_synced_work_item_read_only)
Data creation:
-
To test further create a structure like below
-
Add few Epics to Group A and Group B
-
Create few Objectives/Issues in Project A and Project B
Steps to verify Parent widget on Epics:
- Login with user A
- Go to Group B > Epics > List
- Create a new Epic
- Click on the Epic
- Check
Parent
widget in drawer - It should list Epics from Group A and not Group C
- Go to Epic detail page
- Go to
Parent
widget in the sidebar - It should also list the same
Steps to verify Parent widget on Issues:
- Login with user A
- Go to Project A > Issues > List
- Create a new Issue
- Click on the issue
- Check
Parent
widget in drawer - It should list Epics from Group B and Group A
- Go to Issue detail page
- Go to
Epic
widget in the sidebar and clickEdit
- It should also list Epics from Group B and Group A
- Repeat the steps for Project B
- It should list Epics from Group A only
Steps to verify Parent widget on Task:
- Login with the same user
- Go to Project A > Issues > List
- Go to the Issue detail page
- Create a Task under Child items
- Click on task to open it in a modal
- Check
Parent
widget - It should show the issue as a Parent and list other Issues from Project A
Steps to verify Parent widget on Objective/Key result:
- Login with any user
- Go to Project A > Issues > List
- Create an new Objective under
New Issue
split button - Click on the Objective
- Check
Parent
widget in the drawer - It should list Objectives from Project A
- Go to Objective/Key result detail page
- Check
Parent
widget in the sidebar - It should also list the same
Related to #430141 (closed)