2018-11-19 21:01:13 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-01-19 03:22:09 -05:00
|
|
|
module Gitlab
|
2017-05-31 01:50:53 -04:00
|
|
|
module SlashCommands
|
2017-01-19 03:22:09 -05:00
|
|
|
module Presenters
|
2017-01-26 09:30:34 -05:00
|
|
|
class IssueNew < Presenters::Base
|
2017-02-08 10:42:27 -05:00
|
|
|
include Presenters::IssueBase
|
2017-01-26 09:30:34 -05:00
|
|
|
|
2017-01-19 03:22:09 -05:00
|
|
|
def present
|
2019-11-29 10:06:43 -05:00
|
|
|
in_channel_response(response_message)
|
2017-01-19 03:22:09 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
2019-11-29 10:06:43 -05:00
|
|
|
def fallback_message
|
|
|
|
"New issue #{issue.to_reference}: #{issue.title}"
|
|
|
|
end
|
|
|
|
|
|
|
|
def fields_with_markdown
|
|
|
|
%i(title pretext text fields)
|
2017-01-19 03:22:09 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def pretext
|
2019-11-29 10:06:43 -05:00
|
|
|
"I created an issue on #{author_profile_link}'s behalf: *#{issue.to_reference}* in #{project_link}"
|
2017-01-19 03:22:09 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|