summaryrefslogtreecommitdiff
path: root/app/services/quick_actions
diff options
context:
space:
mode:
authorMehdi Lahmam <mehdi@lahmam.com>2017-08-07 00:12:13 +0200
committerMehdi Lahmam <mehdi@lahmam.com>2017-08-07 14:40:33 +0200
commit5ad9d94d8e3f9222d69fc0e408ae2e37363bed53 (patch)
treeaad2283e769c3ba29bb8f4bceec685f269719a29 /app/services/quick_actions
parent4b3011e1c20077470ce946d703d98259f88ef268 (diff)
downloadgitlab-ce-5ad9d94d8e3f9222d69fc0e408ae2e37363bed53.tar.gz
Add `/assign me` alias support for assigning issuables to oneself
Currently, when a user wants to assign an issue/MR to himself, he needs to type his full username or select it from the suggested ones in the dropdown list. This commits suggest a faster solution which is typing `/assign me` Closes #35304.
Diffstat (limited to 'app/services/quick_actions')
-rw-r--r--app/services/quick_actions/interpret_service.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/services/quick_actions/interpret_service.rb b/app/services/quick_actions/interpret_service.rb
index c22bf7498bb..c7832c47e1a 100644
--- a/app/services/quick_actions/interpret_service.rb
+++ b/app/services/quick_actions/interpret_service.rb
@@ -511,7 +511,12 @@ module QuickActions
users = extract_references(params, :user)
if users.empty?
- users = User.where(username: params.split(' ').map(&:strip))
+ users =
+ if params == 'me'
+ [current_user]
+ else
+ User.where(username: params.split(' ').map(&:strip))
+ end
end
users