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
53475509
Commit
53475509
authored
Jul 12, 2019
by
Constance Okoghenun
Committed by
Clement Ho
Jul 12, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactored implentation of reply button tracker
Removed check for composed path in the event listner
parent
fde2a61c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
3 deletions
+61
-3
app/assets/javascripts/notes/components/note_actions/reply_button.vue
...avascripts/notes/components/note_actions/reply_button.vue
+1
-1
ee/app/assets/javascripts/event_tracking/notes.js
ee/app/assets/javascripts/event_tracking/notes.js
+2
-2
ee/changelogs/unreleased/11470-snowplow-tracking-for-notes-does-not-work-in-firefox.yml
...-snowplow-tracking-for-notes-does-not-work-in-firefox.yml
+5
-0
ee/spec/frontend/event_tracking/notes_spec.js
ee/spec/frontend/event_tracking/notes_spec.js
+53
-0
No files found.
app/assets/javascripts/notes/components/note_actions/reply_button.vue
View file @
53475509
...
...
@@ -19,7 +19,7 @@ export default {
<gl-button
ref=
"button"
v-gl-tooltip
class=
"note-action-button"
class=
"note-action-button
js-note-action-reply
"
variant=
"transparent"
:title=
"__('Reply to comment')"
@
click=
"$emit('startReplying')"
...
...
ee/app/assets/javascripts/event_tracking/notes.js
View file @
53475509
...
...
@@ -2,8 +2,8 @@ import Stats from 'ee/stats';
export
default
()
=>
{
document
.
querySelector
(
'
.main-notes-list
'
).
addEventListener
(
'
click
'
,
event
=>
{
const
isReplyButtonClick
=
event
.
path
.
find
(
el
=>
el
.
classList
&&
el
.
classList
.
contains
(
'
js-reply-button
'
)
,
const
isReplyButtonClick
=
event
.
target
.
parentElement
.
classList
.
contains
(
'
js-note-action-reply
'
,
);
if
(
isReplyButtonClick
)
{
...
...
ee/changelogs/unreleased/11470-snowplow-tracking-for-notes-does-not-work-in-firefox.yml
0 → 100644
View file @
53475509
---
title
:
Resolve Snowplow tracking for notes does not work in Firefox
merge_request
:
12578
author
:
type
:
fixed
ee/spec/frontend/event_tracking/notes_spec.js
0 → 100644
View file @
53475509
import
Vue
from
'
vue
'
;
import
Stats
from
'
ee_else_ce/stats
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
initNoteStats
from
'
ee_else_ce/event_tracking/notes
'
;
describe
(
'
initNoteStats
'
,
()
=>
{
let
wrapper
;
const
createComponent
=
template
=>
{
const
component
=
Vue
.
component
(
'
Notes
'
,
{
name
:
'
Notes
'
,
template
,
});
return
shallowMount
(
component
,
{
attachToDocument
:
true
});
};
jest
.
mock
(
'
ee_else_ce/stats
'
);
Stats
.
trackEvent
=
jest
.
fn
();
Stats
.
bindTrackableContainer
=
jest
.
fn
();
afterEach
(()
=>
{
Stats
.
trackEvent
.
mockClear
();
Stats
.
bindTrackableContainer
.
mockClear
();
wrapper
.
destroy
();
});
describe
(
'
is a reply
'
,
()
=>
{
beforeEach
(()
=>
{
wrapper
=
createComponent
(
"
<div class='js-note-action-reply'><button class='main-notes-list'></button></div>
"
,
);
initNoteStats
();
});
it
(
'
calls bindTrackableContainer
'
,
()
=>
{
expect
(
Stats
.
bindTrackableContainer
).
toHaveBeenCalledTimes
(
1
);
});
it
(
'
calls trackEvent
'
,
()
=>
{
wrapper
.
find
(
'
.main-notes-list
'
).
trigger
(
'
click
'
);
expect
(
Stats
.
trackEvent
).
toHaveBeenCalledTimes
(
1
);
});
});
describe
(
'
is not a reply
'
,
()
=>
{
it
(
'
does not call trackEvent
'
,
()
=>
{
wrapper
=
createComponent
(
"
<div><button class='main-notes-list'></button></div>
"
);
initNoteStats
();
wrapper
.
find
(
'
.main-notes-list
'
).
trigger
(
'
click
'
);
expect
(
Stats
.
trackEvent
).
not
.
toHaveBeenCalled
();
});
});
});
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