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
09eb6775
Commit
09eb6775
authored
Sep 22, 2020
by
Mehmet Emin INAC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set `create_issue_url` as nil if issues are disabled
parent
102c9fb4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
ee/app/helpers/vulnerabilities_helper.rb
ee/app/helpers/vulnerabilities_helper.rb
+7
-1
ee/spec/helpers/vulnerabilities_helper_spec.rb
ee/spec/helpers/vulnerabilities_helper_spec.rb
+10
-0
No files found.
ee/app/helpers/vulnerabilities_helper.rb
View file @
09eb6775
...
@@ -10,7 +10,7 @@ module VulnerabilitiesHelper
...
@@ -10,7 +10,7 @@ module VulnerabilitiesHelper
result
=
{
result
=
{
timestamp:
Time
.
now
.
to_i
,
timestamp:
Time
.
now
.
to_i
,
create_issue_url:
create_issue_
project_security_vulnerability_path
(
vulnerability
.
project
,
vulnerability
),
create_issue_url:
create_issue_
url_for
(
vulnerability
),
has_mr:
!!
vulnerability
.
finding
.
merge_request_feedback
.
try
(
:merge_request_iid
),
has_mr:
!!
vulnerability
.
finding
.
merge_request_feedback
.
try
(
:merge_request_iid
),
create_mr_url:
create_vulnerability_feedback_merge_request_path
(
vulnerability
.
finding
.
project
),
create_mr_url:
create_vulnerability_feedback_merge_request_path
(
vulnerability
.
finding
.
project
),
discussions_url:
discussions_project_security_vulnerability_path
(
vulnerability
.
project
,
vulnerability
),
discussions_url:
discussions_project_security_vulnerability_path
(
vulnerability
.
project
,
vulnerability
),
...
@@ -26,6 +26,12 @@ module VulnerabilitiesHelper
...
@@ -26,6 +26,12 @@ module VulnerabilitiesHelper
result
.
merge
(
vulnerability_data
(
vulnerability
),
vulnerability_finding_data
(
vulnerability
))
result
.
merge
(
vulnerability_data
(
vulnerability
),
vulnerability_finding_data
(
vulnerability
))
end
end
def
create_issue_url_for
(
vulnerability
)
return
unless
vulnerability
.
project
.
issues_enabled?
create_issue_project_security_vulnerability_path
(
vulnerability
.
project
,
vulnerability
)
end
def
vulnerability_pipeline_data
(
pipeline
)
def
vulnerability_pipeline_data
(
pipeline
)
return
unless
pipeline
return
unless
pipeline
...
...
ee/spec/helpers/vulnerabilities_helper_spec.rb
View file @
09eb6775
...
@@ -69,6 +69,16 @@ RSpec.describe VulnerabilitiesHelper do
...
@@ -69,6 +69,16 @@ RSpec.describe VulnerabilitiesHelper do
can_modify_related_issues:
false
can_modify_related_issues:
false
)
)
end
end
context
'when the issues are disabled for the project'
do
before
do
allow
(
project
).
to
receive
(
:issues_enabled?
).
and_return
(
false
)
end
it
'has `create_issue_url` set as nil'
do
expect
(
subject
).
to
include
(
create_issue_url:
nil
)
end
end
end
end
describe
'#vulnerability_details'
do
describe
'#vulnerability_details'
do
...
...
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