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:
Diffstat (limited to 'lib/gitlab/quick_actions/merge_request_actions.rb')
-rw-r--r--lib/gitlab/quick_actions/merge_request_actions.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/gitlab/quick_actions/merge_request_actions.rb b/lib/gitlab/quick_actions/merge_request_actions.rb
index 7c06698ffec..98db8ff761e 100644
--- a/lib/gitlab/quick_actions/merge_request_actions.rb
+++ b/lib/gitlab/quick_actions/merge_request_actions.rb
@@ -104,6 +104,23 @@ module Gitlab
command :target_branch do |branch_name|
@updates[:target_branch] = branch_name if project.repository.branch_exists?(branch_name)
end
+
+ desc _('Submit a review')
+ explanation _('Submit the current review.')
+ types MergeRequest
+ condition do
+ quick_action_target.persisted?
+ end
+ command :submit_review do
+ next if params[:review_id]
+
+ result = DraftNotes::PublishService.new(quick_action_target, current_user).execute
+ @execution_message[:submit_review] = if result[:status] == :success
+ _('Submitted the current review.')
+ else
+ result[:message]
+ end
+ end
end
def merge_orchestration_service