summaryrefslogtreecommitdiff
path: root/app/services/quick_actions
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2018-11-07 13:33:42 +0100
committerBob Van Landuyt <bob@vanlanduyt.co>2018-11-07 16:27:55 +0100
commitc85a19f920da1b544bbfae344145503c25e71048 (patch)
tree8acaf8e1b6cac9e71dbf545e8cf1443d03931280 /app/services/quick_actions
parent6fbdc5ed5224154b89cf351e11a8f9db48e6d7f0 (diff)
downloadgitlab-ce-c85a19f920da1b544bbfae344145503c25e71048.tar.gz
Allow limiting quick actions to execute
Sometimes we don't want to trigger any quick actions that cause side effects. For example when building a record to validate. This allows listing the quick actions that need to be performed.
Diffstat (limited to 'app/services/quick_actions')
-rw-r--r--app/services/quick_actions/interpret_service.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/services/quick_actions/interpret_service.rb b/app/services/quick_actions/interpret_service.rb
index eb431c36807..9c81de7e90e 100644
--- a/app/services/quick_actions/interpret_service.rb
+++ b/app/services/quick_actions/interpret_service.rb
@@ -23,13 +23,13 @@ module QuickActions
# Takes a text and interprets the commands that are extracted from it.
# Returns the content without commands, and hash of changes to be applied to a record.
- def execute(content, issuable)
+ def execute(content, issuable, only: nil)
return [content, {}] unless current_user.can?(:use_quick_actions)
@issuable = issuable
@updates = {}
- content, commands = extractor.extract_commands(content)
+ content, commands = extractor.extract_commands(content, only: only)
extract_updates(commands)
[content, @updates]