Skip to content

Move addon related data to GraphQL

Vamsi Vempati requested to merge 346620-move-addon-data-to-graphql into master

What does this MR do and why?

Moves add on related data listed below (currently in presentation layer) to GraphQL. isAddon is the only field that's used from the app component with this code change, the remaining fields will be used from the app component in subsequent MRs.

hasExpiration
isAddon
label
productUnit
quantityPerPack

Tests have been added for the addon app component for both CI minutes and Storage in a previous MR to make sure the refactor doesn't break the app.

Screenshots or screen recordings

isAddon is being used as a query param for purchase confirmation API, I've verified the new values are being passes in the same manner as before:

Addon Before After
CI Minutes CI_Minutes_-_before CI_Minutes_-_after
Storage Storage_-_before Screen_Shot_2022-01-17_at_4.38.24_PM

The UI is unchanged and is exactly the same as before.

How to set up and validate locally

To verify the flow for isAddon change:

  1. Go to Usage Quotas for a group that you own
  2. Go to Storage tab and click on Purchase more storage
  3. Finish the flow (with Preserve log in dev tools enabled)
  4. On Confirming a purchase, check subscriptions API payload

Test suite that's affected by this change is ee/spec/frontend/subscriptions/buy_addons_shared/app_spec.js

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #346620 (closed)

Edited by Vamsi Vempati

Merge request reports