Commit 78031069 authored by Dave Pisek's avatar Dave Pisek

Review feedback: add project as prop to click-track

parent 9162fd34
......@@ -14,7 +14,7 @@ export default {
UserCalloutDismisser,
},
mixins: [Tracking.mixin()],
inject: ['securityConfigurationPath'],
inject: ['securityConfigurationPath', 'projectFullPath'],
i18n: {
title: __('Reduce risk and triage fewer vulnerabilities with security training'),
buttonText: __('Enable security training'),
......@@ -31,6 +31,7 @@ export default {
trackCTAClick() {
this.track(TRACK_PROMOTION_BANNER_CTA_CLICK_ACTION, {
label: TRACK_PROMOTION_BANNER_CTA_CLICK_LABEL,
property: this.projectFullPath,
});
},
},
......
......@@ -33,6 +33,7 @@ export default (el, dashboardType) => {
dashboardDocumentation: el.dataset.dashboardDocumentation,
emptyStateSvgPath: el.dataset.emptyStateSvgPath,
groupFullPath: el.dataset.groupFullPath,
projectFullPath: el.dataset.projectFullPath,
securityConfigurationPath: el.dataset.securityConfigurationPath,
surveyRequestSvgPath: el.dataset.surveyRequestSvgPath,
securityDashboardHelpPath: el.dataset.securityDashboardHelpPath,
......
......@@ -55,6 +55,7 @@ describe('Project Security Dashboard component', () => {
provide: {
// To be consumed by SecurityDashboardLayout
sbomSurveySvgPath: '/',
projectFullPath: 'namespace/project',
glFeatures: {
secureVulnerabilityTraining: secureVulnerabilityTrainingEnabled,
},
......
......@@ -10,6 +10,7 @@ import {
const SECURITY_CONFIGURATION_PATH = 'foo/bar';
const VULNERABILITY_MANAGEMENT_TAB_NAME = 'vulnerability-management';
const PROJECT_FULL_PATH = 'namespace/project';
describe('Security training promo component', () => {
let wrapper;
......@@ -18,6 +19,7 @@ describe('Security training promo component', () => {
const createWrapper = ({ shouldShowCallout = true } = {}) =>
shallowMount(SecurityTrainingPromo, {
provide: {
projectFullPath: PROJECT_FULL_PATH,
securityConfigurationPath: SECURITY_CONFIGURATION_PATH,
},
stubs: {
......@@ -94,6 +96,7 @@ describe('Security training promo component', () => {
expect(trackingSpy).toHaveBeenCalledWith(undefined, TRACK_PROMOTION_BANNER_CTA_CLICK_ACTION, {
label: TRACK_PROMOTION_BANNER_CTA_CLICK_LABEL,
property: PROJECT_FULL_PATH,
});
});
});
......
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