Commit 8a185ce3 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'rj-events' into 'master'

Add tracking to epic boards

See merge request gitlab-org/gitlab!63765
parents a26b5814 650f6fb2
<script> <script>
import { GlButton } from '@gitlab/ui'; import { GlButton } from '@gitlab/ui';
import { mapActions } from 'vuex'; import { mapActions } from 'vuex';
import Tracking from '~/tracking';
export default { export default {
components: { components: {
GlButton, GlButton,
}, },
mixins: [Tracking.mixin()],
methods: { methods: {
...mapActions(['setAddColumnFormVisibility']), ...mapActions(['setAddColumnFormVisibility']),
handleClick() {
this.setAddColumnFormVisibility(true);
this.track('click_button', { label: 'create_list' });
},
}, },
}; };
</script> </script>
<template> <template>
<div class="gl-ml-3 gl-display-flex gl-align-items-center" data-testid="boards-create-list"> <div class="gl-ml-3 gl-display-flex gl-align-items-center" data-testid="boards-create-list">
<gl-button variant="confirm" @click="setAddColumnFormVisibility(true)" <gl-button variant="confirm" @click="handleClick">{{ __('Create list') }} </gl-button>
>{{ __('Create list') }}
</gl-button>
</div> </div>
</template> </template>
<script> <script>
import { mapActions, mapState } from 'vuex'; import { mapActions, mapState } from 'vuex';
import Tracking from '~/tracking';
import BoardCardInner from './board_card_inner.vue'; import BoardCardInner from './board_card_inner.vue';
export default { export default {
...@@ -7,6 +8,7 @@ export default { ...@@ -7,6 +8,7 @@ export default {
components: { components: {
BoardCardInner, BoardCardInner,
}, },
mixins: [Tracking.mixin()],
props: { props: {
list: { list: {
type: Object, type: Object,
...@@ -58,6 +60,7 @@ export default { ...@@ -58,6 +60,7 @@ export default {
this.toggleBoardItemMultiSelection(this.item); this.toggleBoardItemMultiSelection(this.item);
} else { } else {
this.toggleBoardItem({ boardItem: this.item }); this.toggleBoardItem({ boardItem: this.item });
this.track('click_card', { label: 'right_sidebar' });
} }
}, },
}, },
......
...@@ -5,6 +5,7 @@ import { mapActions, mapGetters, mapState } from 'vuex'; ...@@ -5,6 +5,7 @@ import { mapActions, mapGetters, mapState } from 'vuex';
import { sortableStart, sortableEnd } from '~/boards/mixins/sortable_default_options'; import { sortableStart, sortableEnd } from '~/boards/mixins/sortable_default_options';
import { sprintf, __ } from '~/locale'; import { sprintf, __ } from '~/locale';
import defaultSortableConfig from '~/sortable/sortable_config'; import defaultSortableConfig from '~/sortable/sortable_config';
import Tracking from '~/tracking';
import eventHub from '../eventhub'; import eventHub from '../eventhub';
import BoardCard from './board_card.vue'; import BoardCard from './board_card.vue';
import BoardNewIssue from './board_new_issue.vue'; import BoardNewIssue from './board_new_issue.vue';
...@@ -23,6 +24,7 @@ export default { ...@@ -23,6 +24,7 @@ export default {
GlLoadingIcon, GlLoadingIcon,
GlIntersectionObserver, GlIntersectionObserver,
}, },
mixins: [Tracking.mixin()],
inject: { inject: {
canAdminList: { canAdminList: {
default: false, default: false,
...@@ -155,6 +157,7 @@ export default { ...@@ -155,6 +157,7 @@ export default {
}, },
handleDragOnStart() { handleDragOnStart() {
sortableStart(); sortableStart();
this.track('drag_card', { label: 'board' });
}, },
handleDragOnEnd(params) { handleDragOnEnd(params) {
sortableEnd(); sortableEnd();
......
...@@ -14,6 +14,7 @@ import { isScopedLabel, parseBoolean } from '~/lib/utils/common_utils'; ...@@ -14,6 +14,7 @@ import { isScopedLabel, parseBoolean } from '~/lib/utils/common_utils';
import { BV_HIDE_TOOLTIP } from '~/lib/utils/constants'; import { BV_HIDE_TOOLTIP } from '~/lib/utils/constants';
import { n__, s__, __ } from '~/locale'; import { n__, s__, __ } from '~/locale';
import sidebarEventHub from '~/sidebar/event_hub'; import sidebarEventHub from '~/sidebar/event_hub';
import Tracking from '~/tracking';
import AccessorUtilities from '../../lib/utils/accessor'; import AccessorUtilities from '../../lib/utils/accessor';
import { inactiveId, LIST, ListType } from '../constants'; import { inactiveId, LIST, ListType } from '../constants';
import eventHub from '../eventhub'; import eventHub from '../eventhub';
...@@ -38,6 +39,7 @@ export default { ...@@ -38,6 +39,7 @@ export default {
directives: { directives: {
GlTooltip: GlTooltipDirective, GlTooltip: GlTooltipDirective,
}, },
mixins: [Tracking.mixin()],
inject: { inject: {
boardId: { boardId: {
default: '', default: '',
...@@ -155,6 +157,8 @@ export default { ...@@ -155,6 +157,8 @@ export default {
} }
this.setActiveId({ id: this.list.id, sidebarType: LIST }); this.setActiveId({ id: this.list.id, sidebarType: LIST });
this.track('click_button', { label: 'list_settings' });
}, },
showScopedLabels(label) { showScopedLabels(label) {
return this.scopedLabelsAvailable && isScopedLabel(label); return this.scopedLabelsAvailable && isScopedLabel(label);
...@@ -176,6 +180,11 @@ export default { ...@@ -176,6 +180,11 @@ export default {
// When expanding/collapsing, the tooltip on the caret button sometimes stays open. // When expanding/collapsing, the tooltip on the caret button sometimes stays open.
// Close all tooltips manually to prevent dangling tooltips. // Close all tooltips manually to prevent dangling tooltips.
this.$root.$emit(BV_HIDE_TOOLTIP); this.$root.$emit(BV_HIDE_TOOLTIP);
this.track('click_toggle_button', {
label: 'toggle_list',
property: collapsed ? 'closed' : 'open',
});
}, },
addToLocalStorage() { addToLocalStorage() {
if (AccessorUtilities.isLocalStorageAccessSafe()) { if (AccessorUtilities.isLocalStorageAccessSafe()) {
......
...@@ -6,6 +6,7 @@ import boardsStore from '~/boards/stores/boards_store'; ...@@ -6,6 +6,7 @@ import boardsStore from '~/boards/stores/boards_store';
import { isScopedLabel } from '~/lib/utils/common_utils'; import { isScopedLabel } from '~/lib/utils/common_utils';
import { __ } from '~/locale'; import { __ } from '~/locale';
import eventHub from '~/sidebar/event_hub'; import eventHub from '~/sidebar/event_hub';
import Tracking from '~/tracking';
import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
// NOTE: need to revisit how we handle headerHeight, because we have so many different header and footer options. // NOTE: need to revisit how we handle headerHeight, because we have so many different header and footer options.
...@@ -21,7 +22,7 @@ export default { ...@@ -21,7 +22,7 @@ export default {
BoardSettingsListTypes: () => BoardSettingsListTypes: () =>
import('ee_component/boards/components/board_settings_list_types.vue'), import('ee_component/boards/components/board_settings_list_types.vue'),
}, },
mixins: [glFeatureFlagMixin()], mixins: [glFeatureFlagMixin(), Tracking.mixin()],
inject: ['canAdminList'], inject: ['canAdminList'],
data() { data() {
return { return {
...@@ -72,6 +73,7 @@ export default { ...@@ -72,6 +73,7 @@ export default {
// eslint-disable-next-line no-alert // eslint-disable-next-line no-alert
if (window.confirm(__('Are you sure you want to remove this list?'))) { if (window.confirm(__('Are you sure you want to remove this list?'))) {
if (this.shouldUseGraphQL || this.isEpicBoard) { if (this.shouldUseGraphQL || this.isEpicBoard) {
this.track('click_button', { label: 'remove_list' });
this.removeList(this.activeId); this.removeList(this.activeId);
} else { } else {
this.activeList.destroy(); this.activeList.destroy();
......
...@@ -3,6 +3,7 @@ import { GlButton, GlModalDirective, GlTooltipDirective } from '@gitlab/ui'; ...@@ -3,6 +3,7 @@ import { GlButton, GlModalDirective, GlTooltipDirective } from '@gitlab/ui';
import { formType } from '~/boards/constants'; import { formType } from '~/boards/constants';
import eventHub from '~/boards/eventhub'; import eventHub from '~/boards/eventhub';
import { s__, __ } from '~/locale'; import { s__, __ } from '~/locale';
import Tracking from '~/tracking';
export default { export default {
components: { components: {
...@@ -12,6 +13,7 @@ export default { ...@@ -12,6 +13,7 @@ export default {
GlTooltip: GlTooltipDirective, GlTooltip: GlTooltipDirective,
GlModalDirective, GlModalDirective,
}, },
mixins: [Tracking.mixin()],
props: { props: {
boardsStore: { boardsStore: {
type: Object, type: Object,
...@@ -37,6 +39,7 @@ export default { ...@@ -37,6 +39,7 @@ export default {
}, },
methods: { methods: {
showPage() { showPage() {
this.track('click_button', { label: 'edit_board' });
eventHub.$emit('showBoardModal', formType.edit); eventHub.$emit('showBoardModal', formType.edit);
if (this.boardsStore) { if (this.boardsStore) {
this.boardsStore.showPage(formType.edit); this.boardsStore.showPage(formType.edit);
......
...@@ -5,10 +5,12 @@ ...@@ -5,10 +5,12 @@
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import BoardsSelectorFoss from '~/boards/components/boards_selector.vue'; import BoardsSelectorFoss from '~/boards/components/boards_selector.vue';
import { getIdFromGraphQLId } from '~/graphql_shared/utils'; import { getIdFromGraphQLId } from '~/graphql_shared/utils';
import Tracking from '~/tracking';
import epicBoardsQuery from '../graphql/epic_boards.query.graphql'; import epicBoardsQuery from '../graphql/epic_boards.query.graphql';
export default { export default {
extends: BoardsSelectorFoss, extends: BoardsSelectorFoss,
mixins: [Tracking.mixin()],
computed: { computed: {
...mapGetters(['isEpicBoard']), ...mapGetters(['isEpicBoard']),
showCreate() { showCreate() {
...@@ -32,6 +34,10 @@ export default { ...@@ -32,6 +34,10 @@ export default {
return epicBoardsQuery; return epicBoardsQuery;
}, },
loadBoards(toggleDropdown = true) { loadBoards(toggleDropdown = true) {
if (this.isEpicBoard) {
this.track('click_dropdown', { label: 'board_switcher' });
}
if (toggleDropdown && this.boards.length > 0) { if (toggleDropdown && this.boards.length > 0) {
return; return;
} }
......
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