Commit d0e5aa9a authored by Dmytro Zaporozhets's avatar Dmytro Zaporozhets

Merge branch '119083-add-glm-params-to-trial-urls' into 'master'

Add glm_ query string parameters to trial URLs

See merge request gitlab-org/gitlab!23857
parents 6d9e73d7 4d93d767
......@@ -7,7 +7,7 @@ module EE
end
def trials_link_url
new_trial_registration_path
new_trial_registration_path(glm_source: 'gitlab.com', glm_content: 'top-right-dropdown')
end
def user_badges_in_admin_section(user)
......
......@@ -3,4 +3,4 @@
- linkFeedback = 'https://gitlab.com/gitlab-org/growth/ui-ux/issues/25'
- linkUpgrade = group_billings_path(@group.root_ancestor)
#js-security-discover-app{ data: { group: { id: @group.id, name: @group.name }, link: { main: new_trial_registration_path, secondary: linkUpgrade, feedback: linkFeedback } } }
#js-security-discover-app{ data: { group: { id: @group.id, name: @group.name }, link: { main: new_trial_registration_path(glm_source: 'gitlab.com', glm_content: 'discover-group-security'), secondary: linkUpgrade, feedback: linkFeedback } } }
......@@ -3,4 +3,4 @@
- linkFeedback = 'https://gitlab.com/gitlab-org/growth/ui-ux/issues/25'
- linkUpgrade = @project.personal? ? profile_billings_path(@project.group) : group_billings_path(@project.root_ancestor)
#js-security-discover-app{ data: { project: { id: @project.id, name: @project.name }, link: { main: new_trial_registration_path, secondary: linkUpgrade, feedback: linkFeedback } } }
#js-security-discover-app{ data: { project: { id: @project.id, name: @project.name }, link: { main: new_trial_registration_path(glm_source: 'gitlab.com', glm_content: 'discover-project-security'), secondary: linkUpgrade, feedback: linkFeedback } } }
......@@ -13,7 +13,7 @@
%p.mb-0
%span= _('Try all GitLab has to offer for 30 days.')
%span.d-none.d-sm-inline= _('No credit card required.')
= link_to _('Start your trial'), new_trial_registration_path, class: "btn btn-primary mt-2 mt-sm-0 #{button_css_class}", target: '_blank'
= link_to _('Start your trial'), new_trial_registration_path(glm_source: 'gitlab.com', glm_content: 'gold-callout'), class: "btn btn-primary mt-2 mt-sm-0 #{button_css_class}", target: '_blank'
- if is_dismissable
%button.btn.btn-default.close.js-close{ type: 'button',
......
- parent_group = local_assigns[:parent_group]
- if namespace_for_user?(namespace)
- namespace_for_user = namespace_for_user?(namespace)
- if namespace_for_user
= render_if_exists 'trials/banner', namespace: namespace
.billing-plan-header.content-block.center
.billing-plan-logo
- if namespace_for_user?(namespace)
- if namespace_for_user
.avatar-container.s96.home-panel-avatar.append-right-default.float-none.mx-auto.mb-4.mt-1
= user_avatar_without_link(user: current_user, class: 'mb-3', size: 96)
- elsif @group.avatar_url.present?
......@@ -15,7 +15,7 @@
= group_icon(@group, class: 'avatar avatar-tile s96', width: 96, height: 96, alt: @group.name)
%h4
- if namespace_for_user?(namespace)
- if namespace_for_user
= s_("BillingPlans|@%{user_name} you are currently using the %{plan_name} plan.").html_safe % { user_name: current_user.username, plan_name: plan.code.titleize }
- else
= s_("BillingPlans|%{group_name} is currently using the %{plan_name} plan.").html_safe % { group_name: namespace.full_name, plan_name: plan.code.titleize }
......@@ -29,4 +29,5 @@
= render 'shared/billings/trial_status', namespace: namespace
- if namespace.eligible_for_trial?
%p= link_to 'Start your free trial', new_trial_registration_path, class: 'btn btn-primary'
- glm_content = namespace_for_user ? 'user-billing' : 'group-billing'
%p= link_to 'Start your free trial', new_trial_registration_path(glm_source: 'gitlab.com', glm_content: glm_content), class: 'btn btn-primary'
......@@ -11,7 +11,8 @@ describe 'Trial Sign In' do
end
it 'logs the user in' do
visit(new_trial_registration_path)
url_params = { glm_source: 'any-source', glm_content: 'any-content' }
visit(new_trial_registration_path(url_params))
within('div#login-pane') do
fill_in 'user_login', with: user.email
......@@ -20,7 +21,7 @@ describe 'Trial Sign In' do
click_button 'Continue'
end
expect(current_path).to eq(new_trial_path)
expect(current_url).to eq(new_trial_url(url_params))
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment