Commit b7f58b96 authored by Savas Vedova's avatar Savas Vedova

Merge branch...

Merge branch '350439-add-promotion-callout-for-security-training-feature-to-vulnerability-report-ui-only' into 'master'

Add security-training promo banner to vuln report

See merge request gitlab-org/gitlab!78978
parents 4ec6d4d4 0666f058
...@@ -5,6 +5,7 @@ import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; ...@@ -5,6 +5,7 @@ import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import LocalStorageSync from '~/vue_shared/components/local_storage_sync.vue'; import LocalStorageSync from '~/vue_shared/components/local_storage_sync.vue';
import { parseBoolean } from '~/lib/utils/common_utils'; import { parseBoolean } from '~/lib/utils/common_utils';
import { translateScannerNames } from '~/security_configuration/utils'; import { translateScannerNames } from '~/security_configuration/utils';
import SecurityTrainingPromo from 'ee/security_dashboard/components/shared/security_training_promo.vue';
import ReportNotConfiguredProject from '../shared/empty_states/report_not_configured_project.vue'; import ReportNotConfiguredProject from '../shared/empty_states/report_not_configured_project.vue';
import VulnerabilityReportTabs from '../shared/vulnerability_report/vulnerability_report_tabs.vue'; import VulnerabilityReportTabs from '../shared/vulnerability_report/vulnerability_report_tabs.vue';
import projectVulnerabilitiesQuery from '../../graphql/queries/project_vulnerabilities.query.graphql'; import projectVulnerabilitiesQuery from '../../graphql/queries/project_vulnerabilities.query.graphql';
...@@ -21,6 +22,7 @@ export default { ...@@ -21,6 +22,7 @@ export default {
AutoFixUserCallout, AutoFixUserCallout,
ProjectPipelineStatus, ProjectPipelineStatus,
VulnerabilityReportTabs, VulnerabilityReportTabs,
SecurityTrainingPromo,
}, },
mixins: [glFeatureFlagsMixin()], mixins: [glFeatureFlagsMixin()],
inject: ['fullPath', 'pipeline', 'autoFixDocumentation'], inject: ['fullPath', 'pipeline', 'autoFixDocumentation'],
...@@ -106,6 +108,8 @@ export default { ...@@ -106,6 +108,8 @@ export default {
@close="closeAutoFixUserCallout" @close="closeAutoFixUserCallout"
/> />
<security-training-promo v-if="glFeatures.secureVulnerabilityTraining" class="gl-mt-5" />
<vulnerability-report-tabs :query="$options.projectVulnerabilitiesQuery"> <vulnerability-report-tabs :query="$options.projectVulnerabilitiesQuery">
<template #header-development> <template #header-development>
<project-pipeline-status :pipeline="pipeline" /> <project-pipeline-status :pipeline="pipeline" />
......
...@@ -8,6 +8,7 @@ module Projects ...@@ -8,6 +8,7 @@ module Projects
before_action do before_action do
push_frontend_feature_flag(:vulnerability_management_survey, type: :ops, default_enabled: :yaml) push_frontend_feature_flag(:vulnerability_management_survey, type: :ops, default_enabled: :yaml)
push_frontend_feature_flag(:secure_vulnerability_training, @project, default_enabled: :yaml)
end end
feature_category :vulnerability_management feature_category :vulnerability_management
......
...@@ -9,6 +9,7 @@ import VulnerabilityReportTabs from 'ee/security_dashboard/components/shared/vul ...@@ -9,6 +9,7 @@ import VulnerabilityReportTabs from 'ee/security_dashboard/components/shared/vul
import ProjectPipelineStatus from 'ee/security_dashboard/components/shared/project_pipeline_status.vue'; import ProjectPipelineStatus from 'ee/security_dashboard/components/shared/project_pipeline_status.vue';
import SecurityScannerAlert from 'ee/security_dashboard/components/project/security_scanner_alert.vue'; import SecurityScannerAlert from 'ee/security_dashboard/components/project/security_scanner_alert.vue';
import securityScannersQuery from 'ee/security_dashboard/graphql/queries/project_security_scanners.query.graphql'; import securityScannersQuery from 'ee/security_dashboard/graphql/queries/project_security_scanners.query.graphql';
import SecurityTrainingPromo from 'ee/security_dashboard/components/shared/security_training_promo.vue';
import AutoFixUserCallout from 'ee/security_dashboard/components/shared/auto_fix_user_callout.vue'; import AutoFixUserCallout from 'ee/security_dashboard/components/shared/auto_fix_user_callout.vue';
import { DASHBOARD_TYPES } from 'ee/security_dashboard/store/constants'; import { DASHBOARD_TYPES } from 'ee/security_dashboard/store/constants';
import LocalStorageSync from '~/vue_shared/components/local_storage_sync.vue'; import LocalStorageSync from '~/vue_shared/components/local_storage_sync.vue';
...@@ -41,6 +42,7 @@ describe('Project vulnerability report app component', () => { ...@@ -41,6 +42,7 @@ describe('Project vulnerability report app component', () => {
pipeline = { id: 1 }, pipeline = { id: 1 },
securityScanners, securityScanners,
securityAutoFix = false, securityAutoFix = false,
secureVulnerabilityTraining = true,
} = {}) => { } = {}) => {
wrapper = shallowMount(ProjectVulnerabilityReport, { wrapper = shallowMount(ProjectVulnerabilityReport, {
localVue, localVue,
...@@ -53,7 +55,7 @@ describe('Project vulnerability report app component', () => { ...@@ -53,7 +55,7 @@ describe('Project vulnerability report app component', () => {
autoFixDocumentation: '#', autoFixDocumentation: '#',
pipeline, pipeline,
dashboardType: DASHBOARD_TYPES.PROJECT, dashboardType: DASHBOARD_TYPES.PROJECT,
glFeatures: { securityAutoFix }, glFeatures: { securityAutoFix, secureVulnerabilityTraining },
}, },
stubs: { stubs: {
VulnerabilityReportTabs, VulnerabilityReportTabs,
...@@ -198,4 +200,20 @@ describe('Project vulnerability report app component', () => { ...@@ -198,4 +200,20 @@ describe('Project vulnerability report app component', () => {
expect(findAutoFixUserCallout().exists()).toBe(false); expect(findAutoFixUserCallout().exists()).toBe(false);
}); });
}); });
describe('security training promotion', () => {
it('shows user callout', () => {
createWrapper();
expect(wrapper.findComponent(SecurityTrainingPromo).exists()).toBe(true);
});
describe('with the "secureVulnerabilityTraining" feature flag disabled', () => {
it('does not show a user callout', () => {
createWrapper({ secureVulnerabilityTraining: false });
expect(wrapper.findComponent(SecurityTrainingPromo).exists()).toBe(false);
});
});
});
}); });
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