Add a link to site profiles management

The profile conflict alert now contains a link to the site profile
management page.

Changelog: changed
EE: true
parent 2a514bc2
......@@ -8,6 +8,7 @@ export default {
GlSprintf,
GlLink,
},
inject: ['siteProfilesLibraryPath'],
dastSiteValidationDocsPath: helpPagePath('user/application_security/dast/index', {
anchor: 'site-profile-validation',
}),
......@@ -18,6 +19,8 @@ export default {
<gl-alert
:title="s__('DastProfiles|You cannot run an active scan against an unvalidated site.')"
:dismissible="false"
:primary-button-text="s__('DastProfiles|Manage site profiles')"
:primary-button-link="siteProfilesLibraryPath"
variant="danger"
>
<gl-sprintf
......@@ -28,7 +31,7 @@ export default {
"
>
<template #docsLink="{ content }">
<gl-link :href="dastSiteValidationDocsPath">{{ content }}</gl-link>
<gl-link :href="$options.dastSiteValidationDocsPath">{{ content }}</gl-link>
</template>
</gl-sprintf>
</gl-alert>
......
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`ProfileConflictAlert renders properly 1`] = `
<gl-alert-stub
dismisslabel="Dismiss"
primarybuttonlink="/dast_scans#site-profiles"
primarybuttontext="Manage site profiles"
secondarybuttonlink=""
secondarybuttontext=""
title="You cannot run an active scan against an unvalidated site."
variant="danger"
>
You can either choose a passive scan or validate the target site in your chosen site profile.
<gl-link-stub
href="/help/user/application_security/dast/index#site-profile-validation"
>
Learn more about site validation.
</gl-link-stub>
</gl-alert-stub>
`;
import { GlSprintf } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
import ProfileConflictAlert from 'ee/on_demand_scans/components/profile_selector/profile_conflict_alert.vue';
describe('ProfileConflictAlert', () => {
let wrapper;
const createComponent = () => {
wrapper = shallowMount(ProfileConflictAlert, {
stubs: {
GlSprintf,
},
provide: {
siteProfilesLibraryPath: '/dast_scans#site-profiles'
}
});
};
it('renders properly', () => {
createComponent();
expect(wrapper.element).toMatchSnapshot();
});
});
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