2018-11-20 02:01:13 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-01-19 08:22:09 +00:00
|
|
|
module Gitlab
|
2017-05-31 05:50:53 +00:00
|
|
|
module SlashCommands
|
2017-01-19 08:22:09 +00:00
|
|
|
module Presenters
|
2017-01-26 14:30:34 +00:00
|
|
|
class IssueNew < Presenters::Base
|
2017-02-08 15:42:27 +00:00
|
|
|
include Presenters::IssueBase
|
2017-01-26 14:30:34 +00:00
|
|
|
|
2017-01-19 08:22:09 +00:00
|
|
|
def present
|
2019-11-29 15:06:43 +00:00
|
|
|
in_channel_response(response_message)
|
2017-01-19 08:22:09 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
2021-03-31 03:09:00 +00:00
|
|
|
def pretext
|
|
|
|
"I created an issue on #{author_profile_link}'s behalf: *#{issue_link}* in #{project_link}"
|
2019-11-29 15:06:43 +00:00
|
|
|
end
|
|
|
|
|
2021-03-31 03:09:00 +00:00
|
|
|
def issue_link
|
|
|
|
"[#{issue.to_reference}](#{project_issue_url(issue.project, issue)})"
|
2017-01-19 08:22:09 +00:00
|
|
|
end
|
|
|
|
|
2021-03-31 03:09:00 +00:00
|
|
|
def response_message(custom_pretext: pretext)
|
|
|
|
{
|
|
|
|
text: pretext
|
|
|
|
}
|
2017-01-19 08:22:09 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|