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
684e1d15
Commit
684e1d15
authored
Feb 01, 2021
by
Jonathan Schafer
Committed by
Dmytro Zaporozhets (DZ)
Feb 01, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not overwrite fields that are populated
parent
15b9bc05
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
4 deletions
+20
-4
ee/app/controllers/ee/projects/issues_controller.rb
ee/app/controllers/ee/projects/issues_controller.rb
+5
-3
ee/changelogs/unreleased/299462-create-issue-from-vulnerability-details-edited-text-is-discarde.yml
...ue-from-vulnerability-details-edited-text-is-discarde.yml
+5
-0
ee/spec/controllers/projects/issues_controller_spec.rb
ee/spec/controllers/projects/issues_controller_spec.rb
+10
-1
No files found.
ee/app/controllers/ee/projects/issues_controller.rb
View file @
684e1d15
...
@@ -66,10 +66,12 @@ module EE
...
@@ -66,10 +66,12 @@ module EE
end
end
def
vulnerability_issue_build_parameters
def
vulnerability_issue_build_parameters
issue
=
params
[
:issue
]
{
{
title:
_
(
"Investigate vulnerability: %{title}"
)
%
{
title:
vulnerability
.
title
}
,
title:
issue
.
fetch
(
:title
,
_
(
"Investigate vulnerability: %{title}"
)
%
{
title:
vulnerability
.
title
})
,
description:
render_vulnerability_description
,
description:
issue
.
fetch
(
:description
,
render_vulnerability_description
)
,
confidential:
true
confidential:
issue
.
fetch
(
:confidential
,
true
)
}
}
end
end
...
...
ee/changelogs/unreleased/299462-create-issue-from-vulnerability-details-edited-text-is-discarde.yml
0 → 100644
View file @
684e1d15
---
title
:
Fixed bug that overwrote issue description changes from vulnerabilities
merge_request
:
52376
author
:
type
:
fixed
ee/spec/controllers/projects/issues_controller_spec.rb
View file @
684e1d15
...
@@ -104,6 +104,15 @@ RSpec.describe Projects::IssuesController do
...
@@ -104,6 +104,15 @@ RSpec.describe Projects::IssuesController do
expect
(
project
.
issues
.
last
.
vulnerability_links
.
first
.
vulnerability
).
to
eq
(
vulnerability
)
expect
(
project
.
issues
.
last
.
vulnerability_links
.
first
.
vulnerability
).
to
eq
(
vulnerability
)
end
end
it
'overwrites the default fields'
do
send_request
issue
=
project
.
issues
.
last
expect
(
issue
.
title
).
to
eq
(
'Title'
)
expect
(
issue
.
description
).
to
eq
(
'Description'
)
expect
(
issue
.
confidential
).
to
be
false
end
context
'when vulnerability already has a linked issue'
do
context
'when vulnerability already has a linked issue'
do
render_views
render_views
...
@@ -123,7 +132,7 @@ RSpec.describe Projects::IssuesController do
...
@@ -123,7 +132,7 @@ RSpec.describe Projects::IssuesController do
post
:create
,
params:
{
post
:create
,
params:
{
namespace_id:
project
.
namespace
.
to_param
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
,
project_id:
project
,
issue:
{
title:
'Title'
,
description:
'Description'
},
issue:
{
title:
'Title'
,
description:
'Description'
,
confidential:
'false'
},
vulnerability_id:
vulnerability
.
id
vulnerability_id:
vulnerability
.
id
}
}
end
end
...
...
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