diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-03 18:10:36 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-03 18:10:36 +0000 |
commit | fa885192b7d34ba910d1be629ad58c18148a86f1 (patch) | |
tree | ea4316b12a15d6767d8cc12cee4f9feb5a076d91 /lib/gitlab/quick_actions | |
parent | af7ba639ec0b6bba26adc244e8971d4113d2c041 (diff) | |
download | gitlab-ce-fa885192b7d34ba910d1be629ad58c18148a86f1.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/quick_actions')
-rw-r--r-- | lib/gitlab/quick_actions/merge_request_actions.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/gitlab/quick_actions/merge_request_actions.rb b/lib/gitlab/quick_actions/merge_request_actions.rb index 47c76e98e5c..6348a4902f8 100644 --- a/lib/gitlab/quick_actions/merge_request_actions.rb +++ b/lib/gitlab/quick_actions/merge_request_actions.rb @@ -155,6 +155,20 @@ module Gitlab @execution_message[:approve] = _('Approved the current merge request.') end + desc _('Unapprove a merge request') + explanation _('Unapprove the current merge request.') + types MergeRequest + condition do + quick_action_target.persisted? && quick_action_target.can_be_unapproved_by?(current_user) + end + command :unapprove do + success = MergeRequests::RemoveApprovalService.new(project: quick_action_target.project, current_user: current_user).execute(quick_action_target) + + next unless success + + @execution_message[:unapprove] = _('Unapproved the current merge request.') + end + desc do if quick_action_target.allows_multiple_reviewers? _('Assign reviewer(s)') |