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

Merge branch '233755-update-license-compliance-link' into 'master'

Add docs link for license compliance mr widget

See merge request gitlab-org/gitlab!55474
parents e9e9c028 30b0626d
......@@ -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.licenseComplianceDocsPath = 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"
/>
......
......@@ -63,7 +63,7 @@ export default {
required: false,
default: false,
},
securityApprovalsHelpPagePath: {
licenseComplianceDocsPath: {
type: String,
required: false,
default: '',
......@@ -168,9 +168,9 @@ export default {
<div class="pr-3">
{{ licenseSummaryText }}
<gl-link
v-if="reportContainsBlacklistedLicense && securityApprovalsHelpPagePath"
:href="securityApprovalsHelpPagePath"
class="js-security-approval-help-link"
v-if="reportContainsBlacklistedLicense && licenseComplianceDocsPath"
:href="licenseComplianceDocsPath"
data-testid="security-approval-help-link"
target="_blank"
>
<gl-icon :size="12" name="question" />
......
---
title: Add docs link for license compliance mr widget
merge_request: 55474
author:
type: changed
......@@ -18,7 +18,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 = {
......@@ -54,7 +54,7 @@ describe('License Report MR Widget', () => {
licenseManagementSettingsPath: `${TEST_HOST}/lm_settings`,
fullReportPath: `${TEST_HOST}/path/to/the/full/report`,
apiUrl,
securityApprovalsHelpPagePath,
licenseComplianceDocsPath,
};
const defaultActions = {
......@@ -369,12 +369,13 @@ describe('License Report MR Widget', () => {
});
describe('approval status', () => {
const findSecurityApprovalHelpLink = () => wrapper.find('.js-security-approval-help-link');
const findLicenseComplianceHelpLink = () =>
wrapper.find('[data-testid="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', () => {
......@@ -388,10 +389,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