Skip to content

Fix empty security dashboard props

Paul Gascou-Vaillancourt requested to merge empty-dashboard-missing-props into master

What does this MR do?

It looks like a small bug was introduced in this MR: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/13180

Some props weren't correctly referenced when initializing the project's security dashboard, causing the empty state component to be incomplete when the project's doesn't have any pipeline history.

The bug is visible on the screenshot below, there should be an illustration and a link pointing to the documentation but these elements aren't rendered because of the missing props:

empty_bug

This MR fixes this by properly renaming the props:

empty_fixed

How to test this

An easy way to test this locally would be to modify ee/app/helpers/ee/projects_helper.rb to simulate an empty pipeline history:

diff --git a/ee/app/helpers/ee/projects_helper.rb b/ee/app/helpers/ee/projects_helper.rb
index 87c9665c0df..4fe94d2a1bd 100644
--- a/ee/app/helpers/ee/projects_helper.rb
+++ b/ee/app/helpers/ee/projects_helper.rb
@@ -153,6 +153,7 @@ module EE
     end
 
     def project_security_dashboard_config(project, pipeline)
+      pipeline = nil
       if pipeline.nil?
         {
           empty_state_illustration_path: image_path('illustrations/security-dashboard_empty.svg'),

Then, access any project's security dashboard that would normally show a report and you should see the empty state.

Does this MR meet the acceptance criteria?

Conformity

Edited by Paul Gascou-Vaillancourt

Merge request reports