Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
ed9f7cea
Commit
ed9f7cea
authored
Mar 20, 2020
by
Jonathan Schafer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add File Location to vulnerability details
Add new strings to locale file Add test for file location
parent
285b752f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
0 deletions
+18
-0
ee/app/views/projects/security/vulnerabilities/show.html.haml
...pp/views/projects/security/vulnerabilities/show.html.haml
+6
-0
ee/spec/controllers/projects/security/vulnerabilities_controller_spec.rb
...lers/projects/security/vulnerabilities_controller_spec.rb
+6
-0
locale/gitlab.pot
locale/gitlab.pot
+6
-0
No files found.
ee/app/views/projects/security/vulnerabilities/show.html.haml
View file @
ed9f7cea
...
...
@@ -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
...
...
ee/spec/controllers/projects/security/vulnerabilities_controller_spec.rb
View file @
ed9f7cea
...
...
@@ -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
...
...
locale/gitlab.pot
View file @
ed9f7cea
...
...
@@ -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 ""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment