diff options
author | Sean McGivern <sean@gitlab.com> | 2017-12-08 13:34:54 +0000 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2017-12-13 10:40:31 +0000 |
commit | b1e3cb24fa777bc6776c7602935876f546383a38 (patch) | |
tree | 7351f08e3421671ded350075831b68bafcefe600 /app/services/issuable_base_service.rb | |
parent | 9429e8ac60a10436a0469d7d206d3f74a2c966c7 (diff) | |
download | gitlab-ce-b1e3cb24fa777bc6776c7602935876f546383a38.tar.gz |
Execute quick actions when creating MR from issuefix-create-mr-from-issue-with-template
In CE, this does nothing - the `MergeRequests::BuildService` will, at the time
of writing, never return a description for this case.
In EE, a project can have a default MR template, which will be returned by the
service. Previously we were only using the description passed in the params,
ignoring any already set on the object. Now we fall back to the one set on the
object if there was none in the params, allowing quick actions to be executed
from default MR templates when creating an MR from an issue.
Diffstat (limited to 'app/services/issuable_base_service.rb')
-rw-r--r-- | app/services/issuable_base_service.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/services/issuable_base_service.rb b/app/services/issuable_base_service.rb index 2c51ac13815..e7463e6e25c 100644 --- a/app/services/issuable_base_service.rb +++ b/app/services/issuable_base_service.rb @@ -106,12 +106,14 @@ class IssuableBaseService < BaseService end def merge_quick_actions_into_params!(issuable) + original_description = params.fetch(:description, issuable.description) + description, command_params = QuickActions::InterpretService.new(project, current_user) - .execute(params[:description], issuable) + .execute(original_description, issuable) # Avoid a description already set on an issuable to be overwritten by a nil - params[:description] = description if params.key?(:description) + params[:description] = description if description params.merge!(command_params) end |