Commit 301666c5 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'issue_335363' into 'master'

Refactoring string literals used for snowplow tracking in the sidebar component

See merge request gitlab-org/gitlab!65646
parents 82d57c8d de218bbe
...@@ -4,7 +4,7 @@ import Vue from 'vue'; ...@@ -4,7 +4,7 @@ import Vue from 'vue';
import createFlash from '~/flash'; import createFlash from '~/flash';
import { __, sprintf } from '~/locale'; import { __, sprintf } from '~/locale';
import SidebarEditableItem from '~/sidebar/components/sidebar_editable_item.vue'; import SidebarEditableItem from '~/sidebar/components/sidebar_editable_item.vue';
import { confidentialityQueries } from '~/sidebar/constants'; import { confidentialityQueries, Tracking } from '~/sidebar/constants';
import SidebarConfidentialityContent from './sidebar_confidentiality_content.vue'; import SidebarConfidentialityContent from './sidebar_confidentiality_content.vue';
import SidebarConfidentialityForm from './sidebar_confidentiality_form.vue'; import SidebarConfidentialityForm from './sidebar_confidentiality_form.vue';
...@@ -18,8 +18,8 @@ const hideDropdownEvent = new CustomEvent('hiddenGlDropdown', { ...@@ -18,8 +18,8 @@ const hideDropdownEvent = new CustomEvent('hiddenGlDropdown', {
export default { export default {
tracking: { tracking: {
event: 'click_edit_button', event: Tracking.editEvent,
label: 'right_sidebar', label: Tracking.rightSidebarLabel,
property: 'confidentiality', property: 'confidentiality',
}, },
components: { components: {
......
...@@ -5,7 +5,13 @@ import { IssuableType } from '~/issue_show/constants'; ...@@ -5,7 +5,13 @@ import { IssuableType } from '~/issue_show/constants';
import { dateInWords, formatDate, parsePikadayDate } from '~/lib/utils/datetime_utility'; import { dateInWords, formatDate, parsePikadayDate } from '~/lib/utils/datetime_utility';
import { __, sprintf } from '~/locale'; import { __, sprintf } from '~/locale';
import SidebarEditableItem from '~/sidebar/components/sidebar_editable_item.vue'; import SidebarEditableItem from '~/sidebar/components/sidebar_editable_item.vue';
import { dateFields, dateTypes, dueDateQueries, startDateQueries } from '~/sidebar/constants'; import {
dateFields,
dateTypes,
dueDateQueries,
startDateQueries,
Tracking,
} from '~/sidebar/constants';
import SidebarFormattedDate from './sidebar_formatted_date.vue'; import SidebarFormattedDate from './sidebar_formatted_date.vue';
import SidebarInheritDate from './sidebar_inherit_date.vue'; import SidebarInheritDate from './sidebar_inherit_date.vue';
...@@ -15,8 +21,8 @@ const hideDropdownEvent = new CustomEvent('hiddenGlDropdown', { ...@@ -15,8 +21,8 @@ const hideDropdownEvent = new CustomEvent('hiddenGlDropdown', {
export default { export default {
tracking: { tracking: {
event: 'click_edit_button', event: Tracking.editEvent,
label: 'right_sidebar', label: Tracking.rightSidebarLabel,
}, },
directives: { directives: {
GlTooltip: GlTooltipDirective, GlTooltip: GlTooltipDirective,
......
...@@ -16,12 +16,13 @@ import { IssuableType } from '~/issue_show/constants'; ...@@ -16,12 +16,13 @@ import { IssuableType } from '~/issue_show/constants';
import { __, s__, sprintf } from '~/locale'; import { __, s__, sprintf } from '~/locale';
import SidebarEditableItem from '~/sidebar/components/sidebar_editable_item.vue'; import SidebarEditableItem from '~/sidebar/components/sidebar_editable_item.vue';
import { import {
Tracking,
IssuableAttributeState, IssuableAttributeState,
IssuableAttributeType, IssuableAttributeType,
issuableAttributesQueries, issuableAttributesQueries,
noAttributeId, noAttributeId,
defaultEpicSort, defaultEpicSort,
} from '../constants'; } from '~/sidebar/constants';
export default { export default {
noAttributeId, noAttributeId,
...@@ -148,8 +149,8 @@ export default { ...@@ -148,8 +149,8 @@ export default {
currentAttribute: null, currentAttribute: null,
attributesList: [], attributesList: [],
tracking: { tracking: {
label: 'right_sidebar', event: Tracking.editEvent,
event: 'click_edit_button', label: Tracking.rightSidebarLabel,
property: this.issuableAttribute, property: this.issuableAttribute,
}, },
}; };
......
...@@ -5,15 +5,15 @@ import { IssuableType } from '~/issue_show/constants'; ...@@ -5,15 +5,15 @@ import { IssuableType } from '~/issue_show/constants';
import { isLoggedIn } from '~/lib/utils/common_utils'; import { isLoggedIn } from '~/lib/utils/common_utils';
import { __, sprintf } from '~/locale'; import { __, sprintf } from '~/locale';
import SidebarEditableItem from '~/sidebar/components/sidebar_editable_item.vue'; import SidebarEditableItem from '~/sidebar/components/sidebar_editable_item.vue';
import { subscribedQueries } from '~/sidebar/constants'; import { subscribedQueries, Tracking } from '~/sidebar/constants';
const ICON_ON = 'notifications'; const ICON_ON = 'notifications';
const ICON_OFF = 'notifications-off'; const ICON_OFF = 'notifications-off';
export default { export default {
tracking: { tracking: {
event: 'click_edit_button', event: Tracking.editEvent,
label: 'right_sidebar', label: Tracking.rightSidebarLabel,
property: 'subscriptions', property: 'subscriptions',
}, },
directives: { directives: {
......
...@@ -130,6 +130,11 @@ export const subscribedQueries = { ...@@ -130,6 +130,11 @@ export const subscribedQueries = {
}, },
}; };
export const Tracking = {
editEvent: 'click_edit_button',
rightSidebarLabel: 'right_sidebar',
};
export const timeTrackingQueries = { export const timeTrackingQueries = {
[IssuableType.Issue]: { [IssuableType.Issue]: {
query: issueTimeTrackingQuery, query: issueTimeTrackingQuery,
......
...@@ -10,13 +10,14 @@ import { ...@@ -10,13 +10,14 @@ import {
import createFlash from '~/flash'; import createFlash from '~/flash';
import { __, sprintf } from '~/locale'; import { __, sprintf } from '~/locale';
import SidebarEditableItem from '~/sidebar/components/sidebar_editable_item.vue'; import SidebarEditableItem from '~/sidebar/components/sidebar_editable_item.vue';
import { Tracking } from '~/sidebar/constants';
import autofocusonshow from '~/vue_shared/directives/autofocusonshow'; import autofocusonshow from '~/vue_shared/directives/autofocusonshow';
import { weightQueries, MAX_DISPLAY_WEIGHT } from '../../constants'; import { weightQueries, MAX_DISPLAY_WEIGHT } from '../../constants';
export default { export default {
tracking: { tracking: {
event: 'click_edit_button', event: Tracking.editEvent,
label: 'right_sidebar', label: Tracking.rightSidebarLabel,
property: 'weight', property: 'weight',
}, },
components: { components: {
......
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