diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-13 15:08:41 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-13 15:08:41 +0300 |
commit | 6e91fbf77476011a7fd86ca3467aad6d7b110ff3 (patch) | |
tree | cace6db4e7ebef8b15a6a7fc8fbe8ff0d89bea90 /app/assets/javascripts/incidents | |
parent | 15ae4a8da83661f2b714d804721001a53b354d28 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/incidents')
-rw-r--r-- | app/assets/javascripts/incidents/components/incidents_list.vue | 10 | ||||
-rw-r--r-- | app/assets/javascripts/incidents/constants.js | 9 |
2 files changed, 18 insertions, 1 deletions
diff --git a/app/assets/javascripts/incidents/components/incidents_list.vue b/app/assets/javascripts/incidents/components/incidents_list.vue index 061a5becbed..50f2136325d 100644 --- a/app/assets/javascripts/incidents/components/incidents_list.vue +++ b/app/assets/javascripts/incidents/components/incidents_list.vue @@ -16,6 +16,7 @@ import { GlEmptyState, } from '@gitlab/ui'; import Api from '~/api'; +import Tracking from '~/tracking'; import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue'; import FilteredSearchBar from '~/vue_shared/components/filtered_search_bar/filtered_search_bar_root.vue'; import AuthorToken from '~/vue_shared/components/filtered_search_bar/tokens/author_token.vue'; @@ -41,6 +42,7 @@ import { TH_SEVERITY_TEST_ID, TH_PUBLISHED_TEST_ID, INCIDENT_DETAILS_PATH, + trackIncidentCreateNewOptions, } from '../constants'; const tdClass = @@ -58,6 +60,7 @@ const initialPaginationState = { }; export default { + trackIncidentCreateNewOptions, i18n: I18N, statusTabs: INCIDENT_STATUS_TABS, fields: [ @@ -335,6 +338,11 @@ export default { navigateToIncidentDetails({ iid }) { return visitUrl(joinPaths(this.issuePath, INCIDENT_DETAILS_PATH, iid)); }, + navigateToCreateNewIncident() { + const { category, action } = this.$options.trackIncidentCreateNewOptions; + Tracking.event(category, action); + this.redirecting = true; + }, handlePageChange(page) { const { startCursor, endCursor } = this.incidents.pageInfo; @@ -458,7 +466,7 @@ export default { category="primary" variant="success" :href="newIncidentPath" - @click="redirecting = true" + @click="navigateToCreateNewIncident" > {{ $options.i18n.createIncidentBtnLabel }} </gl-button> diff --git a/app/assets/javascripts/incidents/constants.js b/app/assets/javascripts/incidents/constants.js index 797439495e3..bdabf1c3e42 100644 --- a/app/assets/javascripts/incidents/constants.js +++ b/app/assets/javascripts/incidents/constants.js @@ -1,3 +1,4 @@ +/* eslint-disable @gitlab/require-i18n-strings */ import { s__, __ } from '~/locale'; export const I18N = { @@ -34,6 +35,14 @@ export const INCIDENT_STATUS_TABS = [ }, ]; +/** + * Tracks snowplow event when user clicks create new incident + */ +export const trackIncidentCreateNewOptions = { + category: 'Incident Management', + action: 'create_incident_button_clicks', +}; + export const DEFAULT_PAGE_SIZE = 20; export const TH_CREATED_AT_TEST_ID = { 'data-testid': 'incident-management-created-at-sort' }; export const TH_SEVERITY_TEST_ID = { 'data-testid': 'incident-management-severity-sort' }; |