Commit 20ded4ce authored by Doug Stull's avatar Doug Stull

Makes the invite button on empty projects permanent

- Makes permanent for all versions of Gitlab

Changelog: added
parent b569ae00
...@@ -330,11 +330,7 @@ class ProjectsController < Projects::ApplicationController ...@@ -330,11 +330,7 @@ class ProjectsController < Projects::ApplicationController
experiment(:empty_repo_upload, project: @project).track(:view_project_show, property: property) experiment(:empty_repo_upload, project: @project).track(:view_project_show, property: property)
end end
if @project.empty_repo? render 'projects/empty' if @project.empty_repo?
record_experiment_user(:invite_members_empty_project_version_a)
render 'projects/empty'
end
else else
if can?(current_user, :read_wiki, @project) if can?(current_user, :read_wiki, @project)
@wiki = @project.wiki @wiki = @project.wiki
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
= render "home_panel" = render "home_panel"
= render "archived_notice", project: @project = render "archived_notice", project: @project
= render "invite_members" if experiment_enabled?(:invite_members_empty_project_version_a) && can_import_members? = render "invite_members" if can_import_members?
%h4.gl-mt-0.gl-mb-3 %h4.gl-mt-0.gl-mb-3
= _('The repository for this project is empty') = _('The repository for this project is empty')
......
---
name: invite_members_empty_project_version_a_experiment_percentage
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/49588
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/262014
milestone: '13.7'
type: experiment
group: group::expansion
default_enabled: false
...@@ -45,9 +45,6 @@ module Gitlab ...@@ -45,9 +45,6 @@ module Gitlab
remove_known_trial_form_fields: { remove_known_trial_form_fields: {
tracking_category: 'Growth::Conversion::Experiment::RemoveKnownTrialFormFields' tracking_category: 'Growth::Conversion::Experiment::RemoveKnownTrialFormFields'
}, },
invite_members_empty_project_version_a: {
tracking_category: 'Growth::Expansion::Experiment::InviteMembersEmptyProjectVersionA'
},
invite_members_new_dropdown: { invite_members_new_dropdown: {
tracking_category: 'Growth::Expansion::Experiment::InviteMembersNewDropdown' tracking_category: 'Growth::Expansion::Experiment::InviteMembersNewDropdown'
}, },
......
...@@ -243,9 +243,8 @@ RSpec.describe ProjectsController do ...@@ -243,9 +243,8 @@ RSpec.describe ProjectsController do
get :show, params: { namespace_id: empty_project.namespace, id: empty_project } get :show, params: { namespace_id: empty_project.namespace, id: empty_project }
end end
it "renders the empty project view and records the experiment user", :aggregate_failures do it "renders the empty project view" do
expect(response).to render_template('empty') expect(response).to render_template('empty')
expect(controller).to have_received(:record_experiment_user).with(:invite_members_empty_project_version_a)
end end
end end
end end
......
...@@ -46,47 +46,32 @@ RSpec.describe 'projects/empty' do ...@@ -46,47 +46,32 @@ RSpec.describe 'projects/empty' do
end end
end end
describe 'invite_members_empty_project_version_a experiment' do context 'with invite button on empty projects' do
let(:can_import_members) { true } let(:can_import_members) { true }
before do before do
allow(view).to receive(:can_import_members?).and_return(can_import_members) allow(view).to receive(:can_import_members?).and_return(can_import_members)
end end
shared_examples_for 'no invite member info' do it 'shows invite members info', :aggregate_failures do
it 'does not show invite member info' do render
render
expect(rendered).not_to have_content('Invite your team') expect(rendered).to have_selector('[data-track-event=render]')
end expect(rendered).to have_selector('[data-track-label=invite_members_empty_project]', count: 2)
expect(rendered).to have_content('Invite your team')
expect(rendered).to have_content('Add members to this project and start collaborating with your team.')
expect(rendered).to have_link('Invite members', href: project_project_members_path(project, sort: :access_level_desc))
expect(rendered).to have_selector('[data-track-event=click_button]')
end end
context 'when experiment is enabled' do context 'when user does not have permissions to invite members' do
it 'shows invite members info', :aggregate_failures do let(:can_import_members) { false }
render
expect(rendered).to have_selector('[data-track-event=render]')
expect(rendered).to have_selector('[data-track-label=invite_members_empty_project]', count: 2)
expect(rendered).to have_content('Invite your team')
expect(rendered).to have_content('Add members to this project and start collaborating with your team.')
expect(rendered).to have_link('Invite members', href: project_project_members_path(project, sort: :access_level_desc))
expect(rendered).to have_selector('[data-track-event=click_button]')
end
context 'when user does not have permissions to invite members' do it 'does not show invite member info' do
let(:can_import_members) { false } render
it_behaves_like 'no invite member info'
end
end
context 'when experiment is not enabled' do expect(rendered).not_to have_content('Invite your team')
before do
allow(view).to receive(:experiment_enabled?)
.with(:invite_members_empty_project_version_a).and_return(false)
end end
it_behaves_like 'no invite member info'
end end
end 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