diff options
author | Rémy Coutable <remy@rymai.me> | 2016-08-12 11:19:29 +0200 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-08-13 00:36:47 +0200 |
commit | f393f2dde016edf63b5168eb63405f15d65803eb (patch) | |
tree | 12fc300a54c66a8b16b5d22000f493d92f03ba42 /app/controllers/projects_controller.rb | |
parent | aadc5062ebe755aaf3fbb27fdd0af093770c9ce8 (diff) | |
download | gitlab-ce-f393f2dde016edf63b5168eb63405f15d65803eb.tar.gz |
Simplify the slash commands DSL to store action blocks instead of creating methods
Other improvements:
- Ensure slash commands autocomplete doesn't break when noteable_type is not given
- Slash commands: improve autocomplete behavior and /due command
- We don't display slash commands for note edit forms.
- Add tests for reply by email with slash commands
- Be sure to execute slash commands after the note creation in Notes::CreateService
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'app/controllers/projects_controller.rb')
-rw-r--r-- | app/controllers/projects_controller.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index af20984cbe7..9c387fd3daa 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -134,10 +134,8 @@ class ProjectsController < Projects::ApplicationController end def autocomplete_sources - note_type = params['type'] - note_id = params['type_id'] - autocomplete = ::Projects::AutocompleteService.new(@project, current_user) - participants = ::Projects::ParticipantsService.new(@project, current_user).execute(note_type, note_id) + autocomplete = ::Projects::AutocompleteService.new(@project, current_user, params) + participants = ::Projects::ParticipantsService.new(@project, current_user, params).execute @suggestions = { emojis: Gitlab::AwardEmoji.urls, @@ -146,7 +144,7 @@ class ProjectsController < Projects::ApplicationController mergerequests: autocomplete.merge_requests, labels: autocomplete.labels, members: participants, - commands: autocomplete.commands(note_type, note_id) + commands: autocomplete.commands } respond_to do |format| |