diff --git a/ee/app/assets/javascripts/vue_shared/security_reports/grouped_security_reports_app.vue b/ee/app/assets/javascripts/vue_shared/security_reports/grouped_security_reports_app.vue index ab98b376d4d293c5f43ea878b535542207a07432..83fd2ccf7dd03563b2deb059da9f188d0b7fe5e0 100644 --- a/ee/app/assets/javascripts/vue_shared/security_reports/grouped_security_reports_app.vue +++ b/ee/app/assets/javascripts/vue_shared/security_reports/grouped_security_reports_app.vue @@ -171,6 +171,11 @@ export default { shouldRenderSastContainer() { const { head, diffEndpoint } = this.sastContainer.paths; + return head || diffEndpoint; + }, + shouldRenderDependencyScanning() { + const { head, diffEndpoint } = this.dependencyScanning.paths; + return head || diffEndpoint; }, }, @@ -229,7 +234,17 @@ export default { this.fetchDastReports(); } - if (this.dependencyScanningHeadPath) { + const dependencyScanningDiffEndpoint = + gl && gl.mrWidgetData && gl.mrWidgetData.dependency_scanning_comparison_path; + + if ( + gon.features && + gon.features.dependencyScanningMergeRequestReportApi && + dependencyScanningDiffEndpoint + ) { + this.setDependencyScanningDiffEndpoint(dependencyScanningDiffEndpoint); + this.fetchDependencyScanningDiff(); + } else if (this.dependencyScanningHeadPath) { this.setDependencyScanningHeadPath(this.dependencyScanningHeadPath); if (this.dependencyScanningBasePath) { @@ -274,6 +289,8 @@ export default { 'hideDismissalDeleteButtons', 'fetchSastContainerDiff', 'setSastContainerDiffEndpoint', + 'fetchDependencyScanningDiff', + 'setDependencyScanningDiffEndpoint', ]), ...mapActions('sast', { setSastHeadPath: 'setHeadPath', @@ -322,7 +339,7 @@ export default { /> -