debian-mirror-gitlab/app/models/project_services/mattermost_service.rb

32 lines
824 B
Ruby
Raw Normal View History

2018-11-20 20:47:30 +05:30
# frozen_string_literal: true
2017-08-17 22:00:37 +05:30
class MattermostService < ChatNotificationService
2021-04-17 20:07:23 +05:30
include SlackMattermost::Notifier
2021-04-29 21:17:54 +05:30
include ActionView::Helpers::UrlHelper
2019-12-04 20:38:33 +05:30
2017-08-17 22:00:37 +05:30
def title
2021-04-29 21:17:54 +05:30
s_('Mattermost notifications')
2017-08-17 22:00:37 +05:30
end
def description
2021-04-29 21:17:54 +05:30
s_('Send notifications about project events to Mattermost channels.')
2017-08-17 22:00:37 +05:30
end
def self.to_param
'mattermost'
end
def help
2021-04-29 21:17:54 +05:30
docs_link = link_to _('Learn more.'), Rails.application.routes.url_helpers.help_page_url('user/project/integrations/mattermost'), target: '_blank', rel: 'noopener noreferrer'
s_('Send notifications about project events to Mattermost channels. %{docs_link}').html_safe % { docs_link: docs_link.html_safe }
2017-08-17 22:00:37 +05:30
end
def default_channel_placeholder
2021-04-29 21:17:54 +05:30
'my-channel'
2017-08-17 22:00:37 +05:30
end
def webhook_placeholder
2021-04-29 21:17:54 +05:30
'http://mattermost.example.com/hooks/'
2017-08-17 22:00:37 +05:30
end
end