Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2017-12-08 16:34:54 +0300
committerSean McGivern <sean@gitlab.com>2017-12-13 13:40:31 +0300
commitb1e3cb24fa777bc6776c7602935876f546383a38 (patch)
tree7351f08e3421671ded350075831b68bafcefe600 /app/services/issuable_base_service.rb
parent9429e8ac60a10436a0469d7d206d3f74a2c966c7 (diff)
Execute quick actions when creating MR from issue
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.rb6
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