Fix weight widget for group level work items
What does this MR do and why?
issue_weights feature availability was checked only against an issues's project. We should check against a group when the issue is directly associated with one
How to set up and validate locally
- Enable the feature flag in Rails console
Feature.enable(:namespace_level_work_items)
- Create a group level work item with the following query at http://127.0.0.1:3000/-/graphql-explorer so you can use it in the next query
mutation { workItemCreate(input: {namespacePath: "flightjs", title: "test group level work item", workItemTypeId: "gid://gitlab/WorkItems::Type/1"}) { errors workItem { id iid } } }
- update the weight on the newly created work item
mutation { workItemUpdate(input: {id: "<gid_from_previous_step>", weightWidget: {weight: 3}}) { errors workItem { workItemType { name } widgets { ... on WorkItemWidgetWeight { weight } } } } }
In the response before this change you will get no weight widget, nor you will see that the value has been updated in the DB using the rails console.
This feature is still behind a feature flag so no changelog required
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #429598 (closed)
Edited by Mario Celi