Commit e394be7e authored by charlie ablett's avatar charlie ablett

Merge branch '334408-try-it-for-free-cta-source-split' into 'master'

Trial CTA source split

See merge request gitlab-org/gitlab!64848
parents 0bea9d41 dd7cde60
......@@ -15,4 +15,4 @@
= _('The Advanced Search in GitLab is a powerful search service that saves you time. Instead of creating duplicate code and wasting time, you can now search for code within other teams that can help your own project.')
= link_to _('Read more'), help_page_path('user/search/advanced_search.md'), target: '_blank'
= render 'shared/promotions/promotion_link_project'
= render 'shared/promotions/promotion_link_project', location: :advanced_search
......@@ -11,4 +11,4 @@
= _('Audit Events is a way to keep track of important events that happened in GitLab.')
= link_to _('Read more'), help_page_path('administration/audit_events.md'), target: '_blank'
= render 'shared/promotions/promotion_link_project'
= render 'shared/promotions/promotion_link_project', location: :audit_events
......@@ -17,4 +17,4 @@
= s_('Promotions|Burndown Charts are visual representations of the progress of completing a milestone. At a glance, you see the current state for the completion a given milestone. Without them, you would have to organize the data from the milestone and plot it yourself to have the same sense of progress.')
= link_to _('Read more'), help_page_path('user/project/milestones/burndown_and_burnup_charts.md'), target: '_blank'
= render 'shared/promotions/promotion_link_project'
= render 'shared/promotions/promotion_link_project', location: :burndown_charts
......@@ -11,4 +11,4 @@
= s_('Promotions|With Contribution Analytics you can have an overview for the activity of issues, merge requests, and push events of your organization and its members.')
= link_to _('Read more'), help_page_path('user/group/contribution_analytics/index.md'), target: '_blank'
= render 'shared/promotions/promotion_link_project'
= render 'shared/promotions/promotion_link_project', location: :contribution_analytics
......@@ -21,7 +21,7 @@
= s_('Promotions|Epics let you manage your portfolio of projects more efficiently and with less effort by tracking groups of issues that share a theme, across projects and milestones.')
= link_to s_('Read more'), 'https://docs.gitlab.com/ee/user/group/epics/', class: 'btn-link', target: '_blank'
.gl-flex-wrap
= render 'shared/promotions/promotion_link_project', short_form: true
= render 'shared/promotions/promotion_link_project', short_form: true, location: :epics
= link_to s_("Promotions|Don't show me this again"), '#', class: 'gl-button btn js-close js-close-callout gl-mt-2'
.hide-collapsed
......
......@@ -11,4 +11,4 @@
= _('Webhooks allow you to trigger a URL if, for example, new code is pushed or a new issue is created. You can configure webhooks to listen for specific events like pushes, issues or merge requests. Group webhooks will apply to all projects in a group, allowing you to standardize webhook functionality across your entire group.')
= link_to _('Read more'), help_page_path('user/project/integrations/webhooks.md'), target: '_blank'
.gl-mt-5
= render 'shared/promotions/promotion_link_project'
= render 'shared/promotions/promotion_link_project', location: :group_webhooks
......@@ -12,4 +12,4 @@
= _('Description templates allow you to define context-specific templates for issue and merge request description fields for your project.')
= link_to _('Read more'), help_page_path('user/project/description_templates'), class: 'btn-link'
%div
= render 'shared/promotions/promotion_link_project'
= render 'shared/promotions/promotion_link_project', location: :issue_templates
......@@ -30,5 +30,5 @@
- else
= s_('Promotions|Improve issues management with Issue weight and GitLab Enterprise Edition.')
%div
= render 'shared/promotions/promotion_link_project', short_form: true, target_blank: false
= render 'shared/promotions/promotion_link_project', short_form: true, target_blank: false, location: :issue_weights
= link_to s_("Promotions|Not now, thanks!"), '#', class: ['gl-button', 'btn', 'js-close', 'js-close-callout', 'gl-mt-3', 'js-close-session', 'tr-issue-weights-not-now-cta']
......@@ -16,4 +16,4 @@
%p
= _('Set the number of necessary approvals and define a list of approvers needed for every merge request in a project.')
= render 'shared/promotions/promotion_link_project'
= render 'shared/promotions/promotion_link_project', location: :mr_features
......@@ -28,4 +28,4 @@
%p
You can restrict access to protected branches by choosing a role (Maintainers, Developers) as well as certain users.
= render 'shared/promotions/promotion_link_project'
= render 'shared/promotions/promotion_link_project', location: :repository_features
......@@ -4,7 +4,7 @@
- if Gitlab::CurrentSettings.should_check_namespace_plan?
- namespace = @project&.namespace || @group
- if can?(current_user, :admin_namespace, namespace)
= link_to s_('Promotions|Try it for free'), new_trial_registration_path(glm_source: 'gitlab.com', glm_content: 'discover-issue-weights'), class: 'btn gl-button btn-confirm issue-weights-trial-cta', target: target_blank ? '_blank' : '_self'
= link_to s_('Promotions|Try it for free'), new_trial_registration_path(glm_source: 'gitlab.com', glm_content: location), class: 'btn gl-button btn-confirm promotion-trial-cta', target: target_blank ? '_blank' : '_self'
- elsif namespace.is_a?(Group)
%p= s_('Promotions|Contact an owner of group %{namespace_name} to upgrade the plan.') % { namespace_name: namespace.name }
- else
......
......@@ -230,7 +230,7 @@ RSpec.describe 'Promotions', :js do
click_link 'Learn more'
expect(page).to have_link 'Try it for free', href: new_trial_registration_path(glm_source: 'gitlab.com', glm_content: 'discover-issue-weights'), class: 'issue-weights-trial-cta'
expect(page).to have_link 'Try it for free', href: new_trial_registration_path(glm_source: 'gitlab.com', glm_content: 'issue_weights'), class: 'promotion-trial-cta'
expect(find('.js-close-callout.js-close-session.tr-issue-weights-not-now-cta')).to have_content 'Not now, thanks!'
end
end
......
......@@ -6,6 +6,8 @@ RSpec.describe 'admin/application_settings/general.html.haml' do
let_it_be(:user) { create(:admin) }
let_it_be(:app_settings) { build(:application_setting) }
subject { rendered }
before do
assign(:application_setting, app_settings)
allow(view).to receive(:current_user).and_return(user)
......
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'shared/_promotion_link_project' do
let_it_be(:user) { create(:user) }
let_it_be(:namespace) { create(:group, name: 'Our group') }
subject do
render 'shared/promotions/promotion_link_project', location: 'some_location'
rendered
end
before do
allow(view).to receive(:current_user).and_return(user)
@group = namespace
end
context 'with namespace plans ' do
before do
stub_application_setting(check_namespace_plan: true)
end
context 'for namespace admin users' do
before do
namespace.add_owner(user)
end
it do
is_expected.to have_link 'Try it for free', href: new_trial_registration_path(glm_source: 'gitlab.com', glm_content: 'some_location')
end
end
context 'for regular users' do
context 'for groups' do
it { is_expected.to have_text("Contact an owner of group Our group to upgrade the plan.") }
end
context 'for a project in a personal namespace' do
let_it_be(:user2) { create(:user, name: 'Joe') }
let_it_be(:project) { create(:project, namespace: user2.namespace) }
before do
@project = project
end
it { is_expected.to have_text("Contact owner Joe to upgrade the plan.") }
end
end
end
context 'with instance plans' do
before do
stub_application_setting(check_namespace_plan: false)
end
context 'for admin users' do
let_it_be(:user) { create(:admin) }
context 'with active license' do
it { is_expected.to have_text('Start GitLab Ultimate trial') }
end
context 'with expired license' do
let_it_be(:expired_license) { create(:license, expired: true) }
before do
allow(License).to receive(:current).and_return(expired_license)
end
it { is_expected.to have_text('Buy GitLab Enterprise Edition') }
end
end
context 'for regular users' do
it { is_expected.to have_text('Contact your Administrator to upgrade your license.') }
end
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