fix: Seed a widget type for every new work item feature

What does this MR do and why?

Sixteen features in getNewWorkItemSharedCache took their widget type only from the widget-definition spread. When a work item type has no definition for one of them, the spread contributed nothing and the seeded object had no type, which the WorkItemFeatures fragment selects. The create form then could not read the seed in full and refetched or rendered blank.

This sets type explicitly on those features, matching the ones already patched after earlier production incidents.

Changelog: fixed Closes #629890

Before / After

Before: For a work item type whose widget definitions omit a feature, the new-work-item cache seeded that feature without a type. The WorkItemFeatures fragment selects type, so the create form's read missed and it refetched or rendered blank.

After: Every seeded feature sets its type explicitly, so the create form reads the full seed from the cache without a refetch or a blank render.

How to set up and validate locally

  1. Run the updated spec:
    yarn jest spec/frontend/work_items/graphql/cache_utils_spec.js
  2. Or in the UI: open the new work item form for a type whose definitions omit some widgets and confirm it renders fully without a flash or refetch.

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.

Related to #629890

Edited by Jeston Singh

Merge request reports

Loading
Loading