Only show active ultimate trial widget for trial plans
Currently our logic to show the Ultimate trial widget is such:
-
Active:
-
gitlab_subscription.start_on/gitlab_subscription.expires_on
-
-
Expired within 10 days:
- plan is
freeorpremium gitlab_subscription.expires_on- user hasn't dismissed the widget
- plan is
Problem
We aren't observing the plan name during the active state. This really shouldn't matter as an active trial will have a trial plan. However, cases like Ultimate with Duo Enterprise trial widget still... (#505789 - closed) highlight this gap in our qualifications a bit more(even though this isn't the fix for that issue).
Solution
Add a check when the trial is active for the plan name to be an Ultimate trial(or paid ultimate trial) plan.
See draft in Restrict duo enterprise in-app trials to ultima... (!175126 - merged) - anyone can take this MR over if this issue is unassigned.
We also need to ensure we do a similar check for the duo enterprise only widget in https://gitlab.com/gitlab-org/gitlab/blob/c5b6047f8fc7dd10dff1ec5e1e6c58685e03444b/ee/app/presenters/gitlab_subscriptions/trials/duo_enterprise_status_widget_presenter.rb#L17-17 to check specific plans during the active period to ensure it is only ultimate or ultimate_trial, else we'll show the duo enterprise widget when a namespaces purchases premium during an active ultimate trial. Need to ensure these conditions are accurate for the upgrade state and how they work with this conditional logic