debian-mirror-gitlab/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

2019-02-15 15:39:39 +05:30
# frozen_string_literal: true
2017-08-17 22:00:37 +05:30
module Gitlab
2017-09-10 17:25:29 +05:30
module SlashCommands
2017-08-17 22:00:37 +05:30
module Presenters
class IssueNew < Presenters::Base
include Presenters::IssueBase
def present
2020-01-01 13:55:28 +05:30
in_channel_response(response_message)
2017-08-17 22:00:37 +05:30
end
private
2021-04-29 21:17:54 +05:30
def pretext
"I created an issue on #{author_profile_link}'s behalf: *#{issue_link}* in #{project_link}"
2020-01-01 13:55:28 +05:30
end
2021-04-29 21:17:54 +05:30
def issue_link
"[#{issue.to_reference}](#{project_issue_url(issue.project, issue)})"
2017-08-17 22:00:37 +05:30
end
2021-04-29 21:17:54 +05:30
def response_message(custom_pretext: pretext)
{
text: pretext
}
2017-08-17 22:00:37 +05:30
end
end
end
end
end