diff options
author | Felipe Artur <fcardozo@gitlab.com> | 2019-03-04 09:21:47 +0000 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2019-03-04 09:21:47 +0000 |
commit | 78dc1b58a64be03e6d3622aab5605e1d5f6a6643 (patch) | |
tree | d0dd8c328bb0c7ce2311c79f525f7f23db9e0ff0 /lib/gitlab/quick_actions/command_definition.rb | |
parent | 4b0036b87ee30ce0a3687dd052514b571f4d520f (diff) | |
download | gitlab-ce-78dc1b58a64be03e6d3622aab5605e1d5f6a6643.tar.gz |
Show commands applied message when promoting issues
Fix 'commands applied' messages not being shown when issue is promoted to epic
using slash commands.
Diffstat (limited to 'lib/gitlab/quick_actions/command_definition.rb')
-rw-r--r-- | lib/gitlab/quick_actions/command_definition.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/gitlab/quick_actions/command_definition.rb b/lib/gitlab/quick_actions/command_definition.rb index 259345b8a9a..e7bfcb16582 100644 --- a/lib/gitlab/quick_actions/command_definition.rb +++ b/lib/gitlab/quick_actions/command_definition.rb @@ -48,6 +48,8 @@ module Gitlab def execute(context, arg) return if noop? || !available?(context) + count_commands_executed_in(context) + execute_block(action_block, context, arg) end @@ -73,6 +75,13 @@ module Gitlab private + def count_commands_executed_in(context) + return unless context.respond_to?(:commands_executed_count=) + + context.commands_executed_count ||= 0 + context.commands_executed_count += 1 + end + def execute_block(block, context, arg) if arg.present? parsed = parse_params(arg, context) |