debian-mirror-gitlab/app/assets/javascripts/design_management/utils/tracking.js

28 lines
845 B
JavaScript
Raw Normal View History

2020-05-24 23:13:21 +05:30
import Tracking from '~/tracking';
// Tracking Constants
2020-07-28 23:09:34 +05:30
const DESIGN_TRACKING_CONTEXT_SCHEMA = 'iglu:com.gitlab/design_management_context/jsonschema/1-0-0';
2020-05-24 23:13:21 +05:30
const DESIGN_TRACKING_PAGE_NAME = 'projects:issues:design';
2020-07-28 23:09:34 +05:30
const DESIGN_TRACKING_EVENT_NAME = 'view_design';
2020-05-24 23:13:21 +05:30
// eslint-disable-next-line import/prefer-default-export
export function trackDesignDetailView(
referer = '',
owner = '',
designVersion = 1,
latestVersion = false,
) {
2020-07-28 23:09:34 +05:30
Tracking.event(DESIGN_TRACKING_PAGE_NAME, DESIGN_TRACKING_EVENT_NAME, {
label: DESIGN_TRACKING_EVENT_NAME,
context: {
schema: DESIGN_TRACKING_CONTEXT_SCHEMA,
data: {
'design-version-number': designVersion,
'design-is-current-version': latestVersion,
'internal-object-referrer': referer,
'design-collection-owner': owner,
},
},
2020-05-24 23:13:21 +05:30
});
}