Commit 27b43a19 authored by Dmytro Zaporozhets (DZ)'s avatar Dmytro Zaporozhets (DZ)

Merge branch...

Merge branch '299462-create-issue-from-vulnerability-details-edited-text-is-discarded' into 'master'

Do not overwrite fields that are populated

See merge request gitlab-org/gitlab!52376
parents d22ba420 684e1d15
......@@ -66,10 +66,12 @@ module EE
end
def vulnerability_issue_build_parameters
issue = params[:issue]
{
title: _("Investigate vulnerability: %{title}") % { title: vulnerability.title },
description: render_vulnerability_description,
confidential: true
title: issue.fetch(:title, _("Investigate vulnerability: %{title}") % { title: vulnerability.title }),
description: issue.fetch(:description, render_vulnerability_description),
confidential: issue.fetch(:confidential, true)
}
end
......
---
title: Fixed bug that overwrote issue description changes from vulnerabilities
merge_request: 52376
author:
type: fixed
......@@ -112,6 +112,15 @@ RSpec.describe Projects::IssuesController do
expect(project.issues.last.vulnerability_links.first.vulnerability).to eq(vulnerability)
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
render_views
......@@ -131,7 +140,7 @@ RSpec.describe Projects::IssuesController do
post :create, params: {
namespace_id: project.namespace.to_param,
project_id: project,
issue: { title: 'Title', description: 'Description' },
issue: { title: 'Title', description: 'Description', confidential: 'false' },
vulnerability_id: vulnerability.id
}
end
......
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