Commit 01ce3d7d authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch '6727-link-pipeline-and-MR-LM-widget-ee' into 'master'

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

Closes #6727

See merge request gitlab-org/gitlab-ee!6800
parents 06baa844 318e1d75
......@@ -260,6 +260,7 @@ export default {
<mr-widget-licenses
v-if="shouldRenderLicenseReport"
:api-url="mr.licenseManagement.managed_licenses_path"
:pipeline-path="mr.pipeline.path"
:can-manage-licenses="mr.licenseManagement.can_manage_licenses"
:base-path="mr.licenseManagement.base_path"
:head-path="mr.licenseManagement.head_path"
......
......@@ -28,6 +28,11 @@ export default {
required: false,
default: null,
},
pipelinePath: {
type: String,
required: false,
default: null,
},
apiUrl: {
type: String,
required: true,
......@@ -57,13 +62,13 @@ export default {
licenseReportStatus() {
return this.checkReportStatus(this.isLoading, this.loadLicenseReportError);
},
licensesTab() {
return this.pipelinePath ? `${this.pipelinePath}/licenses` : null;
},
},
watch: {
licenseReport() {
this.$emit(
'updateBadgeCount',
this.licenseReport.length,
);
this.$emit('updateBadgeCount', this.licenseReport.length);
},
},
mounted() {
......@@ -98,6 +103,18 @@ export default {
:class="reportSectionClass"
:always-open="alwaysOpen"
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>
</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', () => {
}));
});
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', () => {
it('should be `LOADING`, if the report is loading', done => {
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