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 eb355437a8f83c273fe1709f9b0861564651f6e1..78e86a3702eb3edfd4b7063dc20b4c2023d32792 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 @@ -181,6 +181,11 @@ export default { shouldRenderDast() { const { head, diffEndpoint } = this.dast.paths; + return head || diffEndpoint; + }, + shouldRenderSast() { + const { head, diffEndpoint } = this.sast.paths; + return head || diffEndpoint; }, }, @@ -202,7 +207,12 @@ export default { this.setCanCreateIssuePermission(this.canCreateIssue); this.setCanCreateFeedbackPermission(this.canCreateFeedback); - if (this.sastHeadPath) { + const sastDiffEndpoint = gl && gl.mrWidgetData && gl.mrWidgetData.sast_comparison_path; + + if (gon.features && gon.features.sastMergeRequestReportApi && sastDiffEndpoint) { + this.setSastDiffEndpoint(sastDiffEndpoint); + this.fetchSastDiff(); + } else if (this.sastHeadPath) { this.setSastHeadPath(this.sastHeadPath); if (this.sastBasePath) { @@ -307,7 +317,9 @@ export default { ...mapActions('sast', { setSastHeadPath: 'setHeadPath', setSastBasePath: 'setBasePath', + setSastDiffEndpoint: 'setDiffEndpoint', fetchSastReports: 'fetchReports', + fetchSastDiff: 'fetchDiff', }), }, }; @@ -333,7 +345,7 @@ export default {
-