Commit 6e264fb3 authored by Michael Kozono's avatar Michael Kozono

Merge branch 'submit_review_quick_action' into 'master'

Added submit_review quick action

See merge request gitlab-org/gitlab!18974
parents abdc0a7e b2f5c5e4
......@@ -352,7 +352,10 @@ bottom of the screen with two buttons:
Clicking **Submit review** will publish all comments. Any quick actions
submitted are performed at this time.
Alternatively, every pending comment has a button to finish the entire review.
Alternatively, to finish the entire review from a pending comment:
- Click the **Finish review** button on the comment.
- Use the `/submit_review` [quick action](../project/quick_actions.md) in the text of the comment.
![Review submission](img/review_preview.png)
......
......@@ -68,7 +68,8 @@ The following quick actions are applicable to descriptions, discussions and thre
| `/remove_zoom` | ✓ | | | Remove Zoom meeting from this issue. ([Introduced in GitLab 12.4](https://gitlab.com/gitlab-org/gitlab/merge_requests/16609)) |
| `/target_branch <local branch name>` | | ✓ | | Set target branch |
| `/wip` | | ✓ | | Toggle the Work In Progress status |
| `/approve` | | ✓ | | Approve the merge request |
| `/approve` | | ✓ | | Approve the merge request **(STARTER)** |
| `/submit_review` | | ✓ | | Submit a pending review. ([Introduced in GitLab 12.5](https://gitlab.com/gitlab-org/gitlab/issues/8041)) **(PREMIUM)** |
| `/merge` | | ✓ | | Merge (when pipeline succeeds) |
| `/child_epic <epic>` | | | ✓ | Add child epic to `<epic>`. The `<epic>` value should be in the format of `&epic`, `group&epic`, or a URL to an epic. ([Introduced in GitLab 12.0](https://gitlab.com/gitlab-org/gitlab/issues/7330)) **(ULTIMATE)** |
| `/remove_child_epic <epic>` | | | ✓ | Remove child epic from `<epic>`. The `<epic>` value should be in the format of `&epic`, `group&epic`, or a URL to an epic. ([Introduced in GitLab 12.0](https://gitlab.com/gitlab-org/gitlab/issues/7330)) **(ULTIMATE)** |
......
---
title: Added submit_review quick action
merge_request: 18974
author:
type: added
......@@ -20,6 +20,21 @@ module EE
@execution_message[:approve] = _('Approved the current merge request.')
end
end
desc _('Submit a review')
explanation _('Submit the current review.')
types MergeRequest
condition do
quick_action_target.persisted? && quick_action_target.project.feature_available?(:batch_comments, current_user)
end
command :submit_review do
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
end
end
......
......@@ -696,6 +696,23 @@ describe QuickActions::InterpretService do
end
end
context 'submit_review command' do
let(:merge_request) { create(:merge_request, source_project: project) }
let(:content) { '/submit_review' }
let!(:draft_note) { create(:draft_note, merge_request: merge_request, author: current_user) }
before do
stub_licensed_features(batch_comments: true)
end
it 'submits the users current review' do
_, _, message = service.execute(content, merge_request)
expect { draft_note.reload }.to raise_error(ActiveRecord::RecordNotFound)
expect(message).to eq('Submitted the current review.')
end
end
shared_examples 'weight command' do
it 'populates weight specified by the /weight command' do
_, updates = service.execute(content, issuable)
......
......@@ -15967,6 +15967,9 @@ msgstr ""
msgid "Subkeys"
msgstr ""
msgid "Submit a review"
msgstr ""
msgid "Submit as spam"
msgstr ""
......@@ -15982,6 +15985,12 @@ msgstr ""
msgid "Submit search"
msgstr ""
msgid "Submit the current review."
msgstr ""
msgid "Submitted the current review."
msgstr ""
msgid "Subscribe"
msgstr ""
......
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