[FE] Add export button for violations on Compliance Report
What does this MR do and why?
Add export button for violations on Compliance Report
-
Add UI for export of violations in a CSV format. This n will only trigger the GET request, the responding controller responds with a flash message and queues a job to send an email with the actual export.
-
This first version does not take filtering into account. Follow-up: Add filtered compliance violations export (foll... (#414481) • Unassigned • Backlog
-
refs: #356791 (closed)
-
Note: this will require a follow-up similar to the diff in the reproduction steps to show up in prod. That will be a follow-up MR as done with a similar issue here: Enable UI for Compliance Framework CSV Export (!119783 - merged) • Sam Figueroa • 16.0
Screenshots or screen recordings
Before | After |
---|---|
![]() |
![]() ![]() ![]() |
Note: also changed Frameworks export button to be consistent with the new button text (screenshot 3 in After section).
How to set up and validate locally
- Apply this diff to make the export button show.
diff --git a/ee/app/views/groups/security/compliance_dashboards/show.html.haml b/ee/app/views/groups/security/compliance_dashboards/show.html.haml
index 17aa1321d5f7..3e5630e59757 100644
--- a/ee/app/views/groups/security/compliance_dashboards/show.html.haml
+++ b/ee/app/views/groups/security/compliance_dashboards/show.html.haml
@@ -3,6 +3,7 @@
#js-compliance-report{ data: {
can_add_edit: @group.subgroup? ? "false" : "true",
+ violations_csv_export_path: group_security_compliance_framework_reports_path(@group, format: :csv),
frameworks_csv_export_path: group_security_compliance_framework_reports_path(@group, format: :csv),
merge_commits_csv_export_path: group_security_merge_commit_reports_path(@group),
group_path: @group.full_path,
- Navigate to a group, then Secure -> Compliance report
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.