Skip to content

Fix console error on Task and Key result

Rajan Mistry requested to merge fix-console-error-on-task-kr into master

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:

  1. 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:

  1. Login with any user
  2. Go to any Project > Issues > List
  3. Create an new Objective under New issue split button
  4. Go to Objective detail page
  5. Add a Key result in Child items
  6. 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.

Merge request reports