From 0bf4b5816955186e88779adfafdf7a666dbae040 Mon Sep 17 00:00:00 2001 From: Buck O'Leary <bucoleary@gitlab.com> Date: Fri, 1 Nov 2024 18:15:45 +0000 Subject: [PATCH] Cleanup duo_free_access_ending_banner feature flag - Removes duo free access banner feature flag - Removes associated functionality - Removes deprecated specs Changelog: removed --- .../javascripts/persistent_user_callouts.js | 1 - app/models/users/callout.rb | 2 +- app/views/groups/show.html.haml | 2 - app/views/projects/empty.html.haml | 1 - app/views/projects/show.html.haml | 1 - doc/api/graphql/reference/index.md | 1 - ee/app/helpers/ee/users/callouts_helper.rb | 10 --- .../subscriptions/hand_raise_leads_helper.rb | 15 ---- .../_duo_free_access_ending_banner.html.haml | 3 - .../_duo_free_access_ending_banner.html.haml | 25 ------ .../render_duo_free_access_ending_banner.yml | 16 ---- .../duo_free_access_ending_banner.yml | 9 --- ...l_render_duo_free_access_ending_banner.yml | 22 ------ .../duo_free_access_ending_alert_spec.rb | 55 -------------- .../helpers/ee/users/callouts_helper_spec.rb | 76 ------------------- .../hand_raise_leads_helper_spec.rb | 21 ----- ee/spec/views/groups/show.html.haml_spec.rb | 17 ----- ...ree_access_ending_banner.html.haml_spec.rb | 29 ------- .../views/projects/empty.html.haml_spec.rb | 14 ---- ee/spec/views/projects/show.html.haml_spec.rb | 17 ----- ...ree_access_ending_banner.html.haml_spec.rb | 57 -------------- locale/gitlab.pot | 12 --- 22 files changed, 1 insertion(+), 405 deletions(-) delete mode 100644 ee/app/views/projects/_duo_free_access_ending_banner.html.haml delete mode 100644 ee/app/views/shared/_duo_free_access_ending_banner.html.haml delete mode 100644 ee/config/events/render_duo_free_access_ending_banner.yml delete mode 100644 ee/config/feature_flags/gitlab_com_derisk/duo_free_access_ending_banner.yml delete mode 100644 ee/config/metrics/counts_all/count_total_render_duo_free_access_ending_banner.yml delete mode 100644 ee/spec/features/duo_free_access_ending_alert_spec.rb delete mode 100644 ee/spec/views/groups/show.html.haml_spec.rb delete mode 100644 ee/spec/views/projects/_duo_free_access_ending_banner.html.haml_spec.rb delete mode 100644 ee/spec/views/projects/empty.html.haml_spec.rb delete mode 100644 ee/spec/views/projects/show.html.haml_spec.rb delete mode 100644 ee/spec/views/shared/_duo_free_access_ending_banner.html.haml_spec.rb diff --git a/app/assets/javascripts/persistent_user_callouts.js b/app/assets/javascripts/persistent_user_callouts.js index a66dc2673d7f2..0af1234400c95 100644 --- a/app/assets/javascripts/persistent_user_callouts.js +++ b/app/assets/javascripts/persistent_user_callouts.js @@ -28,7 +28,6 @@ const PERSISTENT_USER_CALLOUTS = [ '.js-joining-a-project-alert', '.js-all-seats-used', '.js-period-in-terraform-state-name-alert', - '.js-duo-free-access-ending-banner', '.js-new-mr-dashboard-banner', ]; diff --git a/app/models/users/callout.rb b/app/models/users/callout.rb index 80e11ad406a28..1720aab5aeb6b 100644 --- a/app/models/users/callout.rb +++ b/app/models/users/callout.rb @@ -94,7 +94,7 @@ class Callout < ApplicationRecord work_item_epic_feedback: 92, # EE-only branch_rules_tip_callout: 93, openssl_callout: 94, - duo_free_access_ending_banner: 95, # EE-only + # 95 removed in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/152981 https://gitlab.com/gitlab-org/gitlab/-/merge_requests/170868 new_mr_dashboard_banner: 96 } diff --git a/app/views/groups/show.html.haml b/app/views/groups/show.html.haml index 5c87d731594b8..da621e8159689 100644 --- a/app/views/groups/show.html.haml +++ b/app/views/groups/show.html.haml @@ -19,8 +19,6 @@ = render partial: 'flash_messages' -= render_if_exists 'shared/duo_free_access_ending_banner', resource: @group - = render 'groups/home_panel' = render_if_exists 'groups/group_activity_analytics', group: @group diff --git a/app/views/projects/empty.html.haml b/app/views/projects/empty.html.haml index e892c1d9ab1b7..5245cf03f4b22 100644 --- a/app/views/projects/empty.html.haml +++ b/app/views/projects/empty.html.haml @@ -3,7 +3,6 @@ - @skip_current_level_breadcrumb = true -= render_if_exists 'projects/duo_free_access_ending_banner', project: @project = render partial: 'flash_messages', locals: { project: @project } = render 'clusters_deprecation_alert' diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml index 1419c4cc05f67..b75fa6d531bc5 100644 --- a/app/views/projects/show.html.haml +++ b/app/views/projects/show.html.haml @@ -7,7 +7,6 @@ = auto_discovery_link_tag(:atom, project_path(@project, rss_url_options), title: "#{@project.name} activity") = render_if_exists 'shared/promotions/promote_mobile_devops', project: @project -= render_if_exists 'projects/duo_free_access_ending_banner', project: @project = render partial: 'flash_messages', locals: { project: @project } = render 'clusters_deprecation_alert' diff --git a/doc/api/graphql/reference/index.md b/doc/api/graphql/reference/index.md index c0f82a5d3cef0..d11e555e62e90 100644 --- a/doc/api/graphql/reference/index.md +++ b/doc/api/graphql/reference/index.md @@ -39884,7 +39884,6 @@ Name of the feature that the callout is for. | <a id="usercalloutfeaturenameenumdeployment_approvals_empty_state"></a>`DEPLOYMENT_APPROVALS_EMPTY_STATE` | Callout feature name for deployment_approvals_empty_state. | | <a id="usercalloutfeaturenameenumdeployment_details_feedback"></a>`DEPLOYMENT_DETAILS_FEEDBACK` | Callout feature name for deployment_details_feedback. | | <a id="usercalloutfeaturenameenumduo_chat_callout"></a>`DUO_CHAT_CALLOUT` | Callout feature name for duo_chat_callout. | -| <a id="usercalloutfeaturenameenumduo_free_access_ending_banner"></a>`DUO_FREE_ACCESS_ENDING_BANNER` | Callout feature name for duo_free_access_ending_banner. | | <a id="usercalloutfeaturenameenumfeature_flags_new_version"></a>`FEATURE_FLAGS_NEW_VERSION` | Callout feature name for feature_flags_new_version. | | <a id="usercalloutfeaturenameenumgcp_signup_offer"></a>`GCP_SIGNUP_OFFER` | Callout feature name for gcp_signup_offer. | | <a id="usercalloutfeaturenameenumgeo_enable_hashed_storage"></a>`GEO_ENABLE_HASHED_STORAGE` | Callout feature name for geo_enable_hashed_storage. | diff --git a/ee/app/helpers/ee/users/callouts_helper.rb b/ee/app/helpers/ee/users/callouts_helper.rb index 132a2053f39bc..cc47d0cfbac56 100644 --- a/ee/app/helpers/ee/users/callouts_helper.rb +++ b/ee/app/helpers/ee/users/callouts_helper.rb @@ -14,7 +14,6 @@ module CalloutsHelper PERSONAL_ACCESS_TOKEN_EXPIRY = 'personal_access_token_expiry' PROFILE_PERSONAL_ACCESS_TOKEN_EXPIRY = 'profile_personal_access_token_expiry' JOINING_A_PROJECT_ALERT = 'joining_a_project_alert' - DUO_FREE_ACCESS_ENDING_BANNER = 'duo_free_access_ending_banner' override :render_dashboard_ultimate_trial def render_dashboard_ultimate_trial(user) @@ -63,15 +62,6 @@ def show_joining_a_project_alert? !user_dismissed?(JOINING_A_PROJECT_ALERT) end - def show_duo_free_access_ending_banner?(group) - return false unless ::Gitlab::Saas.feature_available?(:gitlab_com_subscriptions) - return false unless ::Feature.enabled?(:duo_free_access_ending_banner, group) - return false unless can?(current_user, :owner_access, group) - return false unless group.paid? && GitlabSubscriptions::Duo.no_add_on_purchase_for_namespace?(group) - - !user_dismissed?(DUO_FREE_ACCESS_ENDING_BANNER) - end - override :show_transition_to_jihu_callout? def show_transition_to_jihu_callout? !gitlab_com_subscription? && !has_active_license? && super diff --git a/ee/app/helpers/subscriptions/hand_raise_leads_helper.rb b/ee/app/helpers/subscriptions/hand_raise_leads_helper.rb index 9b64a84e197f6..6c9b8759b5f96 100644 --- a/ee/app/helpers/subscriptions/hand_raise_leads_helper.rb +++ b/ee/app/helpers/subscriptions/hand_raise_leads_helper.rb @@ -53,21 +53,6 @@ def billing_action_hand_raise_lead_data(plan_code) } end - def duo_free_access_ending_hand_raise_lead_data(namespace) - { - namespace_id: namespace.id, - glm_content: 'duo-free-access-ending', - button_text: 'Contact Sales', - cta_tracking: { - action: 'click_buy_duo_pro_seats' - }.to_json, - button_attributes: { - category: 'secondary', - variant: 'confirm' - }.to_json - } - end - def discover_duo_pro_hand_raise_lead_data(namespace) { namespace_id: namespace.id, diff --git a/ee/app/views/projects/_duo_free_access_ending_banner.html.haml b/ee/app/views/projects/_duo_free_access_ending_banner.html.haml deleted file mode 100644 index 4885a167a365d..0000000000000 --- a/ee/app/views/projects/_duo_free_access_ending_banner.html.haml +++ /dev/null @@ -1,3 +0,0 @@ -- return if project.personal? - -= render 'shared/duo_free_access_ending_banner', resource: project diff --git a/ee/app/views/shared/_duo_free_access_ending_banner.html.haml b/ee/app/views/shared/_duo_free_access_ending_banner.html.haml deleted file mode 100644 index b84dd5629f048..0000000000000 --- a/ee/app/views/shared/_duo_free_access_ending_banner.html.haml +++ /dev/null @@ -1,25 +0,0 @@ -- root_namespace = resource.root_ancestor -- return unless show_duo_free_access_ending_banner?(root_namespace) - -- content_for :page_level_alert do - - duo_free_access_end_date = Date.new(2024, 10, 17) - %div{ class: [container_class, @content_class, '!gl-px-0'], data: { event_tracking_load: 'true', event_tracking: 'render_duo_free_access_ending_banner' } } - = render Pajamas::BannerComponent.new(close_options: { class: 'js-close-callout', - data: { testid: 'hide-duo-free-access-ending-banner' }, - 'aria-label' => s_('DuoFreeAccessEndingBanner|Dismiss Free Access Ending banner') }, - banner_options: { class: 'js-duo-free-access-ending-banner', - data: { feature_id: ::EE::Users::CalloutsHelper::DUO_FREE_ACCESS_ENDING_BANNER, - defer_links: 'true', - dismiss_endpoint: callouts_path, - testid: 'duo-pro-trial-banner' } }) do |c| - - c.with_illustration do - = image_tag image_path('illustrations/tanuki-ai-md.svg'), alt: 'Tanuki AI Logo', class: 'gl-p-3 gl-rounded-lg gl-bg-brand-charcoal rounded-bottom-right-9' - - c.with_title do - = format(s_('DuoFreeAccessEndingBanner|Free access to GitLab Duo is ending on %{date}'), date: l(duo_free_access_end_date)) - - c.with_primary_action do - = render Pajamas::ButtonComponent.new(variant: :confirm, href: subscription_portal_add_saas_duo_pro_seats_url(root_namespace.id), button_options: { class: 'gl-mr-3', data: { testid: 'buy-duo-pro-button' }}) do - = s_('DuoFreeAccessEndingBanner|Buy Duo Pro') - .js-hand-raise-lead-trigger{ data: duo_free_access_ending_hand_raise_lead_data(root_namespace) } - - formatted_date = l(duo_free_access_end_date, format: :long) - - link = link_to('', help_page_path('subscriptions/subscription-add-ons.md', anchor: 'changes-to-gitlab-duo-pro-and-gitlab-duo-enterprise-access'), target: '_blank', rel: 'noopener noreferrer') - %p= safe_format(s_('DuoFreeAccessEndingBanner|Starting %{date}, all GitLab Duo features, including Duo Chat, %{link_start}require a paid add-on subscription.%{link_end} To ensure uninterrupted access to Code Suggestions and Chat, buy Duo Pro and assign seats to your users. Or, for Duo Enterprise options, contact Sales.'), tag_pair(link, :link_start, :link_end), date: formatted_date) diff --git a/ee/config/events/render_duo_free_access_ending_banner.yml b/ee/config/events/render_duo_free_access_ending_banner.yml deleted file mode 100644 index e524a0ea2005c..0000000000000 --- a/ee/config/events/render_duo_free_access_ending_banner.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- -description: Tracks when the duo free access ending banner is rendered -internal_events: true -action: render_duo_free_access_ending_banner -identifiers: - - namespace - - user - - project -product_group: acquisition -milestone: '17.5' -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/167061 -distributions: -- ee -tiers: -- premium -- ultimate diff --git a/ee/config/feature_flags/gitlab_com_derisk/duo_free_access_ending_banner.yml b/ee/config/feature_flags/gitlab_com_derisk/duo_free_access_ending_banner.yml deleted file mode 100644 index 2a4f376461634..0000000000000 --- a/ee/config/feature_flags/gitlab_com_derisk/duo_free_access_ending_banner.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -name: duo_free_access_ending_banner -feature_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/482067 -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/167061 -rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/493880 -milestone: '17.5' -group: group::acquisition -type: gitlab_com_derisk -default_enabled: false diff --git a/ee/config/metrics/counts_all/count_total_render_duo_free_access_ending_banner.yml b/ee/config/metrics/counts_all/count_total_render_duo_free_access_ending_banner.yml deleted file mode 100644 index 47d99fa12a1f2..0000000000000 --- a/ee/config/metrics/counts_all/count_total_render_duo_free_access_ending_banner.yml +++ /dev/null @@ -1,22 +0,0 @@ ---- -key_path: counts.count_total_render_duo_free_access_ending_banner -description: Total count of when the duo free access ending banner is rendered -product_group: acquisition -performance_indicator_type: [] -value_type: number -status: active -milestone: '17.5' -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/167061 -time_frame: all -data_source: internal_events -data_category: optional -distribution: - - ee -tier: - - premium - - ultimate -tiers: - - premium - - ultimate -events: - - name: render_duo_free_access_ending_banner diff --git a/ee/spec/features/duo_free_access_ending_alert_spec.rb b/ee/spec/features/duo_free_access_ending_alert_spec.rb deleted file mode 100644 index b46b596a88da3..0000000000000 --- a/ee/spec/features/duo_free_access_ending_alert_spec.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe 'Duo Free Access Ending alert', :saas, :js, feature_category: :acquisition do - let_it_be(:user) { create(:user) } - let_it_be(:group) { create(:group_with_plan, plan: :ultimate_plan, owners: [user]) } - let_it_be(:duo_pro_addon) { create(:gitlab_subscription_add_on, :gitlab_duo_pro) } - - before do - sign_in(user) - end - - context 'when dismiss button clicked' do - it 'is dismissed' do - visit group_path(group) - dismiss_button.click - - wait_for_all_requests - - expect_group_page_for(group) - expect_banner_to_be_absent - end - - it 'remains dismissed' do - visit group_path(group) - dismiss_button.click - - wait_for_all_requests - - visit group_path(group) - - expect_group_page_for(group) - expect_banner_to_be_absent - end - end - - def dismiss_button - find_by_testid("hide-duo-free-access-ending-banner") - end - - def expect_group_page_for(group) - expect(page).to have_text group.name - expect(page).to have_text "Group ID: #{group.id}" - end - - def expect_banner_to_be_absent - expect(page).not_to have_text 'Free access to GitLab Duo is ending soon' - expect(page).not_to have_text <<~TEXT.strip - All GitLab Duo features including GitLab Duo Chat will transition to paid features - on 2024-10-17. To ensure continued access and use for your team, you can purchase - GitLab Duo Pro seats. - TEXT - end -end diff --git a/ee/spec/helpers/ee/users/callouts_helper_spec.rb b/ee/spec/helpers/ee/users/callouts_helper_spec.rb index 14645765a675d..99071b9c6c2b8 100644 --- a/ee/spec/helpers/ee/users/callouts_helper_spec.rb +++ b/ee/spec/helpers/ee/users/callouts_helper_spec.rb @@ -226,82 +226,6 @@ end end - describe '.show_duo_free_access_ending_banner?', feature_category: :acquistion do - subject { helper.show_duo_free_access_ending_banner?(group) } - - let(:user) { build(:user) } - let(:group) { build(:group, owners: [user]) } - - let(:sass_feature_available?) { true } - let(:duo_free_access_ending_banner_feature_available?) { true } - let(:current_user) { user } - let(:group_paid?) { true } - let(:owner_of_group?) { true } - let(:no_duo_subscription?) { true } - let(:dismissed_callout?) { false } - - before do - stub_saas_features(gitlab_com_subscriptions: sass_feature_available?) - stub_feature_flags(duo_free_access_ending_banner: duo_free_access_ending_banner_feature_available?) - allow(helper).to receive(:current_user).and_return(current_user) - - allow(helper).to receive(:can?).with(current_user, :owner_access, group).and_return(owner_of_group?) - allow(group).to receive(:paid?).and_return(group_paid?) - allow(GitlabSubscriptions::Duo).to receive(:no_add_on_purchase_for_namespace?).with(group).and_return(no_duo_subscription?) - allow(helper).to receive(:user_dismissed?).with('duo_free_access_ending_banner').and_return(dismissed_callout?) - end - - context 'with all conditions met' do - it { is_expected.to be(true) } - end - - context 'when saas feature `gitlab_com_subscriptions` is not available' do - let(:sass_feature_available?) { false } - - it { is_expected.to be(false) } - end - - context 'when feature flag `duo_free_access_ending_banner` is not enabled' do - let(:duo_free_access_ending_banner_feature_available?) { false } - - it { is_expected.to be(false) } - end - - context 'when current_user is nil' do - let(:current_user) { nil } - - before do - allow(helper).to receive(:can?).with(current_user, :owner_access, group).and_call_original - end - - it { is_expected.to be(false) } - end - - context 'when group is not paid' do - let(:group_paid?) { false } - - it { is_expected.to be(false) } - end - - context 'when user is not an owner of a group' do - let(:owner_of_group?) { false } - - it { is_expected.to be(false) } - end - - context 'when a duo subscription exists for a group' do - let(:no_duo_subscription?) { false } - - it { is_expected.to be(false) } - end - - context 'when the callout is dismissed' do - let(:dismissed_callout?) { true } - - it { is_expected.to be(false) } - end - end - describe '.show_transition_to_jihu_callout?', :do_not_mock_admin_mode_setting do let_it_be(:admin) { create(:user, :admin) } let_it_be(:user) { create(:user) } diff --git a/ee/spec/helpers/subscriptions/hand_raise_leads_helper_spec.rb b/ee/spec/helpers/subscriptions/hand_raise_leads_helper_spec.rb index 6dc0b5beea427..dcbb7132a2f52 100644 --- a/ee/spec/helpers/subscriptions/hand_raise_leads_helper_spec.rb +++ b/ee/spec/helpers/subscriptions/hand_raise_leads_helper_spec.rb @@ -92,27 +92,6 @@ end end - describe '#duo_free_access_ending_hand_raise_lead_data' do - let(:namespace) { build_stubbed(:group) } - - it 'provides the expected dataset' do - result = { - namespace_id: namespace.id, - glm_content: 'duo-free-access-ending', - button_text: 'Contact Sales', - cta_tracking: { - action: 'click_buy_duo_pro_seats' - }.to_json, - button_attributes: { - category: 'secondary', - variant: 'confirm' - }.to_json - } - - expect(helper.duo_free_access_ending_hand_raise_lead_data(namespace)).to eq(result) - end - end - describe 'discover_duo_pro_hand_raise_lead_data' do let_it_be(:namespace) { build_stubbed(:group) } diff --git a/ee/spec/views/groups/show.html.haml_spec.rb b/ee/spec/views/groups/show.html.haml_spec.rb deleted file mode 100644 index c41344a36c0c0..0000000000000 --- a/ee/spec/views/groups/show.html.haml_spec.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe 'groups/show', feature_category: :groups_and_projects do - before do - assign(:group, build(:group)) - end - - context 'with Duo Free Access Ending trial alert' do - it 'renders the alert partial' do - render - - expect(rendered).to render_template('shared/_duo_free_access_ending_banner') - end - end -end diff --git a/ee/spec/views/projects/_duo_free_access_ending_banner.html.haml_spec.rb b/ee/spec/views/projects/_duo_free_access_ending_banner.html.haml_spec.rb deleted file mode 100644 index 33dbcbb3a9f23..0000000000000 --- a/ee/spec/views/projects/_duo_free_access_ending_banner.html.haml_spec.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe 'projects/_duo_free_access_ending_banner.html.haml', feature_category: :acquisition do - let(:project) { build(:project, group: group) } - - before do - allow(view).to receive(:project).and_return(project) - end - - context 'when project is not personal' do - let(:group) { build(:group) } - - it 'renders the template' do - render - - expect(rendered).to render_template('projects/_duo_free_access_ending_banner') - end - end - - context 'when project is personal' do - let(:group) { nil } - - it 'does not render anything' do - expect { render }.to raise_error(TypeError) - end - end -end diff --git a/ee/spec/views/projects/empty.html.haml_spec.rb b/ee/spec/views/projects/empty.html.haml_spec.rb deleted file mode 100644 index 4232853ff9111..0000000000000 --- a/ee/spec/views/projects/empty.html.haml_spec.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe 'projects/empty', feature_category: :groups_and_projects do - before do - assign(:project, ProjectPresenter.new(build(:project), current_user: nil)) - stub_template 'projects/_sidebar.html.haml' => '' - end - - subject { render && rendered } - - it { is_expected.to render_template('projects/_duo_free_access_ending_banner') } -end diff --git a/ee/spec/views/projects/show.html.haml_spec.rb b/ee/spec/views/projects/show.html.haml_spec.rb deleted file mode 100644 index 91e9ddbda30d6..0000000000000 --- a/ee/spec/views/projects/show.html.haml_spec.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe 'projects/show', feature_category: :groups_and_projects do - before do - project = ProjectPresenter.new(build(:project), current_user: nil) - allow(project).to receive(:default_view).and_return('activity') - stub_template 'projects/_activity.html.haml' => '' - assign(:project, project) - stub_template 'projects/_sidebar.html.haml' => '' - end - - subject { render && rendered } - - it { is_expected.to render_template('projects/_duo_free_access_ending_banner') } -end diff --git a/ee/spec/views/shared/_duo_free_access_ending_banner.html.haml_spec.rb b/ee/spec/views/shared/_duo_free_access_ending_banner.html.haml_spec.rb deleted file mode 100644 index 1ac83d5237d68..0000000000000 --- a/ee/spec/views/shared/_duo_free_access_ending_banner.html.haml_spec.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe 'shared/_duo_free_access_ending_banner.html.haml', :saas, feature_category: :acquisition do - let(:show_duo_free_access_ending_banner?) { true } - let(:namespace) { build(:namespace, id: non_existing_record_id) } - let(:sub_group) { build(:group, parent: namespace) } - - before do - allow(view) - .to receive(:show_duo_free_access_ending_banner?).with(namespace).and_return(show_duo_free_access_ending_banner?) - allow(view).to receive(:resource).and_return(sub_group) - end - - subject(:page_level_alert) { view.content_for(:page_level_alert) } - - context 'when the banner does not show' do - let(:show_duo_free_access_ending_banner?) { false } - - it 'does not render anything' do - expect { render }.to raise_error(TypeError) - end - end - - context 'when the banner shows' do - before do - render - end - - it 'contains the correct header and content' do - expect(page_level_alert).to have_content('Free access to GitLab Duo is ending on 2024-10-17') - - expect(page_level_alert).to have_content( - 'Starting October 17, 2024, all GitLab Duo features, including Duo Chat, require a paid add-on subscription. ' \ - 'To ensure uninterrupted access to Code Suggestions and Chat, buy Duo Pro and assign seats to your users. ' \ - 'Or, for Duo Enterprise options, contact Sales. Buy Duo Pro') - - expect(page_level_alert).to have_link('require a paid add-on subscription.', - href: help_page_path('subscriptions/subscription-add-ons.md', - anchor: 'changes-to-gitlab-duo-pro-and-gitlab-duo-enterprise-access')) - end - - context 'with the Buy Duo Pro button' do - it 'contains a link to customers dot portal' do - expect(page_level_alert) - .to have_link('Buy Duo Pro', href: subscription_portal_add_saas_duo_pro_seats_url(namespace.id)) - end - end - - context 'with the Contact Sales button' do - it 'contains the hand raise lead selector' do - expect(page_level_alert).to have_selector('.js-hand-raise-lead-trigger') - end - end - end -end diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 4d8f720a7aa1b..55251589b07a4 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -20437,18 +20437,6 @@ msgstr "" msgid "DuoEnterprise|You now have access to GitLab Duo Enterprise, the only AI solution that supports developers at every stage of the software development lifecycle." msgstr "" -msgid "DuoFreeAccessEndingBanner|Buy Duo Pro" -msgstr "" - -msgid "DuoFreeAccessEndingBanner|Dismiss Free Access Ending banner" -msgstr "" - -msgid "DuoFreeAccessEndingBanner|Free access to GitLab Duo is ending on %{date}" -msgstr "" - -msgid "DuoFreeAccessEndingBanner|Starting %{date}, all GitLab Duo features, including Duo Chat, %{link_start}require a paid add-on subscription.%{link_end} To ensure uninterrupted access to Code Suggestions and Chat, buy Duo Pro and assign seats to your users. Or, for Duo Enterprise options, contact Sales." -msgstr "" - msgid "DuoProDiscover|A single platform integrates the best AI model for each use case across the entire development workflow." msgstr "" -- GitLab