gitlab-org--gitlab-foss/lib/gitlab/slash_commands/issue_show.rb
Eric Eastwood ea090291bb Rename "Slash commands" to "Quick actions"
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`
2017-06-15 09:01:56 -05:00

23 lines
529 B
Ruby

module Gitlab
module SlashCommands
class IssueShow < IssueCommand
def self.match(text)
/\Aissue\s+show\s+#{Issue.reference_prefix}?(?<iid>\d+)/.match(text)
end
def self.help_message
"issue show <id>"
end
def execute(match)
issue = find_by_iid(match[:iid])
if issue
Gitlab::SlashCommands::Presenters::IssueShow.new(issue).present
else
Gitlab::SlashCommands::Presenters::Access.new.not_found
end
end
end
end
end