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
3b29c4ab
Commit
3b29c4ab
authored
Feb 17, 2021
by
Doug Stull
Committed by
Heinrich Lee Yu
Feb 17, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add distinct tracking value for invite members version b
- to allow tracking funnel exactness for experimentation.
parent
0defe75d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
10 deletions
+41
-10
app/helpers/invite_members_helper.rb
app/helpers/invite_members_helper.rb
+8
-0
app/views/shared/issuable/_sidebar_assignees.html.haml
app/views/shared/issuable/_sidebar_assignees.html.haml
+3
-0
ee/app/assets/javascripts/projects/track_invite_members.js
ee/app/assets/javascripts/projects/track_invite_members.js
+1
-1
ee/spec/frontend/projects/track_invite_members_spec.js
ee/spec/frontend/projects/track_invite_members_spec.js
+14
-9
spec/helpers/invite_members_helper_spec.rb
spec/helpers/invite_members_helper_spec.rb
+15
-0
No files found.
app/helpers/invite_members_helper.rb
View file @
3b29c4ab
...
...
@@ -23,6 +23,14 @@ module InviteMembersHelper
end
end
def
show_invite_members_track_event
if
directly_invite_members?
'show_invite_members'
elsif
indirectly_invite_members?
'show_invite_members_version_b'
end
end
def
invite_group_members?
(
group
)
experiment_enabled?
(
:invite_members_empty_group_version_a
)
&&
Ability
.
allowed?
(
current_user
,
:admin_group_member
,
group
)
end
...
...
app/views/shared/issuable/_sidebar_assignees.html.haml
View file @
3b29c4ab
...
...
@@ -43,6 +43,9 @@
-
options
[
:dropdown_class
]
+=
' dropdown-extended-height'
-
options
[
:footer_content
]
=
true
-
options
[
:wrapper_class
]
=
'js-sidebar-assignee-dropdown'
-
options
[
:toggle_class
]
+=
' js-invite-members-track'
-
data
[
'track-event'
]
=
show_invite_members_track_event
-
options
[
:data
].
merge!
(
data
)
-
invite_text
=
_
(
'Invite Members'
)
-
track_label
=
'edit_assignee'
...
...
ee/app/assets/javascripts/projects/track_invite_members.js
View file @
3b29c4ab
...
...
@@ -2,8 +2,8 @@ import $ from 'jquery';
import
Tracking
from
'
~/tracking
'
;
export
default
function
initTrackInviteMembers
(
assigneeDropdown
)
{
const
trackEvent
=
'
show_invite_members
'
;
const
trackLabel
=
'
edit_assignee
'
;
const
{
trackEvent
}
=
assigneeDropdown
.
querySelector
(
'
.js-invite-members-track
'
).
dataset
;
$
(
assigneeDropdown
).
on
(
'
shown.bs.dropdown
'
,
()
=>
{
Tracking
.
event
(
undefined
,
trackEvent
,
{
...
...
ee/spec/frontend/projects/track_invite_members_spec.js
View file @
3b29c4ab
...
...
@@ -4,18 +4,23 @@ import { mockTracking, unmockTracking } from 'helpers/tracking_helper';
describe
(
'
Track user dropdown open
'
,
()
=>
{
let
trackingSpy
;
let
selector
;
let
dropdownElement
;
beforeEach
(()
=>
{
setFixtures
(
`
<div class="js-sidebar-assignee-dropdown">
</div>`
);
document
.
body
.
innerHTML
=
`
<div id="dummy-wrapper-element">
<div class="js-sidebar-assignee-dropdown">
<div class="js-invite-members-track" data-track-event="_track_event_">
</div>
</div>
</div>
`
;
selector
=
$
(
'
.js-sidebar-assignee-dropdown
'
);
trackingSpy
=
mockTracking
(
'
_category_
'
,
selector
.
e
lement
,
jest
.
spyOn
);
dropdownElement
=
document
.
querySelector
(
'
.js-sidebar-assignee-dropdown
'
);
trackingSpy
=
mockTracking
(
'
_category_
'
,
dropdownE
lement
,
jest
.
spyOn
);
document
.
body
.
dataset
.
page
=
'
some:page
'
;
trackShowInviteMemberLink
(
selector
);
trackShowInviteMemberLink
(
dropdownElement
);
});
afterEach
(()
=>
{
...
...
@@ -23,9 +28,9 @@ describe('Track user dropdown open', () => {
});
it
(
'
sends a tracking event when the dropdown is opened and contains Invite Members link
'
,
()
=>
{
selector
.
trigger
(
'
shown.bs.dropdown
'
);
$
(
dropdownElement
)
.
trigger
(
'
shown.bs.dropdown
'
);
expect
(
trackingSpy
).
toHaveBeenCalledWith
(
undefined
,
'
show_invite_members
'
,
{
expect
(
trackingSpy
).
toHaveBeenCalledWith
(
undefined
,
'
_track_event_
'
,
{
label
:
'
edit_assignee
'
,
});
});
...
...
spec/helpers/invite_members_helper_spec.rb
View file @
3b29c4ab
...
...
@@ -11,6 +11,21 @@ RSpec.describe InviteMembersHelper do
helper
.
extend
(
Gitlab
::
Experimentation
::
ControllerConcern
)
end
describe
'#show_invite_members_track_event'
do
it
'shows values when can directly invite members'
do
allow
(
helper
).
to
receive
(
:directly_invite_members?
).
and_return
(
true
)
expect
(
helper
.
show_invite_members_track_event
).
to
eq
'show_invite_members'
end
it
'shows values when can indirectly invite members'
do
allow
(
helper
).
to
receive
(
:directly_invite_members?
).
and_return
(
false
)
allow
(
helper
).
to
receive
(
:indirectly_invite_members?
).
and_return
(
true
)
expect
(
helper
.
show_invite_members_track_event
).
to
eq
'show_invite_members_version_b'
end
end
context
'with project'
do
before
do
assign
(
:project
,
project
)
...
...
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