Commit 74e014e6 authored by Doug Stull's avatar Doug Stull

Make invite members in quick menu permanent

- make permanent part of product

Changelog: added
parent 01dca126
......@@ -50,7 +50,7 @@ module Nav
menu_items.push(create_epic_menu_item(group))
if Gitlab::Experimentation.active?(:invite_members_new_dropdown) && can?(current_user, :admin_group_member, group)
if can?(current_user, :admin_group_member, group)
menu_items.push(
invite_members_menu_item(
href: group_group_members_path(group)
......@@ -101,7 +101,7 @@ module Nav
)
end
if Gitlab::Experimentation.active?(:invite_members_new_dropdown) && can_admin_project_member?(project)
if can_admin_project_member?(project)
menu_items.push(
invite_members_menu_item(
href: project_project_members_path(project)
......@@ -161,12 +161,11 @@ module Nav
::Gitlab::Nav::TopNavMenuItem.build(
id: 'invite',
title: s_('InviteMember|Invite members'),
emoji: ('shaking_hands' if experiment_enabled?(:invite_members_new_dropdown)),
emoji: 'shaking_hands',
href: href,
data: {
track_action: 'click_link',
track_label: tracking_label,
track_property: experiment_tracking_category_and_group(:invite_members_new_dropdown)
track_action: 'click_link_invite_members',
track_label: 'plus_menu_dropdown'
}
)
end
......
---
name: invite_members_new_dropdown_experiment_percentage
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/50069
rollout_issue_url: https://gitlab.com/gitlab-org/growth/team-tasks/-/issues/291
milestone: '13.8'
type: experiment
group: group::expansion
default_enabled: false
......@@ -37,9 +37,6 @@ module Gitlab
remove_known_trial_form_fields_noneditable: {
tracking_category: 'Growth::Conversion::Experiment::RemoveKnownTrialFormFieldsNoneditable',
rollout_strategy: :user
},
invite_members_new_dropdown: {
tracking_category: 'Growth::Expansion::Experiment::InviteMembersNewDropdown'
}
}.freeze
......
......@@ -16,7 +16,7 @@ module Gitlab
included do
before_action :set_experimentation_subject_id_cookie, unless: :dnt_enabled?
helper_method :experiment_enabled?, :experiment_tracking_category_and_group, :record_experiment_group, :tracking_label
helper_method :experiment_enabled?, :experiment_tracking_category_and_group, :record_experiment_group
end
def set_experimentation_subject_id_cookie
......
......@@ -13,8 +13,6 @@ RSpec.describe Nav::NewDropdownHelper do
let(:with_can_create_project) { false }
let(:with_can_create_group) { false }
let(:with_can_create_snippet) { false }
let(:with_invite_members_experiment) { false }
let(:with_invite_members_experiment_enabled) { false }
let(:subject) { helper.new_dropdown_view_model(project: current_project, group: current_group) }
......@@ -28,11 +26,6 @@ RSpec.describe Nav::NewDropdownHelper do
end
before do
allow(::Gitlab::Experimentation).to receive(:active?).with(:invite_members_new_dropdown) { with_invite_members_experiment }
allow(helper).to receive(:experiment_enabled?).with(:invite_members_new_dropdown) { with_invite_members_experiment_enabled }
allow(helper).to receive(:tracking_label) { 'test_tracking_label' }
allow(helper).to receive(:experiment_tracking_category_and_group) { |x| x }
allow(helper).to receive(:current_user) { current_user }
allow(helper).to receive(:can?) { false }
......@@ -42,38 +35,23 @@ RSpec.describe Nav::NewDropdownHelper do
end
shared_examples 'invite member link shared example' do
it 'shows invite member link' do
it 'shows invite member link with emoji' do
expect(subject[:menu_sections]).to eq(
expected_menu_section(
title: expected_title,
menu_item: ::Gitlab::Nav::TopNavMenuItem.build(
id: 'invite',
title: 'Invite members',
emoji: 'shaking_hands',
href: expected_href,
data: {
track_action: 'click_link',
track_label: 'test_tracking_label',
track_property: :invite_members_new_dropdown
track_action: 'click_link_invite_members',
track_label: 'plus_menu_dropdown'
}
)
)
)
end
context 'with experiment enabled' do
let(:with_invite_members_experiment_enabled) { true }
it 'shows emoji with invite member link' do
expect(subject[:menu_sections]).to match(
expected_menu_section(
title: expected_title,
menu_item: a_hash_including(
emoji: 'shaking_hands'
)
)
)
end
end
end
it 'has title' do
......
......@@ -6,33 +6,13 @@ RSpec.describe 'layouts/header/_new_dropdown' do
let_it_be(:user) { create(:user) }
shared_examples_for 'invite member quick link' do
context 'when an experiment is active' do
before do
allow(Gitlab::Experimentation).to receive(:active?).and_return(true)
allow(view).to receive(:experiment_tracking_category_and_group)
allow(view).to receive(:tracking_label)
end
context 'with ability to invite members' do
it { is_expected.to have_link('Invite members', href: href) }
it 'records the experiment' do
subject
expect(view).to have_received(:experiment_tracking_category_and_group)
.with(:invite_members_new_dropdown)
expect(view).to have_received(:tracking_label)
end
end
context 'without ability to invite members' do
let(:invite_member) { false }
it { is_expected.not_to have_link('Invite members') }
end
context 'with ability to invite members' do
it { is_expected.to have_link('Invite members', href: href) }
end
context 'when experiment is not active' do
context 'without ability to invite members' do
let(:invite_member) { false }
it { is_expected.not_to have_link('Invite members') }
end
end
......@@ -72,7 +52,6 @@ RSpec.describe 'layouts/header/_new_dropdown' do
allow(view).to receive(:can?).with(user, :create_projects, group).and_return(true)
allow(view).to receive(:can?).with(user, :admin_group_member, group).and_return(invite_member)
allow(view).to receive(:can_admin_project_member?).and_return(invite_member)
allow(view).to receive(:experiment_enabled?)
end
subject do
......
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