From ddbe676dc318b87c3d656a08bbf5d75485ad544b Mon Sep 17 00:00:00 2001 From: Thomas Balthazar Date: Thu, 8 Sep 2016 11:18:41 +0200 Subject: Add a /wip slash command It toggles the 'WIP' prefix in the MR title. --- app/services/slash_commands/interpret_service.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'app/services/slash_commands') diff --git a/app/services/slash_commands/interpret_service.rb b/app/services/slash_commands/interpret_service.rb index ffcad5b3a87..1725a30fae5 100644 --- a/app/services/slash_commands/interpret_service.rb +++ b/app/services/slash_commands/interpret_service.rb @@ -214,6 +214,18 @@ module SlashCommands @updates[:due_date] = nil end + desc do + "Toggle the Work In Progress status" + end + condition do + issuable.persisted? && + issuable.respond_to?(:work_in_progress?) && + current_user.can?(:"update_#{issuable.to_ability_name}", issuable) + end + command :wip do + @updates[:wip_event] = issuable.work_in_progress? ? 'unwip' : 'wip' + end + # This is a dummy command, so that it appears in the autocomplete commands desc 'CC' params '@user' -- cgit v1.2.3