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 @@
- if @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?
%h3= _("Links")
%ul
......
......@@ -77,6 +77,12 @@ describe Projects::Security::VulnerabilitiesController do
expect(response.body).to have_text(vulnerability.title)
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
show_vulnerability
......
......@@ -305,6 +305,9 @@ msgstr ""
msgid "%{filePath} deleted"
msgstr ""
msgid "%{file}:%{line} (%{klass}::%{method})"
msgstr ""
msgid "%{firstLabel} +%{labelCount} more"
msgstr ""
......@@ -8888,6 +8891,9 @@ msgstr ""
msgid "File Hooks (%{count})"
msgstr ""
msgid "File Location"
msgstr ""
msgid "File added"
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