Loading
Pass null instead of false to GlButton target
What does this MR do and why?
The upgrade plan header shows a call-to-action button on the subscription page. On SaaS, it should open in a new tab. The component binds :target="isSaas && '_blank'", which is false on self-managed instances. GlButton and GlLink expect the target prop to be a string or null, not boolean.
The warning is: prop "target". Expected String, got Boolean with value false.
Fix: use a ternary that returns '_blank' on SaaS or null on self-managed. Update the jest spec to expect null instead of false.
Changes made:
ee/app/assets/javascripts/vue_shared/subscription/components/upgrade_plan_header.vueee/spec/frontend/vue_shared/subscription/components/upgrade_plan_header_spec.js
How to set up and validate locally
- Go to Admin area > Subscription on a self-managed instance without a subscription.
- The upgrade CTA should open in the same tab when clicked.
- Check the browser console shows no
[Vue warn]line for this warning.
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.
References
- Addresses one entry of #628901 (browser console error catalogue, section C: Vue warnings)
- Warnings surfaced by !255207 (closed) (feature specs fail on console errors)
- Sibling fixes from the same section: !255388 (merged), !255389 (merged), !255390 (merged), !255391 (closed), !255392 (merged), !255393 (closed), !255394 (merged), !255395 (merged), !255397 (merged), !255398 (merged)
Edited by Miguel Rincon