Move trial widget container/target id to be frontend concern
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 |
---|---|
![]() |
![]() |
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
- Setup GDK to simulate SaaS
- Create a new top-level group.
- Go to admin panel and edit the group to apply the Ultimate plan.
- 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)
- Visit the group page and verify widget seen.
Ultimate trial widget
- Setup gdk to simulate SaaS - https://docs.gitlab.com/ee/development/ee_features.html#simulate-a-saas-instance and restart GDK
- create a group
- In the gitlab admin UI, edit the group to be on an ultimate trial
- 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)
- Go to group overview page and check super sidebar and ensure status widget appears.
Related to #461479
Edited by Doug Stull