Commit c4b497a2 authored by Alan (Maciej) Paruszewski's avatar Alan (Maciej) Paruszewski Committed by Ash McKenzie

Remove safe navigation operator from Vulnerability description

parent 23e63699
......@@ -36,6 +36,14 @@ class VulnerabilityPresenter < Gitlab::View::Presenter::Delegated
add_line_numbers(path, finding.location['start_line'], finding.location['end_line'])
end
def scanner
finding.scanner || {}
end
def scan
finding.scan || {}
end
private
def root_url
......
......@@ -61,22 +61,22 @@
<% end %>
<% end %>
<% if vulnerability.try(:scan).present? && vulnerability.try(:scanner).present? %>
<% if vulnerability.scanner.present? || vulnerability.scan.present? %>
### <%= _("Scanner") %>:
<% if vulnerability&.scanner[:name].present? %>
<% if vulnerability.scanner.present? %>
* <%= _("Name") %>: <%= vulnerability.scanner[:name] %>
<% end %>
<% if vulnerability&.scan[:type].present? %>
<% if vulnerability.scan[:type].present? %>
* <%= _("Type") %>: <%= vulnerability.scan[:type] %>
<% end %>
<% if vulnerability&.scan[:status].present? %>
<% if vulnerability.scan[:status].present? %>
* <%= _("Status") %>: <%= vulnerability.scan[:status] %>
<% end %>
<% if vulnerability&.scan[:start_time].present? %>
<% if vulnerability.scan[:start_time].present? %>
* <%= _("Start Time") %>: <%= vulnerability.scan[:start_time] %>
<% end %>
<% if vulnerability&.scan[:end_time].present? %>
<% if vulnerability.scan[:end_time].present? %>
* <%= _("End Time") %>: <%= vulnerability.scan[:end_time] %>
<% end %>
<% end %>
......@@ -52,22 +52,22 @@ h3. <%= _("Links") %>:
<%= _("See vulnerability %{vulnerability_link} for any Remediation details.".html_safe) % { vulnerability_link: "[#{vulnerability.id}|#{vulnerability_url(vulnerability)}]" } %>
<% end %>
<% if vulnerability.try(:scan).present? && vulnerability.try(:scanner).present? %>
<% if vulnerability.scanner.present? || vulnerability.scan.present? %>
h3. <%= _("Scanner") %>:
<% if vulnerability&.scanner[:name].present? %>
<% if vulnerability.scanner.present? %>
* <%= _("Name") %>: <%= vulnerability.scanner[:name] %>
<% end %>
<% if vulnerability&.scan[:type].present? %>
<% if vulnerability.scan[:type].present? %>
* <%= _("Type") %>: <%= vulnerability.scan[:type] %>
<% end %>
<% if vulnerability&.scan[:status].present? %>
<% if vulnerability.scan[:status].present? %>
* <%= _("Status") %>: <%= vulnerability.scan[:status] %>
<% end %>
<% if vulnerability&.scan[:start_time].present? %>
<% if vulnerability.scan[:start_time].present? %>
* <%= _("Start Time") %>: <%= vulnerability.scan[:start_time] %>
<% end %>
<% if vulnerability&.scan[:end_time].present? %>
<% if vulnerability.scan[:end_time].present? %>
* <%= _("End Time") %>: <%= vulnerability.scan[:end_time] %>
<% end %>
<% end %>
......@@ -181,6 +181,9 @@ RSpec.describe VulnerabilitiesHelper do
* [Cipher does not check for integrity first?|https://crypto.stackexchange.com/questions/31428/pbewithmd5anddes-cipher-does-not-check-for-integrity-first]
h3. Scanner:
* Name: Find Security Bugs
JIRA
end
......
......@@ -118,6 +118,11 @@ RSpec.describe Issues::CreateFromVulnerabilityService, '#execute' do
### Links:
* [Cipher does not check for integrity first?](https://crypto.stackexchange.com/questions/31428/pbewithmd5anddes-cipher-does-not-check-for-integrity-first)
### Scanner:
* Name: Find Security Bugs
DESC
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment