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::IssueNew, Gitlab::SlashCommands::IssueShow,
Gitlab::SlashCommands::IssueSearch, Gitlab::SlashCommands::IssueNew,
Gitlab::SlashCommands::IssueMove, Gitlab::SlashCommands::IssueSearch,
Gitlab::SlashCommands::Deploy Gitlab::SlashCommands::IssueMove,
].freeze Gitlab::SlashCommands::Deploy
]
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