Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
20ded4ce
Commit
20ded4ce
authored
May 24, 2021
by
Doug Stull
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Makes the invite button on empty projects permanent
- Makes permanent for all versions of Gitlab Changelog: added
parent
b569ae00
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
48 deletions
+17
-48
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+1
-5
app/views/projects/empty.html.haml
app/views/projects/empty.html.haml
+1
-1
config/feature_flags/experiment/invite_members_empty_project_version_a_experiment_percentage.yml
...members_empty_project_version_a_experiment_percentage.yml
+0
-8
lib/gitlab/experimentation.rb
lib/gitlab/experimentation.rb
+0
-3
spec/controllers/projects_controller_spec.rb
spec/controllers/projects_controller_spec.rb
+1
-2
spec/views/projects/empty.html.haml_spec.rb
spec/views/projects/empty.html.haml_spec.rb
+14
-29
No files found.
app/controllers/projects_controller.rb
View file @
20ded4ce
...
...
@@ -330,11 +330,7 @@ class ProjectsController < Projects::ApplicationController
experiment
(
:empty_repo_upload
,
project:
@project
).
track
(
:view_project_show
,
property:
property
)
end
if
@project
.
empty_repo?
record_experiment_user
(
:invite_members_empty_project_version_a
)
render
'projects/empty'
end
render
'projects/empty'
if
@project
.
empty_repo?
else
if
can?
(
current_user
,
:read_wiki
,
@project
)
@wiki
=
@project
.
wiki
...
...
app/views/projects/empty.html.haml
View file @
20ded4ce
...
...
@@ -7,7 +7,7 @@
=
render
"home_panel"
=
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
=
_
(
'The repository for this project is empty'
)
...
...
config/feature_flags/experiment/invite_members_empty_project_version_a_experiment_percentage.yml
deleted
100644 → 0
View file @
b569ae00
---
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
lib/gitlab/experimentation.rb
View file @
20ded4ce
...
...
@@ -45,9 +45,6 @@ module Gitlab
remove_known_trial_form_fields:
{
tracking_category:
'Growth::Conversion::Experiment::RemoveKnownTrialFormFields'
},
invite_members_empty_project_version_a:
{
tracking_category:
'Growth::Expansion::Experiment::InviteMembersEmptyProjectVersionA'
},
invite_members_new_dropdown:
{
tracking_category:
'Growth::Expansion::Experiment::InviteMembersNewDropdown'
},
...
...
spec/controllers/projects_controller_spec.rb
View file @
20ded4ce
...
...
@@ -243,9 +243,8 @@ RSpec.describe ProjectsController do
get
:show
,
params:
{
namespace_id:
empty_project
.
namespace
,
id:
empty_project
}
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
(
controller
).
to
have_received
(
:record_experiment_user
).
with
(
:invite_members_empty_project_version_a
)
end
end
end
...
...
spec/views/projects/empty.html.haml_spec.rb
View file @
20ded4ce
...
...
@@ -46,47 +46,32 @@ RSpec.describe 'projects/empty' do
end
end
describe
'invite_members_empty_project_version_a experiment
'
do
context
'with invite button on empty projects
'
do
let
(
:can_import_members
)
{
true
}
before
do
allow
(
view
).
to
receive
(
:can_import_members?
).
and_return
(
can_import_members
)
end
shared_examples_for
'no invite member info'
do
it
'does not show invite member info'
do
render
it
'shows invite members info'
,
:aggregate_failures
do
render
expect
(
rendered
).
not_to
have_content
(
'Invite your team'
)
end
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 experiment is enabled'
do
it
'shows invite members info'
,
:aggregate_failures
do
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
let
(
:can_import_members
)
{
false
}
context
'when user does not have permissions to invite members'
do
let
(
:can_import_members
)
{
false
}
it_behaves_like
'no invite member info'
end
end
it
'does not show invite member info'
do
render
context
'when experiment is not enabled'
do
before
do
allow
(
view
).
to
receive
(
:experiment_enabled?
)
.
with
(
:invite_members_empty_project_version_a
).
and_return
(
false
)
expect
(
rendered
).
not_to
have_content
(
'Invite your team'
)
end
it_behaves_like
'no invite member info'
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment