Commit ce662f18 authored by Fernando's avatar Fernando

Add docs link for license compliance mr widget

* Update link to point to docs
parent b9662918
......@@ -241,6 +241,7 @@ export default class MergeRequestStore {
this.reviewingDocsPath = data.reviewing_and_managing_merge_requests_docs_path;
this.ciEnvironmentsStatusPath = data.ci_environments_status_path;
this.securityApprovalsHelpPagePath = data.security_approvals_help_page_path;
this.licenseCompliaceDocsPath = data.license_compliance_docs_path;
this.eligibleApproversDocsPath = data.eligible_approvers_docs_path;
this.mergeImmediatelyDocsPath = data.merge_immediately_docs_path;
this.approvalsHelpPath = data.approvals_help_path;
......
......@@ -8,6 +8,7 @@
window.gl.mrWidgetData.mr_troubleshooting_docs_path = '#{help_page_path('user/project/merge_requests/reviewing_and_managing_merge_requests.md', anchor: 'troubleshooting')}';
window.gl.mrWidgetData.pipeline_must_succeed_docs_path = '#{help_page_path('user/project/merge_requests/merge_when_pipeline_succeeds.md', anchor: 'only-allow-merge-requests-to-be-merged-if-the-pipeline-succeeds')}';
window.gl.mrWidgetData.security_approvals_help_page_path = '#{help_page_path('user/application_security/index.md', anchor: 'security-approvals-in-merge-requests')}';
window.gl.mrWidgetData.license_compliance_docs_path = '#{help_page_path('user/compliance/license_compliance/index.md', anchor: 'policies')}';
window.gl.mrWidgetData.eligible_approvers_docs_path = '#{help_page_path('user/project/merge_requests/merge_request_approvals', anchor: 'eligible-approvers')}';
window.gl.mrWidgetData.approvals_help_path = '#{help_page_path("user/project/merge_requests/merge_request_approvals")}';
window.gl.mrWidgetData.pipelines_empty_svg_path = '#{image_path('illustrations/pipelines_empty.svg')}';
......
......@@ -372,7 +372,7 @@ export default {
:can-manage-licenses="mr.licenseScanning.can_manage_licenses"
:full-report-path="mr.licenseScanning.full_report_path"
:license-management-settings-path="mr.licenseScanning.settings_path"
:security-approvals-help-page-path="mr.securityApprovalsHelpPagePath"
:license-compliance-docs-path="mr.licenseComplianceDocsPath"
report-section-class="mr-widget-border-top"
/>
......
......@@ -62,7 +62,7 @@ export default {
required: false,
default: false,
},
securityApprovalsHelpPagePath: {
licenseComplianceDocsPath: {
type: String,
required: false,
default: '',
......@@ -167,8 +167,8 @@ export default {
<div class="pr-3">
{{ licenseSummaryText }}
<gl-link
v-if="reportContainsBlacklistedLicense && securityApprovalsHelpPagePath"
:href="securityApprovalsHelpPagePath"
v-if="reportContainsBlacklistedLicense && licenseComplianceDocsPath"
:href="licenseComplianceDocsPath"
class="js-security-approval-help-link"
target="_blank"
>
......
......@@ -17,7 +17,7 @@ localVue.use(Vuex);
describe('License Report MR Widget', () => {
const apiUrl = `${TEST_HOST}/license_management`;
const securityApprovalsHelpPagePath = `${TEST_HOST}/path/to/security/approvals/help`;
const licenseComplianceDocsPath = `${TEST_HOST}/path/to/security/approvals/help`;
let wrapper;
const defaultState = {
......@@ -53,7 +53,7 @@ describe('License Report MR Widget', () => {
licenseManagementSettingsPath: `${TEST_HOST}/lm_settings`,
fullReportPath: `${TEST_HOST}/path/to/the/full/report`,
apiUrl,
securityApprovalsHelpPagePath,
licenseComplianceDocsPath,
};
const defaultActions = {
......@@ -338,12 +338,12 @@ describe('License Report MR Widget', () => {
});
describe('approval status', () => {
const findSecurityApprovalHelpLink = () => wrapper.find('.js-security-approval-help-link');
const findLicenseComplianceHelpLink = () => wrapper.find('.js-security-approval-help-link');
it('does not show a link to security approval help page if report does not contain blacklisted licenses', () => {
mountComponent();
expect(findSecurityApprovalHelpLink().exists()).toBe(false);
expect(findLicenseComplianceHelpLink().exists()).toBe(false);
});
it('shows a link to security approval help page if report contains blacklisted licenses', () => {
......@@ -357,10 +357,10 @@ describe('License Report MR Widget', () => {
getters,
});
const securityApprovalHelpLink = findSecurityApprovalHelpLink();
const licenseComplianceHelpLink = findLicenseComplianceHelpLink();
expect(findSecurityApprovalHelpLink().exists()).toBe(true);
expect(securityApprovalHelpLink.attributes('href')).toBe(securityApprovalsHelpPagePath);
expect(findLicenseComplianceHelpLink().exists()).toBe(true);
expect(licenseComplianceHelpLink.attributes('href')).toBe(licenseComplianceDocsPath);
});
});
});
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