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
74e014e6
Commit
74e014e6
authored
Nov 17, 2021
by
Doug Stull
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make invite members in quick menu permanent
- make permanent part of product Changelog: added
parent
01dca126
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
70 deletions
+15
-70
app/helpers/nav/new_dropdown_helper.rb
app/helpers/nav/new_dropdown_helper.rb
+5
-6
config/feature_flags/experiment/invite_members_new_dropdown_experiment_percentage.yml
...ent/invite_members_new_dropdown_experiment_percentage.yml
+0
-8
lib/gitlab/experimentation.rb
lib/gitlab/experimentation.rb
+0
-3
lib/gitlab/experimentation/controller_concern.rb
lib/gitlab/experimentation/controller_concern.rb
+1
-1
spec/helpers/nav/new_dropdown_helper_spec.rb
spec/helpers/nav/new_dropdown_helper_spec.rb
+4
-26
spec/views/layouts/header/_new_dropdown.haml_spec.rb
spec/views/layouts/header/_new_dropdown.haml_spec.rb
+5
-26
No files found.
app/helpers/nav/new_dropdown_helper.rb
View file @
74e014e6
...
...
@@ -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
...
...
config/feature_flags/experiment/invite_members_new_dropdown_experiment_percentage.yml
deleted
100644 → 0
View file @
01dca126
---
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
lib/gitlab/experimentation.rb
View file @
74e014e6
...
...
@@ -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
...
...
lib/gitlab/experimentation/controller_concern.rb
View file @
74e014e6
...
...
@@ -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
...
...
spec/helpers/nav/new_dropdown_helper_spec.rb
View file @
74e014e6
...
...
@@ -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
...
...
spec/views/layouts/header/_new_dropdown.haml_spec.rb
View file @
74e014e6
...
...
@@ -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
...
...
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