Commit ed9f7cea authored by Jonathan Schafer's avatar Jonathan Schafer

Add File Location to vulnerability details

Add new strings to locale file
Add test for file location
parent 285b752f
...@@ -24,6 +24,12 @@ ...@@ -24,6 +24,12 @@
- if @vulnerability.finding.location["operating_system"] - if @vulnerability.finding.location["operating_system"]
%li= _("Namespace: %{namespace}") % { namespace: @vulnerability.finding.location['operating_system'] } %li= _("Namespace: %{namespace}") % { namespace: @vulnerability.finding.location['operating_system'] }
- if @vulnerability.finding.location["file"]
%h3= _("File Location")
%ul
%li
%a{ :href=>project_tree_path(@project, @vulnerability.finding.location["file"]), target: "_blank", rel: 'noopener noreferrer' }= _("%{file}:%{line} (%{klass}::%{method})") % { file: @vulnerability.finding.location["file"], line: @vulnerability.finding.location["start_line"], klass: @vulnerability.finding.location["class"], method: @vulnerability.finding.location["method"] }
- if @vulnerability.finding.links.any? - if @vulnerability.finding.links.any?
%h3= _("Links") %h3= _("Links")
%ul %ul
......
...@@ -77,6 +77,12 @@ describe Projects::Security::VulnerabilitiesController do ...@@ -77,6 +77,12 @@ describe Projects::Security::VulnerabilitiesController do
expect(response.body).to have_text(vulnerability.title) expect(response.body).to have_text(vulnerability.title)
end end
it 'renders the file location' do
show_vulnerability
expect(response.body).to have_text(vulnerability.finding.location["file"])
end
it 'renders the solution card' do it 'renders the solution card' do
show_vulnerability show_vulnerability
......
...@@ -305,6 +305,9 @@ msgstr "" ...@@ -305,6 +305,9 @@ msgstr ""
msgid "%{filePath} deleted" msgid "%{filePath} deleted"
msgstr "" msgstr ""
msgid "%{file}:%{line} (%{klass}::%{method})"
msgstr ""
msgid "%{firstLabel} +%{labelCount} more" msgid "%{firstLabel} +%{labelCount} more"
msgstr "" msgstr ""
...@@ -8888,6 +8891,9 @@ msgstr "" ...@@ -8888,6 +8891,9 @@ msgstr ""
msgid "File Hooks (%{count})" msgid "File Hooks (%{count})"
msgstr "" msgstr ""
msgid "File Location"
msgstr ""
msgid "File added" msgid "File added"
msgstr "" msgstr ""
......
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