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