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
decisionLogentry to the seeded cache ingetNewWorkItemSharedCache. - The entry spreads the widget definition when one exists.
- The entry always sets
type: WIDGET_TYPE_DECISION_LOGand__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
- MR that introduced the
decisionLog { type }fragment field: !254045 (merged)
Screenshots or screen recordings
| Master behavior with FF on and off |
|---|
| Before | After |
|---|---|
How to set up and validate locally
- Check out the branch
dg-fix-features-for-decision-log. - Visit the new issue page for a project. For example, open
http://127.0.0.1:3000/<group>/<project>/-/issues/new. - Confirm the form renders.
- Open the browser console. Confirm it has no "Missing field 'type' while writing result" error.
- Run the two Jest spec files with
yarn jest:ee/spec/frontend/work_items/graphql/cache_utils_spec.jsspec/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.