Commit 318e1d75 authored by 🌴🇿🇦 Lukas Eipert (OOO until Summit)'s avatar 🌴🇿🇦 Lukas Eipert (OOO until Summit) Committed by Filipa Lacerda

Link the License Management report in the MR widget with the pipeline level one

parent 06baa844
...@@ -260,6 +260,7 @@ export default { ...@@ -260,6 +260,7 @@ export default {
<mr-widget-licenses <mr-widget-licenses
v-if="shouldRenderLicenseReport" v-if="shouldRenderLicenseReport"
:api-url="mr.licenseManagement.managed_licenses_path" :api-url="mr.licenseManagement.managed_licenses_path"
:pipeline-path="mr.pipeline.path"
:can-manage-licenses="mr.licenseManagement.can_manage_licenses" :can-manage-licenses="mr.licenseManagement.can_manage_licenses"
:base-path="mr.licenseManagement.base_path" :base-path="mr.licenseManagement.base_path"
:head-path="mr.licenseManagement.head_path" :head-path="mr.licenseManagement.head_path"
......
...@@ -28,6 +28,11 @@ export default { ...@@ -28,6 +28,11 @@ export default {
required: false, required: false,
default: null, default: null,
}, },
pipelinePath: {
type: String,
required: false,
default: null,
},
apiUrl: { apiUrl: {
type: String, type: String,
required: true, required: true,
...@@ -57,13 +62,13 @@ export default { ...@@ -57,13 +62,13 @@ export default {
licenseReportStatus() { licenseReportStatus() {
return this.checkReportStatus(this.isLoading, this.loadLicenseReportError); return this.checkReportStatus(this.isLoading, this.loadLicenseReportError);
}, },
licensesTab() {
return this.pipelinePath ? `${this.pipelinePath}/licenses` : null;
},
}, },
watch: { watch: {
licenseReport() { licenseReport() {
this.$emit( this.$emit('updateBadgeCount', this.licenseReport.length);
'updateBadgeCount',
this.licenseReport.length,
);
}, },
}, },
mounted() { mounted() {
...@@ -98,6 +103,18 @@ export default { ...@@ -98,6 +103,18 @@ export default {
:class="reportSectionClass" :class="reportSectionClass"
:always-open="alwaysOpen" :always-open="alwaysOpen"
class="license-report-widget" class="license-report-widget"
/> >
<div
v-if="licensesTab"
slot="actionButtons"
>
<a
:href="licensesTab"
class="btn btn-default float-right btn-sm"
>
{{ s__("ciReport|View full report") }}
</a>
</div>
</report-section>
</div> </div>
</template> </template>
---
title: Link the License Management report in the MR widget with the pipeline level
one
merge_request: 6800
author:
type: added
...@@ -84,6 +84,23 @@ describe('License Report MR Widget', () => { ...@@ -84,6 +84,23 @@ describe('License Report MR Widget', () => {
})); }));
}); });
describe('licensesTab', () => {
it('with the pipelinePath prop', done => {
const pipelinePath = `${TEST_HOST}/path/to/the/pipeline`;
vm.pipelinePath = pipelinePath;
return Vue.nextTick().then(() => {
expect(vm.licensesTab).toEqual(`${pipelinePath}/licenses`);
done();
});
});
it('without the pipelinePath prop', () => {
expect(vm.licensesTab).toEqual(null);
});
});
describe('licenseReportStatus', () => { describe('licenseReportStatus', () => {
it('should be `LOADING`, if the report is loading', done => { it('should be `LOADING`, if the report is loading', done => {
store.hotUpdate({ store.hotUpdate({
......
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