Show ancestors when the work item parent is unassigned and reassigned again
What does this MR do and why?
When a parent is reassigned after unassigning an existing parent, the ancestor widget data becomes blank. The possible root cause to it is receiving null
in response of workItemUpdate
subscription. Currently, we have not found root cause why the workItemUpdated
data is coming as null as per the thread. But we have found a workaround to update the ancestor data whenever the parent is updated on frontend side.
This MR enables parent widget to use updateWorkItem
mutation with ancestor fragment in response. Due to this, not only the parent is updated but also ancestors get updated.
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
Before | After |
---|---|
Screen Recording 2024-09-20 at 5.04.43 PM.mov | Screen Recording 2024-09-20 at 4.51.39 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 Epic work items
Feature.enable(:work_item_epics_rollout)
Feature.enable(:work_item_epics)
Steps to verify at Group level:
- Login with any user
- Go to Group > Epics
- Open or create an Epic
- Set a parent to the Epic
- Clear the parent and verify the ancestor widget is updated
- Reassign a parent and verify the ancestor widget is updated
Steps to verify at Project level:
- Login with any user
- Go to Project > Issues
- Open or create an Objective
- Create a child item or add an existing child item
- Set a parent to the Objective
- Clear the parent and verify the ancestor widget is updated
- Reassign a parent and verify the ancestor widget is updated
Related to #474861 (closed)