Commit 691cb888 authored by Alper Akgun's avatar Alper Akgun

Cleanup Update Issue Weights Paywall CTAs feature flag

parent 8b909061
- promotion_feature = 'promote_weight_sidebar_dismissed'
- trial_cta = Feature.enabled?(:promotion_issue_weight_trial_cta, current_user)
- session_dismissal = Feature.enabled?(:promotion_issue_weight_session_dismiss, current_user)
- tracking_options = { track_label: trial_cta.to_s, track_property: session_dismissal.to_s }
- if show_promotions? && show_callout?(promotion_feature)
.block.js-weight-sidebar-callout.promotion-issue-sidebar{ data: { uid: promotion_feature } }
......@@ -13,7 +10,7 @@
= s_('Promotions|Weight')
.hide-collapsed.js-toggle-container.promotion-issue-weight-sidebar-message
= s_('Promotions|This feature is locked.')
%a.btn-link.js-toggle-button.js-weight-sidebar-callout{ href: '#', data: { track_event: 'click_callout' }.merge(tracking_options) }
%a.btn-link.js-toggle-button.js-weight-sidebar-callout{ href: '#' }
= s_('Promotions|Learn more')
= sprite_icon('chevron-up', css_class: 'js-sidebar-collapse hidden')
= sprite_icon('chevron-down', css_class: 'js-sidebar-expand')
......@@ -33,8 +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: !trial_cta, trial_cta: trial_cta
- if session_dismissal
= 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'], data: { track_event: 'click_notnow' }.merge(tracking_options)
- else
= link_to s_("Promotions|Don't show me this again"), '#', class: ['gl-button', 'btn', 'js-close', 'js-close-callout', 'gl-mt-3', 'tr-issue-weights-dont-show-me-again'], data: { track_event: 'click_dontshow' }.merge(tracking_options)
= render 'shared/promotions/promotion_link_project', short_form: true, target_blank: false
= 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']
- short_form = local_assigns.fetch :short_form, false
- target_blank = local_assigns.fetch :target_blank, false
- trial_cta = local_assigns.fetch :trial_cta, false
- if Gitlab::CurrentSettings.should_check_namespace_plan?
- namespace = @project&.namespace || @group
- if can?(current_user, :admin_namespace, namespace)
- if trial_cta
= link_to s_('Promotions|Try it for free'), new_trial_registration_path(glm_source: 'gitlab.com', glm_content: 'discover-issue-weights'), class: 'btn btn-primary issue-weights-trial-cta', target: target_blank ? '_blank' : '_self'
- else
- current_group = @project&.group || @group
= link_to s_('Promotions|Upgrade your plan'), upgrade_plan_path(current_group), class: 'btn btn-primary issue-weights-upgrade-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
......
---
title: Update Issue Weights Paywall CTAs
merge_request: 53117
author:
type: changed
---
name: promotion_issue_weight_session_dismiss
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/23358
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/223772
milestone: '13.1'
type: development
group: group::conversion
default_enabled: false
---
name: promotion_issue_weight_trial_cta
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/23358
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/223772
milestone: '13.1'
type: development
group: group::conversion
default_enabled: false
......@@ -12,11 +12,6 @@ RSpec.describe 'Promotions', :js do
let!(:issue) { create(:issue, project: project, author: user) }
let(:otherproject) { create(:project, :repository, namespace: otherdeveloper.namespace) }
before do
stub_feature_flags promotion_issue_weight_trial_cta: false,
promotion_issue_weight_session_dismiss: false
end
describe 'for merge request improve', :js do
before do
allow(License).to receive(:current).and_return(nil)
......@@ -231,22 +226,6 @@ RSpec.describe 'Promotions', :js do
group.add_owner(user)
end
it 'appears on the page', :js do
visit project_issue_path(project, issue)
wait_for_requests
find('.btn-link.js-toggle-button.js-weight-sidebar-callout').click
expect(find('.issue-weights-upgrade-cta')).to have_content 'Upgrade your plan'
expect(find('.js-close.js-close-callout.tr-issue-weights-dont-show-me-again')).to have_content "Don't show me this again"
end
context 'when promotion feature flags are enabled' do
before do
stub_feature_flags promotion_issue_weight_trial_cta: true,
promotion_issue_weight_session_dismiss: true
end
it 'appears on the page', :js do
visit project_issue_path(project, issue)
wait_for_requests
......@@ -258,7 +237,6 @@ RSpec.describe 'Promotions', :js do
end
end
end
end
describe 'for issue templates', :js do
before do
......
......@@ -23519,9 +23519,6 @@ msgstr ""
msgid "Promotions|Upgrade plan"
msgstr ""
msgid "Promotions|Upgrade your plan"
msgstr ""
msgid "Promotions|Upgrade your plan to activate Contribution Analytics."
msgstr ""
......
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