ea090291bb
Fix https://gitlab.com/gitlab-org/gitlab-ce/issues/27070 Deprecate "chat commands" in favor of "slash commands" We looked for things like: - `slash commmand` - `slash_command` - `slash-command` - `SlashCommand`
23 lines
521 B
Ruby
23 lines
521 B
Ruby
module Gitlab
|
|
module SlashCommands
|
|
class IssueSearch < IssueCommand
|
|
def self.match(text)
|
|
/\Aissue\s+search\s+(?<query>.*)/.match(text)
|
|
end
|
|
|
|
def self.help_message
|
|
"issue search <your query>"
|
|
end
|
|
|
|
def execute(match)
|
|
issues = collection.search(match[:query]).limit(QUERY_LIMIT)
|
|
|
|
if issues.present?
|
|
Presenters::IssueSearch.new(issues).present
|
|
else
|
|
Presenters::Access.new(issues).not_found
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|