Commit 1c9cb31f authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'leipert-rename-license-compliance' into 'master'

Rename License Management to License Compliance

See merge request gitlab-org/gitlab-ee!15163
parents adcef1ce 0d56c8a1
......@@ -12,8 +12,8 @@ export default {
},
LICENSE_APPROVAL_STATUS,
approvalStatusOptions: [
{ value: LICENSE_APPROVAL_STATUS.APPROVED, label: s__('LicenseManagement|Approve') },
{ value: LICENSE_APPROVAL_STATUS.BLACKLISTED, label: s__('LicenseManagement|Blacklist') },
{ value: LICENSE_APPROVAL_STATUS.APPROVED, label: s__('LicenseCompliance|Approve') },
{ value: LICENSE_APPROVAL_STATUS.BLACKLISTED, label: s__('LicenseCompliance|Blacklist') },
],
props: {
managedLicenses: {
......@@ -54,15 +54,15 @@ export default {
<div class="col-sm-6 js-add-license-form">
<div class="form-group">
<label class="label-bold" for="js-license-dropdown">
{{ s__('LicenseManagement|Add licenses manually to approve or blacklist') }}
{{ s__('LicenseCompliance|Add licenses manually to approve or blacklist') }}
</label>
<add-license-form-dropdown
id="js-license-dropdown"
v-model="licenseName"
:placeholder="s__('LicenseManagement|License name')"
:placeholder="s__('LicenseCompliance|License name')"
/>
<div class="invalid-feedback" :class="{ 'd-block': isInvalidLicense }">
{{ s__('LicenseManagement|This license already exists in this project.') }}
{{ s__('LicenseCompliance|This license already exists in this project.') }}
</div>
</div>
<div class="form-group">
......@@ -80,10 +80,10 @@ export default {
</div>
</div>
<gl-button class="js-submit" variant="default" :disabled="submitDisabled" @click="addLicense">
{{ s__('LicenseManagement|Submit') }}
{{ s__('LicenseCompliance|Submit') }}
</gl-button>
<gl-button class="js-cancel" variant="default" @click="closeForm">
{{ s__('LicenseManagement|Cancel') }}
{{ s__('LicenseCompliance|Cancel') }}
</gl-button>
</div>
</template>
......@@ -13,7 +13,7 @@ export default {
const name = `<strong>${_.escape(this.currentLicenseInModal.name)}</strong>`;
return sprintf(
s__('LicenseManagement|You are about to remove the license, %{name}, from this project.'),
s__('LicenseCompliance|You are about to remove the license, %{name}, from this project.'),
{ name },
false,
);
......@@ -27,8 +27,8 @@ export default {
<template>
<gl-modal
id="modal-license-delete-confirmation"
:header-title-text="s__('LicenseManagement|Remove license?')"
:footer-primary-button-text="s__('LicenseManagement|Remove license')"
:header-title-text="s__('LicenseCompliance|Remove license?')"
:footer-primary-button-text="s__('LicenseCompliance|Remove license')"
footer-primary-button-variant="danger"
@cancel="resetLicenseInModal"
@submit="deleteLicense(currentLicenseInModal)"
......
......@@ -29,8 +29,8 @@ export default {
},
},
LICENSE_APPROVAL_STATUS,
[LICENSE_APPROVAL_STATUS.APPROVED]: s__('LicenseManagement|Approved'),
[LICENSE_APPROVAL_STATUS.BLACKLISTED]: s__('LicenseManagement|Blacklisted'),
[LICENSE_APPROVAL_STATUS.APPROVED]: s__('LicenseCompliance|Approved'),
[LICENSE_APPROVAL_STATUS.BLACKLISTED]: s__('LicenseCompliance|Blacklisted'),
computed: {
approveIconClass() {
return this.license.approvalStatus === LICENSE_APPROVAL_STATUS.APPROVED
......
......@@ -13,12 +13,12 @@ export default {
...mapState(['currentLicenseInModal', 'canManageLicenses']),
headerTitleText() {
if (!this.canManageLicenses) {
return s__('LicenseManagement|License details');
return s__('LicenseCompliance|License details');
}
if (this.canApprove) {
return s__('LicenseManagement|Approve license?');
return s__('LicenseCompliance|Approve license?');
}
return s__('LicenseManagement|Blacklist license?');
return s__('LicenseCompliance|Blacklist license?');
},
canApprove() {
return (
......@@ -50,7 +50,7 @@ export default {
<slot v-if="currentLicenseInModal">
<div class="row prepend-top-10 append-bottom-10 js-license-name">
<label class="col-sm-3 text-right font-weight-bold">
{{ s__('LicenseManagement|License') }}:
{{ s__('LicenseCompliance|License') }}:
</label>
<div class="col-sm-9 text-secondary">{{ currentLicenseInModal.name }}</div>
</div>
......@@ -59,7 +59,7 @@ export default {
class="row prepend-top-10 append-bottom-10 js-license-url"
>
<label class="col-sm-3 text-right font-weight-bold">
{{ s__('LicenseManagement|URL') }}:
{{ s__('LicenseCompliance|URL') }}:
</label>
<div class="col-sm-9 text-secondary">
<safe-link
......@@ -72,7 +72,7 @@ export default {
</div>
<div class="row prepend-top-10 append-bottom-10 js-license-packages">
<label class="col-sm-3 text-right font-weight-bold">
{{ s__('LicenseManagement|Packages') }}:
{{ s__('LicenseCompliance|Packages') }}:
</label>
<license-packages
:packages="currentLicenseInModal.packages"
......@@ -95,7 +95,7 @@ export default {
data-dismiss="modal"
@click="blacklistLicense(currentLicenseInModal)"
>
{{ s__('LicenseManagement|Blacklist license') }}
{{ s__('LicenseCompliance|Blacklist license') }}
</button>
<button
v-if="canApprove"
......@@ -104,7 +104,7 @@ export default {
data-dismiss="modal"
@click="approveLicense(currentLicenseInModal)"
>
{{ s__('LicenseManagement|Approve license') }}
{{ s__('LicenseCompliance|Approve license') }}
</button>
</template>
</gl-modal>
......
......@@ -49,10 +49,10 @@ export default {
},
},
emptyMessage: s__(
'LicenseManagement|There are currently no approved or blacklisted licenses in this project.',
'LicenseCompliance|There are currently no approved or blacklisted licenses in this project.',
),
emptySearchMessage: s__(
'LicenseManagement|There are currently no approved or blacklisted licenses that match in this project.',
'LicenseCompliance|There are currently no approved or blacklisted licenses that match in this project.',
),
};
</script>
......@@ -74,7 +74,7 @@ export default {
variant="success"
@click="openAddLicenseForm"
>
{{ s__('LicenseManagement|Add a license') }}
{{ s__('LicenseCompliance|Add a license') }}
</gl-button>
</template>
......
......@@ -13,37 +13,39 @@ export const licenseSummaryText = (state, getters) => {
if (getters.isLoading) {
return sprintf(s__('ciReport|Loading %{reportName} report'), {
reportName: s__('license management'),
reportName: s__('License Compliance'),
});
}
if (state.loadLicenseReportError) {
return sprintf(s__('ciReport|Failed to load %{reportName} report'), {
reportName: s__('license management'),
reportName: s__('License Compliance'),
});
}
if (hasReportItems) {
if (!baseReportHasLicenses) {
return n__(
'ciReport|License management detected %d license for the source branch only',
'ciReport|License management detected %d licenses for the source branch only',
'LicenseCompliance|License Compliance detected %d license for the source branch only',
'LicenseCompliance|License Compliance detected %d licenses for the source branch only',
getters.licenseReport.length,
);
}
return n__(
'ciReport|License management detected %d new license',
'ciReport|License management detected %d new licenses',
'LicenseCompliance|License Compliance detected %d new license',
'LicenseCompliance|License Compliance detected %d new licenses',
getters.licenseReport.length,
);
}
if (!baseReportHasLicenses) {
return s__('ciReport|License management detected no licenses for the source branch only');
return s__(
'LicenseCompliance|License Compliance detected no licenses for the source branch only',
);
}
return s__('ciReport|License management detected no new licenses');
return s__('LicenseCompliance|License Compliance detected no new licenses');
};
// prevent babel-plugin-rewire from generating an invalid default during karma tests
......
......@@ -4,13 +4,13 @@
%section.settings.no-animate#js-license-management{ class: ('expanded' if expanded) }
.settings-header
%h4
= s_('LicenseManagement|License Management')
= s_('LicenseCompliance|License Compliance')
= link_to icon('question-circle'), help_page_path('user/project/merge_requests/license_management'), target: '_blank', rel: 'noopener noreferrer'
%button.btn.js-settings-toggle{ type: 'button' }
= expanded ? _('Collapse') : _('Expand')
%p
- ci = link_to(s_('Gitlab CI/CD'), 'https://docs.gitlab.com/ee/ci/', target: '_blank', rel: 'noopener noreferrer')
- license = link_to(s_('Auto License Complience'), 'https://docs.gitlab.com/ee/topics/autodevops/index.html#auto-license-management-ultimate', target: '_blank', rel: 'noopener noreferrer')
= s_('License Compliance|Here you can approve or blacklist licenses for this project. Using %{ci} or %{license} will allow you to see if there are any unmanaged licenses and approve or blacklist them in merge request.').html_safe % { ci: ci, license: license }
- license = link_to(s_('Auto License Compliance'), 'https://docs.gitlab.com/ee/topics/autodevops/index.html#auto-license-management-ultimate', target: '_blank', rel: 'noopener noreferrer')
= s_('LicenseCompliance|Here you can approve or blacklist licenses for this project. Using %{ci} or %{license} will allow you to see if there are any unmanaged licenses and approve or blacklist them in merge request.').html_safe % { ci: ci, license: license }
.settings-content
#js-managed-licenses{ data: { api_url: @license_management_url } }
---
title: Rename License Management to License Compliance
merge_request: 15163
author:
type: changed
......@@ -133,7 +133,7 @@ describe 'Pipeline', :js do
stub_licensed_features(license_management: true)
end
context 'with a license management artifact' do
context 'with a License Compliance artifact' do
before do
create(:ee_ci_build, :license_management, pipeline: pipeline)
......@@ -147,11 +147,11 @@ describe 'Pipeline', :js do
end
it 'shows security report section' do
expect(page).to have_content('Loading license management report')
expect(page).to have_content('Loading License Compliance report')
end
end
context 'without license management artifact' do
context 'without License Compliance artifact' do
before do
visit licenses_project_pipeline_path(project, pipeline)
end
......
......@@ -59,44 +59,44 @@ describe('getters', () => {
baseReport: licenseBaseIssues,
};
it('should be `Loading license management report` text if isLoading', () => {
it('should be `Loading License Compliance report` text if isLoading', () => {
const mockGetters = {};
mockGetters.isLoading = true;
expect(getters.licenseSummaryText(state, mockGetters)).toBe(
'Loading license management report',
'Loading License Compliance report',
);
});
it('should be `Failed to load license management report` text if an error has happened', () => {
it('should be `Failed to load License Compliance report` text if an error has happened', () => {
const mockGetters = {};
expect(
getters.licenseSummaryText({ loadLicenseReportError: new Error('Test') }, mockGetters),
).toBe('Failed to load license management report');
).toBe('Failed to load License Compliance report');
});
it('should be `License management detected no new licenses`, if the report is empty', () => {
it('should be `License Compliance detected no new licenses`, if the report is empty', () => {
const mockGetters = { licenseReport: [] };
expect(getters.licenseSummaryText(state, mockGetters)).toBe(
'License management detected no new licenses',
'License Compliance detected no new licenses',
);
});
it('should be `License management detected 1 new license`, if the report has one element', () => {
it('should be `License Compliance detected 1 new license`, if the report has one element', () => {
const mockGetters = { licenseReport: [licenseReportMock[0]] };
expect(getters.licenseSummaryText(state, mockGetters)).toBe(
'License management detected 1 new license',
'License Compliance detected 1 new license',
);
});
it('should be `License management detected 2 new licenses`, if the report has two elements', () => {
it('should be `License Compliance detected 2 new licenses`, if the report has two elements', () => {
const mockGetters = { licenseReport: [licenseReportMock[0], licenseReportMock[0]] };
expect(getters.licenseSummaryText(state, mockGetters)).toBe(
'License management detected 2 new licenses',
'License Compliance detected 2 new licenses',
);
});
});
......@@ -104,27 +104,27 @@ describe('getters', () => {
describe('when there are no licences on the BASE', () => {
const state = { baseReport: {} };
it('should be `License management detected no licenses for the source branch only` with no new licences', () => {
it('should be `License Compliance detected no licenses for the source branch only` with no new licences', () => {
const mockGetters = { licenseReport: [] };
expect(getters.licenseSummaryText(state, mockGetters)).toBe(
'License management detected no licenses for the source branch only',
'License Compliance detected no licenses for the source branch only',
);
});
it('should be `License management detected 1 license for the source branch only` with one new licence', () => {
it('should be `License Compliance detected 1 license for the source branch only` with one new licence', () => {
const mockGetters = { licenseReport: [licenseReportMock[0]] };
expect(getters.licenseSummaryText(state, mockGetters)).toBe(
'License management detected 1 license for the source branch only',
'License Compliance detected 1 license for the source branch only',
);
});
it('should be `License management detected 2 licenses for the source branch only` with two new licences', () => {
it('should be `License Compliance detected 2 licenses for the source branch only` with two new licences', () => {
const mockGetters = { licenseReport: [licenseReportMock[0], licenseReportMock[0]] };
expect(getters.licenseSummaryText(state, mockGetters)).toBe(
'License management detected 2 licenses for the source branch only',
'License Compliance detected 2 licenses for the source branch only',
);
});
});
......
......@@ -1945,7 +1945,7 @@ msgstr ""
msgid "Auto DevOps, runners and job artifacts"
msgstr ""
msgid "Auto License Complience"
msgid "Auto License Compliance"
msgstr ""
msgid "Auto-cancel redundant, pending pipelines"
......@@ -8709,79 +8709,98 @@ msgstr ""
msgid "License"
msgstr ""
msgid "License Compliance|Here you can approve or blacklist licenses for this project. Using %{ci} or %{license} will allow you to see if there are any unmanaged licenses and approve or blacklist them in merge request."
msgid "License Compliance"
msgstr ""
msgid "LicenseManagement|Add a license"
msgid "LicenseCompliance|Add a license"
msgstr ""
msgid "LicenseManagement|Add licenses manually to approve or blacklist"
msgid "LicenseCompliance|Add licenses manually to approve or blacklist"
msgstr ""
msgid "LicenseManagement|Approve"
msgid "LicenseCompliance|Approve"
msgstr ""
msgid "LicenseManagement|Approve license"
msgid "LicenseCompliance|Approve license"
msgstr ""
msgid "LicenseManagement|Approve license?"
msgid "LicenseCompliance|Approve license?"
msgstr ""
msgid "LicenseManagement|Approved"
msgid "LicenseCompliance|Approved"
msgstr ""
msgid "LicenseManagement|Blacklist"
msgid "LicenseCompliance|Blacklist"
msgstr ""
msgid "LicenseManagement|Blacklist license"
msgid "LicenseCompliance|Blacklist license"
msgstr ""
msgid "LicenseManagement|Blacklist license?"
msgid "LicenseCompliance|Blacklist license?"
msgstr ""
msgid "LicenseManagement|Blacklisted"
msgid "LicenseCompliance|Blacklisted"
msgstr ""
msgid "LicenseManagement|Cancel"
msgid "LicenseCompliance|Cancel"
msgstr ""
msgid "LicenseManagement|License"
msgid "LicenseCompliance|Here you can approve or blacklist licenses for this project. Using %{ci} or %{license} will allow you to see if there are any unmanaged licenses and approve or blacklist them in merge request."
msgstr ""
msgid "LicenseManagement|License Management"
msgid "LicenseCompliance|License"
msgstr ""
msgid "LicenseManagement|License details"
msgid "LicenseCompliance|License Compliance"
msgstr ""
msgid "LicenseManagement|License name"
msgid "LicenseCompliance|License Compliance detected %d license for the source branch only"
msgid_plural "LicenseCompliance|License Compliance detected %d licenses for the source branch only"
msgstr[0] ""
msgstr[1] ""
msgid "LicenseCompliance|License Compliance detected %d new license"
msgid_plural "LicenseCompliance|License Compliance detected %d new licenses"
msgstr[0] ""
msgstr[1] ""
msgid "LicenseCompliance|License Compliance detected no licenses for the source branch only"
msgstr ""
msgid "LicenseCompliance|License Compliance detected no new licenses"
msgstr ""
msgid "LicenseCompliance|License details"
msgstr ""
msgid "LicenseCompliance|License name"
msgstr ""
msgid "LicenseManagement|Packages"
msgid "LicenseCompliance|Packages"
msgstr ""
msgid "LicenseManagement|Remove license"
msgid "LicenseCompliance|Remove license"
msgstr ""
msgid "LicenseManagement|Remove license?"
msgid "LicenseCompliance|Remove license?"
msgstr ""
msgid "LicenseManagement|Submit"
msgid "LicenseCompliance|Submit"
msgstr ""
msgid "LicenseManagement|There are currently no approved or blacklisted licenses in this project."
msgid "LicenseCompliance|There are currently no approved or blacklisted licenses in this project."
msgstr ""
msgid "LicenseManagement|There are currently no approved or blacklisted licenses that match in this project."
msgid "LicenseCompliance|There are currently no approved or blacklisted licenses that match in this project."
msgstr ""
msgid "LicenseManagement|This license already exists in this project."
msgid "LicenseCompliance|This license already exists in this project."
msgstr ""
msgid "LicenseManagement|URL"
msgid "LicenseCompliance|URL"
msgstr ""
msgid "LicenseManagement|You are about to remove the license, %{name}, from this project."
msgid "LicenseCompliance|You are about to remove the license, %{name}, from this project."
msgstr ""
msgid "Licensed Features"
......@@ -17778,22 +17797,6 @@ msgstr ""
msgid "ciReport|Learn more about interacting with security reports"
msgstr ""
msgid "ciReport|License management detected %d license for the source branch only"
msgid_plural "ciReport|License management detected %d licenses for the source branch only"
msgstr[0] ""
msgstr[1] ""
msgid "ciReport|License management detected %d new license"
msgid_plural "ciReport|License management detected %d new licenses"
msgstr[0] ""
msgstr[1] ""
msgid "ciReport|License management detected no licenses for the source branch only"
msgstr ""
msgid "ciReport|License management detected no new licenses"
msgstr ""
msgid "ciReport|Links"
msgstr ""
......@@ -18111,9 +18114,6 @@ msgstr ""
msgid "leave %{group_name}"
msgstr ""
msgid "license management"
msgstr ""
msgid "locked by %{path_lock_user_name} %{created_at}"
msgstr ""
......
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