Skip to content

Move trial widget container/target id to be frontend concern

Doug Stull requested to merge 461479-move-to-frontend-concern into master

What does this MR do and why?

Move trial widget container/target id to be frontend concern

  • should not need to be provided by backend and therefore removed from there and added as a const in frontend.
  • move jest specs to directory matching component.
  • consolidates on one container id for both trial and duo pro trial as only one will show at a time anyway. This also enables us to use the css from here correctly.
  • see #461479

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

no change

Ultimate trial Duo Pro trial
Screenshot_2024-07-23_at_2.47.35_PM Screenshot_2024-07-23_at_2.42.44_PM

How to set up and validate locally

this is also validated in feature specs(ee/spec/features/trials/duo_pro/trial_widget_in_sidebar_spec.rb and ee/spec/features/trials/trial_widget_in_sidebar_spec.rb)

Duo pro trial widget

  1. Setup GDK to simulate SaaS
  2. Create a new top-level group.
  3. Go to admin panel and edit the group to apply the Ultimate plan.
  4. Add a duo pro trial to that namespace in the rails console
n = Namespace.last
add_on = ::GitlabSubscriptions::AddOn.where(name: ::GitlabSubscriptions::AddOn.names[:code_suggestions]).last
::GitlabSubscriptions::AddOnPurchase.create(add_on: add_on, namespace: n, quantity: 1, expires_on: 30.days.from_now, purchase_xid: SecureRandom.hex(16), trial: true, organization_id: 1)
  1. Visit the group page and verify widget seen.

Ultimate trial widget

  1. Setup gdk to simulate SaaS - https://docs.gitlab.com/ee/development/ee_features.html#simulate-a-saas-instance and restart GDK
  2. create a group
  3. In the gitlab admin UI, edit the group to be on an ultimate trial
  4. In rails console, change the trial, trial start and end date for the group
    Group.last.gitlab_subscription.update_columns(trial_starts_on: Date.today, trial_ends_on: 30.days.from_now, trial: true)
  5. Go to group overview page and check super sidebar and ensure status widget appears.

Related to #461479

Edited by Doug Stull

Merge request reports