Commit d7dd2618 authored by Sean Arnold's avatar Sean Arnold

Move description text to helper & translate

- Translate text
- Update references
parent d04c20ea
......@@ -4,25 +4,29 @@ module ServicesHelper
def service_event_description(event)
case event
when "push", "push_events"
"Event will be triggered by a push to the repository"
s_("ProjectService|Event will be triggered by a push to the repository")
when "tag_push", "tag_push_events"
"Event will be triggered when a new tag is pushed to the repository"
s_("ProjectService|Event will be triggered when a new tag is pushed to the repository")
when "note", "note_events"
"Event will be triggered when someone adds a comment"
s_("ProjectService|Event will be triggered when someone adds a comment")
when "confidential_note", "confidential_note_events"
"Event will be triggered when someone adds a comment on a confidential issue"
s_("ProjectService|Event will be triggered when someone adds a comment on a confidential issue")
when "issue", "issue_events"
"Event will be triggered when an issue is created/updated/closed"
when "confidential_issue", "confidential_issues_events"
"Event will be triggered when a confidential issue is created/updated/closed"
s_("ProjectService|Event will be triggered when an issue is created/updated/closed")
when "confidential_issue", "confidential_issue_events"
s_("ProjectService|Event will be triggered when a confidential issue is created/updated/closed")
when "merge_request", "merge_request_events"
"Event will be triggered when a merge request is created/updated/merged"
s_("ProjectService|Event will be triggered when a merge request is created/updated/merged")
when "pipeline", "pipeline_events"
"Event will be triggered when a pipeline status changes"
s_("ProjectService|Event will be triggered when a pipeline status changes")
when "wiki_page", "wiki_page_events"
"Event will be triggered when a wiki page is created/updated"
s_("ProjectService|Event will be triggered when a wiki page is created/updated")
when "commit", "commit_events"
"Event will be triggered when a commit is created/updated"
s_("ProjectService|Event will be triggered when a commit is created/updated")
when "deployment"
s_("ProjectService|Event will be triggered when a deployment finishes")
when "alert"
s_("ProjectService|Event will be triggered when a new, unique alert is recorded")
end
end
......
......@@ -439,6 +439,8 @@ class JiraService < IssueTrackerService
s_("JiraService|Jira comments will be created when an issue gets referenced in a merge request.")
when "commit", "commit_events"
s_("JiraService|Jira comments will be created when an issue gets referenced in a commit.")
else
super
end
end
end
......@@ -385,30 +385,7 @@ class Service < ApplicationRecord
end
def self.event_description(event)
case event
when "push", "push_events"
"Event will be triggered by a push to the repository"
when "tag_push", "tag_push_events"
"Event will be triggered when a new tag is pushed to the repository"
when "note", "note_events"
"Event will be triggered when someone adds a comment"
when "issue", "issue_events"
"Event will be triggered when an issue is created/updated/closed"
when "confidential_issue", "confidential_issue_events"
"Event will be triggered when a confidential issue is created/updated/closed"
when "merge_request", "merge_request_events"
"Event will be triggered when a merge request is created/updated/merged"
when "pipeline", "pipeline_events"
"Event will be triggered when a pipeline status changes"
when "wiki_page", "wiki_page_events"
"Event will be triggered when a wiki page is created/updated"
when "commit", "commit_events"
"Event will be triggered when a commit is created/updated"
when "deployment"
"Event will be triggered when a deployment finishes"
when "alert"
"Event will be triggered when a new, unique alert is recorded"
end
ServicesHelper.service_event_description(event)
end
def valid_recipients?
......
......@@ -14,7 +14,7 @@ class ServiceEventEntity < Grape::Entity
end
expose :description do |event|
service.class.event_description(event)
ServicesHelper.service_event_description(event)
end
expose :field, if: -> (_, _) { event_field } do
......
......@@ -17452,6 +17452,42 @@ msgstr ""
msgid "ProjectService|Comment"
msgstr ""
msgid "ProjectService|Event will be triggered by a push to the repository"
msgstr ""
msgid "ProjectService|Event will be triggered when a commit is created/updated"
msgstr ""
msgid "ProjectService|Event will be triggered when a confidential issue is created/updated/closed"
msgstr ""
msgid "ProjectService|Event will be triggered when a deployment finishes"
msgstr ""
msgid "ProjectService|Event will be triggered when a merge request is created/updated/merged"
msgstr ""
msgid "ProjectService|Event will be triggered when a new tag is pushed to the repository"
msgstr ""
msgid "ProjectService|Event will be triggered when a new, unique alert is recorded"
msgstr ""
msgid "ProjectService|Event will be triggered when a pipeline status changes"
msgstr ""
msgid "ProjectService|Event will be triggered when a wiki page is created/updated"
msgstr ""
msgid "ProjectService|Event will be triggered when an issue is created/updated/closed"
msgstr ""
msgid "ProjectService|Event will be triggered when someone adds a comment"
msgstr ""
msgid "ProjectService|Event will be triggered when someone adds a comment on a confidential issue"
msgstr ""
msgid "ProjectService|Perform common operations on GitLab project: %{project_name}"
msgstr ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment