diff --git a/app/models/project_services/discord_service.rb b/app/models/project_services/discord_service.rb index 37bbb9b875239956ffbc57b30a2304954dc939e5..d7adf63fde4cc6dcfa9ef6590e8f7c5457509d60 100644 --- a/app/models/project_services/discord_service.rb +++ b/app/models/project_services/discord_service.rb @@ -3,6 +3,8 @@ require "discordrb/webhooks" class DiscordService < ChatNotificationService + include ActionView::Helpers::UrlHelper + ATTACHMENT_REGEX = /: (?.*?)\n - (?.*)\n*/.freeze def title @@ -10,7 +12,7 @@ def title end def description - s_("DiscordService|Receive event notifications in Discord") + s_("DiscordService|Send notifications about project events to a Discord channel.") end def self.to_param @@ -18,13 +20,8 @@ def self.to_param end def help - "This service sends notifications about project events to Discord channels.
- To set up this service: -
    -
  1. Setup a custom Incoming Webhook.
  2. -
  3. Paste the Webhook URL into the field below.
  4. -
  5. Select events below to enable notifications.
  6. -
" + docs_link = link_to _('How do I set up this service?'), Rails.application.routes.url_helpers.help_page_url('user/project/integrations/discord_notifications'), target: '_blank', rel: 'noopener noreferrer' + s_('Send notifications about project events to a Discord channel. %{docs_link}').html_safe % { docs_link: docs_link.html_safe } end def event_field(event) @@ -36,13 +33,12 @@ def default_channel_placeholder end def self.supported_events - %w[push issue confidential_issue merge_request note confidential_note tag_push - pipeline wiki_page] + %w[push issue confidential_issue merge_request note confidential_note tag_push pipeline wiki_page] end def default_fields [ - { type: "text", name: "webhook", placeholder: "e.g. https://discordapp.com/api/webhooks/…" }, + { type: "text", name: "webhook", placeholder: "https://discordapp.com/api/webhooks/…", help: "URL to the webhook for the Discord channel." }, { type: "checkbox", name: "notify_only_broken_pipelines" }, { type: 'select', name: 'branches_to_be_notified', choices: branch_choices } ] diff --git a/changelogs/unreleased/ui-text-discord-integration.yml b/changelogs/unreleased/ui-text-discord-integration.yml new file mode 100644 index 0000000000000000000000000000000000000000..df25bf624b9837ceb75191403967ce1396af419e --- /dev/null +++ b/changelogs/unreleased/ui-text-discord-integration.yml @@ -0,0 +1,5 @@ +--- +title: Update Discord integration UI text +merge_request: 58842 +author: +type: other diff --git a/doc/user/project/integrations/discord_notifications.md b/doc/user/project/integrations/discord_notifications.md index 624c0252f23635cf63d6c7f7b7fbd4ddb5bcd00f..2ec657eec22e0edc5d30672a333039153ef73d02 100644 --- a/doc/user/project/integrations/discord_notifications.md +++ b/doc/user/project/integrations/discord_notifications.md @@ -10,7 +10,8 @@ info: To determine the technical writer assigned to the Stage/Group associated w The Discord Notifications service sends event notifications from GitLab to the channel for which the webhook was created. -To send GitLab event notifications to a Discord channel, create a webhook in Discord and configure it in GitLab. +To send GitLab event notifications to a Discord channel, [create a webhook in Discord](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks) +and configure it in GitLab. ## Create webhook diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 1fded0f20e0b1fe09ad7dadd3e54c243bede1f0d..8e154d0b438c998b51b51d6e8c886bff69e3549f 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -11077,7 +11077,7 @@ msgstr "" msgid "DiscordService|Discord Notifications" msgstr "" -msgid "DiscordService|Receive event notifications in Discord" +msgid "DiscordService|Send notifications about project events to a Discord channel." msgstr "" msgid "Discover GitLab Geo" @@ -15708,6 +15708,9 @@ msgstr "" msgid "How do I mirror repositories?" msgstr "" +msgid "How do I set up this service?" +msgstr "" + msgid "How does cleanup work?" msgstr "" @@ -27947,6 +27950,9 @@ msgstr "" msgid "Send notifications about project events to Mattermost channels. %{docs_link}" msgstr "" +msgid "Send notifications about project events to a Discord channel. %{docs_link}" +msgstr "" + msgid "Send report" msgstr ""