Only include the duo pro widget data if ultimate trial is absent
What does this MR do and why?
Only include the duo pro widget data if ultimate trial is absent
- Since currently the data attributes are flattened and provided
to
app/assets/javascripts/super_sidebar/super_sidebar_bundle.js
using the same named attributes, we can only provide one of these. These will only collide when there is an ultimate trial with a duo pro trial. For now we've decided to only show the ultimate trial widget until we create a combined one so this change is ok. Longer-term, in a follow-up, we should group these attributes for each in a unique object in javascript side so that they can both be provided to the view layer and it can figure out which to show and what to do with that data. - See #461954 (closed)
Changelog: fixed EE: true
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
Before | After |
---|---|
How to set up and validate locally
- 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)
- Visit the group page and verify widget seen.
- Now go back to the admin panel and edit that group to be on the Ultimate trial plan.
- 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)
- Visit the group page and verify ONLY the ultimate trial widget is seen and popover works when hovering.
Related to #457265
Edited by Doug Stull