Commit 57393615 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'swimlanes-snowplow' into 'master'

Add snowplow tracking to swimlanes

See merge request gitlab-org/gitlab!42327
parents 8668b83e 36443760
...@@ -2,12 +2,16 @@ ...@@ -2,12 +2,16 @@
import { mapState, mapActions } from 'vuex'; import { mapState, mapActions } from 'vuex';
import { GlDropdown, GlDropdownItem } from '@gitlab/ui'; import { GlDropdown, 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