mirror of
https://gitlab.com/gitlab-org/gitlab-foss.git
synced 2025-08-03 16:04:30 +00:00
26 lines
552 B
Ruby
26 lines
552 B
Ruby
# frozen_string_literal: true
|
|
|
|
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
|