Fix console error on Task and Key result
What does this MR do and why?
After the changes in !156836 (merged), there are console errors from work_item_tree
component when a Task or Key result is loaded. Task or Key result do not support children
in WorkItemWidgetHierarchy
widget but they do support parent
and ancestor
fields. So, just checking if WorkItemWidgetHierarchy
is present or not is not sufficient. To resolve that, it needs to be checked whether a particular work item support children or not using WorkItemWidgetDefinitionHierarchy query.
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
No visual changes.
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).
Steps to verify:
- Login with any user
- Go to any Project > Issues > List
- Create an new Objective under New issue split button
- Go to Objective detail page
- Add a Key result in Child items
- Open the Key result and verify there are no errors in console.
Similarly, create a Task under an Issue and verify if there are no browser console errors.