Reintroduce the onboarding popover with fix new issue page for decision log

What does this MR do and why?

This MR reintroduces !254045 (merged) after a revert yesterday with also the fix

The new issue page fails to load. An earlier merged MR added a decisionLog { type } selection to the WorkItemFeatures GraphQL fragment in ee/app/assets/javascripts/work_items/graphql/work_item_features.fragment.graphql.

The new work item create form does not fetch features from the server. It seeds a local Apollo cache entry instead, in getNewWorkItemSharedCache in app/assets/javascripts/work_items/graphql/cache_utils.js. That seeded cache had no decisionLog entry. The widget definition is also absent for work item types that do not support the decision log. Apollo could not satisfy the fragment. It threw the error "Missing field 'type' while writing result".

This MR fixes the root cause.

  • It adds a decisionLog entry to the seeded cache in getNewWorkItemSharedCache.
  • The entry spreads the widget definition when one exists.
  • The entry always sets type: WIDGET_TYPE_DECISION_LOG and __typename: 'WorkItemWidgetDecisionLog'. This keeps the field present even when the work item type has no decision log widget definition.
  • This change copies the pattern already used for agentPlan, which had the same problem before.

References

Screenshots or screen recordings

Master behavior with FF on and off
Before After

How to set up and validate locally

  1. Check out the branch dg-fix-features-for-decision-log.
  2. Visit the new issue page for a project. For example, open http://127.0.0.1:3000/<group>/<project>/-/issues/new.
  3. Confirm the form renders.
  4. Open the browser console. Confirm it has no "Missing field 'type' while writing result" error.
  5. Run the two Jest spec files with yarn jest:
    • ee/spec/frontend/work_items/graphql/cache_utils_spec.js
    • spec/frontend/work_items/graphql/cache_utils_spec.js

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.

Edited by Deepika Guliani

Merge request reports

Loading
Loading