Commit 4f20bf95 authored by Mark Chao's avatar Mark Chao Committed by Nick Thomas

Backport EE SlashCommand Refactor

parent 848ecbc7
module Gitlab module Gitlab
module SlashCommands module SlashCommands
class Command < BaseCommand class Command < BaseCommand
COMMANDS = [ def self.commands
[
Gitlab::SlashCommands::IssueShow, Gitlab::SlashCommands::IssueShow,
Gitlab::SlashCommands::IssueNew, Gitlab::SlashCommands::IssueNew,
Gitlab::SlashCommands::IssueSearch, Gitlab::SlashCommands::IssueSearch,
Gitlab::SlashCommands::IssueMove, Gitlab::SlashCommands::IssueMove,
Gitlab::SlashCommands::Deploy Gitlab::SlashCommands::Deploy
].freeze ]
end
def execute def execute
command, match = match_command command, match = match_command
...@@ -37,7 +39,7 @@ module Gitlab ...@@ -37,7 +39,7 @@ module Gitlab
private private
def available_commands def available_commands
COMMANDS.select do |klass| self.class.commands.keep_if do |klass|
klass.available?(project) klass.available?(project)
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment