diff options
author | Toon Claes <toon@iotcl.com> | 2017-07-07 09:20:46 +0200 |
---|---|---|
committer | Toon Claes <toon@iotcl.com> | 2017-07-07 09:30:14 +0200 |
commit | acbad6d8372a820487376e7011004796b28a763f (patch) | |
tree | 6bc54814a95e3099ded494130dd9f210410b904d | |
parent | 8a47c720e3ed117403c55389bd8d6a5411dba842 (diff) | |
download | gitlab-ce-tc-follow-up-mia.tar.gz |
Remove /reassign quick actiontc-follow-up-mia
/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.
-rw-r--r-- | app/services/quick_actions/interpret_service.rb | 26 | ||||
-rw-r--r-- | changelogs/unreleased/tc-follow-up-mia.yml | 4 | ||||
-rw-r--r-- | spec/services/quick_actions/interpret_service_spec.rb | 16 |
3 files changed, 4 insertions, 42 deletions
diff --git a/app/services/quick_actions/interpret_service.rb b/app/services/quick_actions/interpret_service.rb index e4dfe87e614..6f82159e6c7 100644 --- a/app/services/quick_actions/interpret_service.rb +++ b/app/services/quick_actions/interpret_service.rb @@ -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 diff --git a/changelogs/unreleased/tc-follow-up-mia.yml b/changelogs/unreleased/tc-follow-up-mia.yml new file mode 100644 index 00000000000..6327f02032e --- /dev/null +++ b/changelogs/unreleased/tc-follow-up-mia.yml @@ -0,0 +1,4 @@ +--- +title: Undo adding the /reassign quick action +merge_request: 12701 +author: diff --git a/spec/services/quick_actions/interpret_service_spec.rb b/spec/services/quick_actions/interpret_service_spec.rb index 35373675894..a2db3f68ff7 100644 --- a/spec/services/quick_actions/interpret_service_spec.rb +++ b/spec/services/quick_actions/interpret_service_spec.rb @@ -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 } |