diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-08 12:08:40 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-08 12:08:40 +0300 |
commit | 33882b0ed118afb7239b76a074f9ab7cf90558f3 (patch) | |
tree | 7637ebe087cb94c9d2b59b62af7ccbe45c9f191d /app/assets/javascripts/notes | |
parent | 028d8ac9fdde17782cc002563ecd7c5f77ea699f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/notes')
-rw-r--r-- | app/assets/javascripts/notes/components/timeline_toggle.vue | 5 | ||||
-rw-r--r-- | app/assets/javascripts/notes/utils.js | 12 |
2 files changed, 17 insertions, 0 deletions
diff --git a/app/assets/javascripts/notes/components/timeline_toggle.vue b/app/assets/javascripts/notes/components/timeline_toggle.vue index 735dc5ff2a8..d1ffe0a3601 100644 --- a/app/assets/javascripts/notes/components/timeline_toggle.vue +++ b/app/assets/javascripts/notes/components/timeline_toggle.vue @@ -4,6 +4,8 @@ import { mapActions, mapGetters } from 'vuex'; import { s__ } from '~/locale'; import { COMMENTS_ONLY_FILTER_VALUE, DESC } from '../constants'; import notesEventHub from '../event_hub'; +import TrackEventDirective from '~/vue_shared/directives/track_event'; +import { trackToggleTimelineView } from '../utils'; export const timelineEnabledTooltip = s__('Timeline|Turn timeline view off'); export const timelineDisabledTooltip = s__('Timeline|Turn timeline view on'); @@ -14,6 +16,7 @@ export default { }, directives: { GlTooltip: GlTooltipDirective, + TrackEvent: TrackEventDirective, }, computed: { ...mapGetters(['timelineEnabled', 'sortDirection']), @@ -23,6 +26,7 @@ export default { }, methods: { ...mapActions(['setTimelineView', 'setDiscussionSortDirection']), + trackToggleTimelineView, setSort() { if (this.timelineEnabled && this.sortDirection !== DESC) { this.setDiscussionSortDirection({ direction: DESC, persist: false }); @@ -44,6 +48,7 @@ export default { <template> <gl-button v-gl-tooltip + v-track-event="trackToggleTimelineView(timelineEnabled)" icon="comments" size="small" :selected="timelineEnabled" diff --git a/app/assets/javascripts/notes/utils.js b/app/assets/javascripts/notes/utils.js new file mode 100644 index 00000000000..e6c2eb06a51 --- /dev/null +++ b/app/assets/javascripts/notes/utils.js @@ -0,0 +1,12 @@ +/* eslint-disable @gitlab/require-i18n-strings */ + +/** + * Tracks snowplow event when User toggles timeline view + * @param {Boolean} enabled that will be send as a property for the event + */ +export const trackToggleTimelineView = enabled => ({ + category: 'Incident Management', + action: 'toggle_incident_comments_into_timeline_view', + label: 'Status', + property: enabled, +}); |