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 { ...@@ -241,6 +241,7 @@ export default class MergeRequestStore {
this.reviewingDocsPath = data.reviewing_and_managing_merge_requests_docs_path; this.reviewingDocsPath = data.reviewing_and_managing_merge_requests_docs_path;
this.ciEnvironmentsStatusPath = data.ci_environments_status_path; this.ciEnvironmentsStatusPath = data.ci_environments_status_path;
this.securityApprovalsHelpPagePath = data.security_approvals_help_page_path; this.securityApprovalsHelpPagePath = data.security_approvals_help_page_path;
this.licenseComplianceDocsPath = data.license_compliance_docs_path;
this.eligibleApproversDocsPath = data.eligible_approvers_docs_path; this.eligibleApproversDocsPath = data.eligible_approvers_docs_path;
this.mergeImmediatelyDocsPath = data.merge_immediately_docs_path; this.mergeImmediatelyDocsPath = data.merge_immediately_docs_path;
this.approvalsHelpPath = data.approvals_help_path; this.approvalsHelpPath = data.approvals_help_path;
......
...@@ -8,6 +8,7 @@ ...@@ -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.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.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.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.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.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')}'; window.gl.mrWidgetData.pipelines_empty_svg_path = '#{image_path('illustrations/pipelines_empty.svg')}';
......
...@@ -372,7 +372,7 @@ export default { ...@@ -372,7 +372,7 @@ export default {
:can-manage-licenses="mr.licenseScanning.can_manage_licenses" :can-manage-licenses="mr.licenseScanning.can_manage_licenses"
:full-report-path="mr.licenseScanning.full_report_path" :full-report-path="mr.licenseScanning.full_report_path"
:license-management-settings-path="mr.licenseScanning.settings_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" report-section-class="mr-widget-border-top"
/> />
......
...@@ -63,7 +63,7 @@ export default { ...@@ -63,7 +63,7 @@ export default {
required: false, required: false,
default: false, default: false,
}, },
securityApprovalsHelpPagePath: { licenseComplianceDocsPath: {
type: String, type: String,
required: false, required: false,
default: '', default: '',
...@@ -168,9 +168,9 @@ export default { ...@@ -168,9 +168,9 @@ export default {
<div class="pr-3"> <div class="pr-3">
{{ licenseSummaryText }} {{ licenseSummaryText }}
<gl-link <gl-link
v-if="reportContainsBlacklistedLicense && securityApprovalsHelpPagePath" v-if="reportContainsBlacklistedLicense && licenseComplianceDocsPath"
:href="securityApprovalsHelpPagePath" :href="licenseComplianceDocsPath"
class="js-security-approval-help-link" data-testid="security-approval-help-link"
target="_blank" target="_blank"
> >
<gl-icon :size="12" name="question" /> <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); ...@@ -18,7 +18,7 @@ localVue.use(Vuex);
describe('License Report MR Widget', () => { describe('License Report MR Widget', () => {
const apiUrl = `${TEST_HOST}/license_management`; 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; let wrapper;
const defaultState = { const defaultState = {
...@@ -54,7 +54,7 @@ describe('License Report MR Widget', () => { ...@@ -54,7 +54,7 @@ describe('License Report MR Widget', () => {
licenseManagementSettingsPath: `${TEST_HOST}/lm_settings`, licenseManagementSettingsPath: `${TEST_HOST}/lm_settings`,
fullReportPath: `${TEST_HOST}/path/to/the/full/report`, fullReportPath: `${TEST_HOST}/path/to/the/full/report`,
apiUrl, apiUrl,
securityApprovalsHelpPagePath, licenseComplianceDocsPath,
}; };
const defaultActions = { const defaultActions = {
...@@ -369,12 +369,13 @@ describe('License Report MR Widget', () => { ...@@ -369,12 +369,13 @@ describe('License Report MR Widget', () => {
}); });
describe('approval status', () => { 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', () => { it('does not show a link to security approval help page if report does not contain blacklisted licenses', () => {
mountComponent(); 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', () => { it('shows a link to security approval help page if report contains blacklisted licenses', () => {
...@@ -388,10 +389,10 @@ describe('License Report MR Widget', () => { ...@@ -388,10 +389,10 @@ describe('License Report MR Widget', () => {
getters, getters,
}); });
const securityApprovalHelpLink = findSecurityApprovalHelpLink(); const licenseComplianceHelpLink = findLicenseComplianceHelpLink();
expect(findSecurityApprovalHelpLink().exists()).toBe(true); expect(findLicenseComplianceHelpLink().exists()).toBe(true);
expect(securityApprovalHelpLink.attributes('href')).toBe(securityApprovalsHelpPagePath); 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