gitlab-org--gitlab-foss/lib/gitlab/slash_commands/presenters/issue_new.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
662 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2017-01-19 08:22:09 +00:00
module Gitlab
module SlashCommands
2017-01-19 08:22:09 +00:00
module Presenters
2017-01-26 14:30:34 +00:00
class IssueNew < Presenters::Base
include Presenters::IssueBase
2017-01-26 14:30:34 +00:00
2017-01-19 08:22:09 +00:00
def present
in_channel_response(response_message)
2017-01-19 08:22:09 +00:00
end
private
def pretext
"I created an issue on #{author_profile_link}'s behalf: *#{issue_link}* in #{project_link}"
end
def issue_link
"[#{issue.to_reference}](#{project_issue_url(issue.project, issue)})"
2017-01-19 08:22:09 +00:00
end
def response_message(custom_pretext: pretext)
{
text: pretext
}
2017-01-19 08:22:09 +00:00
end
end
end
end
end