Backport of 'Add usage billing paid tier trial card'

What does this MR do and why?

Related to https://gitlab.com/gitlab-org/customers-gitlab-com/-/work_items/15815

Original merge request !221503 (merged)

This is a backport of Add usage billing paid tier trial card (!221503 - merged) to 18.8 branch as part of the https://gitlab.com/gitlab-org/customers-gitlab-com/-/work_items/15815 special release. This adds a FE for GitLab credits dashboard paid tier trial mode

Note: This is isn't a bug fix but a high priority feature necessary to support the upcoming transcend event. Special approval was given to backport these updated to 18.8.

Screenshots or screen recordings

See original MR

How to set up and validate locally

Either use storybook:

  1. yarn storybook:start
  2. Open relevant story: http://localhost:6006/?path=/story/ee-usage-quotas-usage-billing-app--paid-tier-trial

Or stub the API with a patch:

diff --git a/ee/lib/gitlab_subscriptions/subscription_usage.rb b/ee/lib/gitlab_subscriptions/subscription_usage.rb
index c05b43097e82..2372887798f1 100644
--- a/ee/lib/gitlab_subscriptions/subscription_usage.rb
+++ b/ee/lib/gitlab_subscriptions/subscription_usage.rb
@@ -137,7 +137,7 @@ def subscription_portal_usage_dashboard_url
 
     def paid_tier_trial
       PaidTierTrial.new(
-        is_active: !!usage_metadata.dig(:paidTierTrial, :isActive),
+        is_active: true, # !!usage_metadata.dig(:paidTierTrial, :isActive),
         declarative_policy_subject: self
       )
     end

Or follow Ammar's instructions in https://gitlab.com/gitlab-org/customers-gitlab-com/-/merge_requests/14412#test-steps to add a real trial wallet.

MR acceptance checklist

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

  • This MR is backporting a bug fix, documentation update, or spec fix, previously merged in the default branch.
  • The MR that fixed the bug on the default branch has been deployed to GitLab.com (not applicable for documentation or spec changes).
  • The MR title is descriptive (e.g. "Backport of 'title of default branch MR'"). This is important, since the title will be copied to the patch blog post.
  • Required labels have been applied to this merge request
  • This MR has been approved by a maintainer (only one approval is required).
  • Ensure the e2e:test-on-omnibus-ee job has succeeded, or if it has failed, investigate the failures. If you determine the failures are unrelated, you may proceed. If you need assistance investigating, reach out to a Software Engineer in Test in #s_developer_experience.

Note to the merge request author and maintainer

If you have questions about the patch release process, please:

Edited by Kos Palchyk

Merge request reports

Loading