Commit 36443760 authored by Rajat Jain's avatar Rajat Jain

Add snowplow tracking to swimlanes

parent 4d8bc1ac
...@@ -2,12 +2,16 @@ ...@@ -2,12 +2,16 @@
import { mapState, mapActions } from 'vuex'; import { mapState, mapActions } from 'vuex';
import { GlNewDropdown as GlDropdown, GlNewDropdownItem as GlDropdownItem } from '@gitlab/ui'; import { GlNewDropdown as GlDropdown, GlNewDropdownItem as GlDropdownItem } from '@gitlab/ui';
import { __ } from '~/locale'; import { __ } from '~/locale';
import Tracking from '~/tracking';
const trackingMixin = Tracking.mixin();
export default { export default {
components: { components: {
GlDropdown, GlDropdown,
GlDropdownItem, GlDropdownItem,
}, },
mixins: [trackingMixin],
computed: { computed: {
...mapState(['isShowingEpicsSwimlanes']), ...mapState(['isShowingEpicsSwimlanes']),
...@@ -25,6 +29,19 @@ export default { ...@@ -25,6 +29,19 @@ export default {
...mapActions(['toggleEpicSwimlanes']), ...mapActions(['toggleEpicSwimlanes']),
onToggle() { onToggle() {
// Track toggle event
this.track('click_toggle_swimlanes_button', {
label: 'toggle_swimlanes',
property: this.isShowingEpicsSwimlanes ? 'off' : 'on',
});
// Track if the board has swimlane active
if (!this.isShowingEpicsSwimlanes) {
this.track('click_toggle_swimlanes_button', {
label: 'swimlanes_active',
});
}
this.toggleEpicSwimlanes(); this.toggleEpicSwimlanes();
}, },
}, },
...@@ -50,13 +67,13 @@ export default { ...@@ -50,13 +67,13 @@ export default {
<gl-dropdown-item <gl-dropdown-item
:is-check-item="true" :is-check-item="true"
:is-checked="!isShowingEpicsSwimlanes" :is-checked="!isShowingEpicsSwimlanes"
@click="toggleEpicSwimlanes()" @click="onToggle()"
>{{ groupByNoneLabel }}</gl-dropdown-item >{{ groupByNoneLabel }}</gl-dropdown-item
> >
<gl-dropdown-item <gl-dropdown-item
:is-check-item="true" :is-check-item="true"
:is-checked="isShowingEpicsSwimlanes" :is-checked="isShowingEpicsSwimlanes"
@click="toggleEpicSwimlanes()" @click="onToggle()"
>{{ groupByEpicLabel }}</gl-dropdown-item >{{ groupByEpicLabel }}</gl-dropdown-item
> >
</gl-dropdown> </gl-dropdown>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment