From 78dc1b58a64be03e6d3622aab5605e1d5f6a6643 Mon Sep 17 00:00:00 2001 From: Felipe Artur Date: Mon, 4 Mar 2019 09:21:47 +0000 Subject: Show commands applied message when promoting issues Fix 'commands applied' messages not being shown when issue is promoted to epic using slash commands. --- lib/gitlab/quick_actions/command_definition.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib') 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) -- cgit v1.2.3