Show correct "no-results" message on pipeline security tab
Summary
When a filter-combination does not contain any results, but the pipeline does have findings, we currently show this empty state component:
while it should be (and this is the case for the project vulnerability report page), this empty state component:
Cause
When pipeline_security_dashboard_graphql is enabled, the vulnerability_list.vue is used and that already has support for showing the latter "filter produced no results" empty state. However, it requires 2 injections in vue: hasVulnerabilities and noVulnerabilitiesSvgPath. These are not provided vulnerability_report_data in the pipeline_helper.rb.
Possible fixes
Provide has_vulnerabilities and no_vulnerabilities_svg_path in vulnerability_report_data_entity.rb and update pipeline_report_options.js such that these are provided into vue.
-
has_vulnerabilitiesindicates whether the pipeline has findings -
no_vulnerabilities_svg_pathshould link toimage_path('illustrations/empty-state/empty-search-md.svg')
Implementation Plan
- Update
pipeline_report_options.jssuch thathasVulnerabilitiesandnoVulnerabilitiesSvgPathare extracted from dataset and returned.
- Include
has_vulnerabilitiesinee/app/serializers/security/vulnerability_report_data_entity.rbwhich is a boolean that indicates whether there are security findings at all in the pipeline. Usepipeline.security_findingsfor this. - Include
no_vulnerabilities_svg_pathinee/app/serializers/security/vulnerability_report_data_entity.rbthat links the image path 'illustrations/empty-state/empty-search-md.svg'. UseActionController::Base.helpers.image_path('illustrations/empty-state/empty-search-md.svg').

