Commit e2e59c68 authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Merge branch '349035-learn-more-link' into 'master'

Add vulnerability training doc link

See merge request gitlab-org/gitlab!82961
parents 8aaf26ce 1d933fc4
...@@ -4,6 +4,7 @@ import { __, s__ } from '~/locale'; ...@@ -4,6 +4,7 @@ import { __, s__ } from '~/locale';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; 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 UserCalloutDismisser from '~/vue_shared/components/user_callout_dismisser.vue'; import UserCalloutDismisser from '~/vue_shared/components/user_callout_dismisser.vue';
import { helpPagePath } from '~/helpers/help_page_helper';
import AutoDevOpsAlert from './auto_dev_ops_alert.vue'; import AutoDevOpsAlert from './auto_dev_ops_alert.vue';
import AutoDevOpsEnabledAlert from './auto_dev_ops_enabled_alert.vue'; import AutoDevOpsEnabledAlert from './auto_dev_ops_enabled_alert.vue';
import { AUTO_DEVOPS_ENABLED_ALERT_DISMISSED_STORAGE_KEY } from './constants'; import { AUTO_DEVOPS_ENABLED_ALERT_DISMISSED_STORAGE_KEY } from './constants';
...@@ -30,6 +31,7 @@ export const i18n = { ...@@ -30,6 +31,7 @@ export const i18n = {
securityTrainingDescription: s__( securityTrainingDescription: s__(
'SecurityConfiguration|Enable security training to help your developers learn how to fix vulnerabilities. Developers can view security training from selected educational providers, relevant to the detected vulnerability.', 'SecurityConfiguration|Enable security training to help your developers learn how to fix vulnerabilities. Developers can view security training from selected educational providers, relevant to the detected vulnerability.',
), ),
securityTrainingDoc: s__('SecurityConfiguration|Learn more about vulnerability training'),
}; };
export default { export default {
...@@ -125,6 +127,9 @@ export default { ...@@ -125,6 +127,9 @@ export default {
}, },
}, },
autoDevopsEnabledAlertStorageKey: AUTO_DEVOPS_ENABLED_ALERT_DISMISSED_STORAGE_KEY, autoDevopsEnabledAlertStorageKey: AUTO_DEVOPS_ENABLED_ALERT_DISMISSED_STORAGE_KEY,
securityTraininDocLink: helpPagePath('user/application_security/vulnerabilities/index', {
anchor: 'enable-security-training-for-vulnerabilities',
}),
}; };
</script> </script>
...@@ -262,6 +267,11 @@ export default { ...@@ -262,6 +267,11 @@ export default {
<p> <p>
{{ $options.i18n.securityTrainingDescription }} {{ $options.i18n.securityTrainingDescription }}
</p> </p>
<p>
<gl-link :href="$options.securityTraininDocLink">{{
$options.i18n.securityTrainingDoc
}}</gl-link>
</p>
</template> </template>
<template #features> <template #features>
<training-provider-list /> <training-provider-list />
......
...@@ -32910,6 +32910,9 @@ msgstr "" ...@@ -32910,6 +32910,9 @@ msgstr ""
msgid "SecurityConfiguration|Immediately begin risk analysis and remediation with application security features. Start with SAST and Secret Detection, available to all plans. Upgrade to Ultimate to get all features, including:" msgid "SecurityConfiguration|Immediately begin risk analysis and remediation with application security features. Start with SAST and Secret Detection, available to all plans. Upgrade to Ultimate to get all features, including:"
msgstr "" msgstr ""
msgid "SecurityConfiguration|Learn more about vulnerability training"
msgstr ""
msgid "SecurityConfiguration|Manage corpus" msgid "SecurityConfiguration|Manage corpus"
msgstr "" msgstr ""
......
import { GlTab, GlTabs } from '@gitlab/ui'; import { GlTab, GlTabs, GlLink } from '@gitlab/ui';
import { mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import { nextTick } from 'vue'; import { nextTick } from 'vue';
import { useLocalStorageSpy } from 'helpers/local_storage_helper'; import { useLocalStorageSpy } from 'helpers/local_storage_helper';
...@@ -107,6 +107,7 @@ describe('App component', () => { ...@@ -107,6 +107,7 @@ describe('App component', () => {
const findUpgradeBanner = () => wrapper.findComponent(UpgradeBanner); const findUpgradeBanner = () => wrapper.findComponent(UpgradeBanner);
const findAutoDevopsAlert = () => wrapper.findComponent(AutoDevopsAlert); const findAutoDevopsAlert = () => wrapper.findComponent(AutoDevopsAlert);
const findAutoDevopsEnabledAlert = () => wrapper.findComponent(AutoDevopsEnabledAlert); const findAutoDevopsEnabledAlert = () => wrapper.findComponent(AutoDevopsEnabledAlert);
const findVulnerabilityManagementTab = () => wrapper.findByTestId('vulnerability-management-tab');
const securityFeaturesMock = [ const securityFeaturesMock = [
{ {
...@@ -454,9 +455,16 @@ describe('App component', () => { ...@@ -454,9 +455,16 @@ describe('App component', () => {
}); });
it('renders security training description', () => { it('renders security training description', () => {
const vulnerabilityManagementTab = wrapper.findByTestId('vulnerability-management-tab'); expect(findVulnerabilityManagementTab().text()).toContain(i18n.securityTrainingDescription);
});
it('renders link to help docs', () => {
const trainingLink = findVulnerabilityManagementTab().findComponent(GlLink);
expect(vulnerabilityManagementTab.text()).toContain(i18n.securityTrainingDescription); expect(trainingLink.text()).toBe('Learn more about vulnerability training');
expect(trainingLink.attributes('href')).toBe(
'/help/user/application_security/vulnerabilities/index#enable-security-training-for-vulnerabilities',
);
}); });
}); });
......
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