Commit 9c296194 authored by Nick Thomas's avatar Nick Thomas

Merge branch '6022-ee-extract-slash_commands-in-ce' into 'master'

Backport EE SlashCommand Refactor

See merge request gitlab-org/gitlab-ce!19177
parents 848ecbc7 4f20bf95
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