2016-07-06 20:52:00 +00:00
|
|
|
module ServicesHelper
|
|
|
|
def service_event_description(event)
|
|
|
|
case event
|
|
|
|
when "push"
|
2016-07-12 20:00:49 +00:00
|
|
|
"Webhook will be triggered by a push to the repository"
|
2016-07-06 20:52:00 +00:00
|
|
|
when "tag_push"
|
|
|
|
"Webhook will be triggered when a new tag is pushed to the repository"
|
|
|
|
when "note"
|
|
|
|
"Webhook will be triggered when someone adds a comment"
|
|
|
|
when "issue"
|
|
|
|
"Webhook will be triggered when an issue is created/updated/merged"
|
|
|
|
when "merge_request"
|
|
|
|
"Webhook will be triggered when a merge request is created/updated/merged"
|
|
|
|
when "build"
|
|
|
|
"Webhook will be triggered when a build status changes"
|
|
|
|
when "wiki_page"
|
|
|
|
"Webhook will be triggered when a wiki page is created/updated"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def service_event_field_name(event)
|
2016-07-12 20:00:49 +00:00
|
|
|
event = event.pluralize if %w[merge_request issue].include?(event)
|
2016-07-06 20:52:00 +00:00
|
|
|
"#{event}_events"
|
|
|
|
end
|
|
|
|
end
|