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