Remove /reassign quick action

/reassign should only work when multiple assignees are available. And
since this is only the case for GitLab EE, remove it from CE.

This was picked using 517c97eb12e44f354787313dd35ac7a1642f5b20 of gitlab-ee.
This commit is contained in:
Toon Claes 2017-07-07 09:20:46 +02:00
parent 8a47c720e3
commit acbad6d837
3 changed files with 4 additions and 42 deletions

View file

@ -146,32 +146,6 @@ module QuickActions
end
end
desc do
"Change assignee#{'(s)' if issuable.allows_multiple_assignees?}"
end
explanation do |users|
users = issuable.allows_multiple_assignees? ? users : users.take(1)
"Change #{'assignee'.pluralize(users.size)} to #{users.map(&:to_reference).to_sentence}."
end
params do
issuable.allows_multiple_assignees? ? '@user1 @user2' : '@user'
end
condition do
issuable.persisted? &&
current_user.can?(:"admin_#{issuable.to_ability_name}", project)
end
parse_params do |assignee_param|
extract_users(assignee_param)
end
command :reassign do |users|
@updates[:assignee_ids] =
if issuable.allows_multiple_assignees?
users.map(&:id)
else
[users.last.id]
end
end
desc 'Set milestone'
explanation do |milestone|
"Sets the milestone to #{milestone.to_reference}." if milestone

View file

@ -0,0 +1,4 @@
---
title: Undo adding the /reassign quick action
merge_request: 12701
author:

View file

@ -431,22 +431,6 @@ describe QuickActions::InterpretService, services: true do
end
end
context 'reassign command' do
let(:content) { '/reassign' }
context 'Issue' do
it 'reassigns user if content contains /reassign @user' do
user = create(:user)
issue.update(assignee_ids: [developer.id])
_, updates = service.execute("/reassign @#{user.username}", issue)
expect(updates).to eq(assignee_ids: [user.id])
end
end
end
it_behaves_like 'milestone command' do
let(:content) { "/milestone %#{milestone.title}" }
let(:issuable) { issue }