Improve New Trial flow for edge case scenario
What does this MR do?
See #243911 (closed) for all of the details. The TL;DR of it is that we’re improving a previously cumbersome UX workflow when the user does not have a personal namespace which is eligible for a trial, nor does the user have any groups or none of their groups are eligible for a trial.
This MR also improves the overall UX by using different intro copy for each of the four possible scenarios.
Screenshots
Current UX | Updated UX |
---|---|
![]() |
![]() |
Copy changes
**Current copy:**
You can apply your Trial to your Personal account or create a New Group.
**Copy for each scenario:**
All options are available to the user:
You can apply your trial to a new group, an existing group, or your personal account.
No groups exist or are eligible:
You can apply your trial to a new group or your personal account.
The user’s namespace is ineligible:
You can apply your trial to a new group or an existing group.
Neither the user’s namespace nor any groups are eligible:
Create a new group to start your GitLab Gold trial.
How to test it locally
- Install the GDK
- Spoof the GDK to think it is running on dot-com (this will prompt the “Start a trial” UI elements to show up)
- Edit the
self.com?
method in thelib/gitlab.rb
file (look fordef self.com?
around line 46 or so):def self.com? return true # Check `gl_subdomain?` as well to keep parity with gitlab.com Gitlab.config.gitlab.url == COM_URL || gl_subdomain? end
- Edit the
- Enable the Billing pages & plans (NOTE: This step may not be strictly necessary merely for access to the “Start a Trial” flow, but it could be helpful in the process nonetheless.)
- Boot up the GDK (
gdk start
) and then hop into the Rails console:bin/rails console
- Turn on the
ApplicationSetting
which enables this:ApplicationSetting.first.update_attribute(check_namespace_plan: true)
- Exit the console (
exit
) and restart the rails app process (gdk restart rails
)
- Boot up the GDK (
- Create a few test user accounts: one with groups, one without groups, one with groups where the user’s namespace has already been trialed, and one without groups where the user’s namespace has already been trialed.
- To mark a user’s namespace as trialed:
- Make sure the user actually has a
namespace
and that thatnamespace
has agitlab_subscription
:user.namespace.gitlab_subscription
. If not, create one. - Update that
gitlab_subscription
by setting itstrial_ends_on
andtrial
attributes:gitlab_subscription.update(trial_ends_on: Date.today - 1.day, trial: true)
- Make sure the user actually has a
- To mark a user’s namespace as trialed:
- Log in as each user and navigate to
/-/trials/select
- User with un-trialed namespace & un-trialed groups
- You should see three option groups in the drop-down select (New, Groups, & Users)
- You should see the text “You can apply your trial to your personal account, an existing group, or create a new group.”
- User with un-trialed namespace but no groups (or already trialed groups)
- You should see two option groups in the drop-down select (New & Users)
- You should see the text “You can apply your trial to your personal account or create a new group.”
- User with a trialed namespace & un-trialed groups
- You should see two option groups in the drop-down select (New & Groups)
- You should see the text “You can apply your trial to an existing group or create a new group.”
- User with a trialed namespace & no groups (or already trialed groups)
- You should not see the drop-down select at all
- You should see a text field labeled New Group Name
- You should see the text “Create a group to start your GitLab Gold trial.”
- User with un-trialed namespace & un-trialed groups
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry - [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
- [-] Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
- [-] Label as security and @ mention
@gitlab-com/gl-security/appsec
- [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
- [-] Security reports checked/validated by a reviewer from the AppSec team
Addresses #243911 (closed)