Loading
Fix work item features path bugs on boards and linked items
What does this MR do and why?
Fixes three frontend bugs on the features path that surfaced when work_item_features_field was defaulted to on. This lets !253548 (merged) only flip the flag.
- Board cards don't update after editing in the drawer:
mapWorkItemWidgetsToIssuableFieldsonly looked values up inwidgets, but the drawer's work item carries them underfeatures. We now readworkItem.features[camelCase(widgetType)]first and fall back towidgets. - The blocked-by popover on board cards shows no title:
work_items_linked_items_slim.query.graphqlselectstitleHtmlin thewidgetsbranch but not in thefeaturesbranch. We addtitleHtmlto thefeaturesbranch. - Removing a linked item from an epic leaves it in the list: the
WorkItem.widgetsmerge policy returned the existingLINKED_ITEMSwidget whenever the incoming one had nolinkedItems, which dropped incomingblockedByCountandblockingCount. TheworkItemLinkedItemsquery then became incomplete, soreadQueryreturned null and the cache update was skipped. We now shallow merge{ ...existingWidget, ...incomingWidget }, which keepslinkedItemsand picks up the counts.
Jest coverage is added in spec/frontend/work_items/list/utils_spec.js and spec/frontend/graphql_shared/issuable_client_spec.js.
References
- Blocked MR: !253548 (merged)
- Failing pipeline: https://gitlab.com/gitlab-org/gitlab/-/pipelines/2915060898
- Rollout issue: #587972 (closed)
- Epic: gitlab-org#20609
Screenshots or screen recordings
Both recordings show, in order: editing weight and a label from the board drawer, hovering the blocked-by icon on a board card, and linking then removing an epic's linked item.
| Before | After |
|---|---|
How to set up and validate locally
- In a Rails console, enable the feature flag:
Feature.enable(:work_item_features_field) - On a project issue board, open a card and change the weight and labels in the drawer. Confirm the card updates without a reload.
- Create a "blocks" link between two issues on the board, then hover the blocked-by icon on the blocked card. Confirm the blocker's title shows.
- On a group epic, link another epic via search by title, then remove it. Confirm it disappears from Linked items.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.