2016-07-06 16:52:00 -04:00
|
|
|
module ServicesHelper
|
|
|
|
def service_event_description(event)
|
|
|
|
case event
|
|
|
|
when "push"
|
2016-07-13 15:49:47 -04:00
|
|
|
"Event will be triggered by a push to the repository"
|
2016-07-06 16:52:00 -04:00
|
|
|
when "tag_push"
|
2016-07-13 15:49:47 -04:00
|
|
|
"Event will be triggered when a new tag is pushed to the repository"
|
2016-07-06 16:52:00 -04:00
|
|
|
when "note"
|
2016-07-13 15:49:47 -04:00
|
|
|
"Event will be triggered when someone adds a comment"
|
2016-07-06 16:52:00 -04:00
|
|
|
when "issue"
|
2016-08-30 17:39:25 -04:00
|
|
|
"Event will be triggered when an issue is created/updated/closed"
|
|
|
|
when "confidential_issue"
|
|
|
|
"Event will be triggered when a confidential issue is created/updated/closed"
|
2016-07-06 16:52:00 -04:00
|
|
|
when "merge_request"
|
2016-07-13 15:49:47 -04:00
|
|
|
"Event will be triggered when a merge request is created/updated/merged"
|
2016-07-06 16:52:00 -04:00
|
|
|
when "build"
|
2016-07-13 15:49:47 -04:00
|
|
|
"Event will be triggered when a build status changes"
|
2016-07-06 16:52:00 -04:00
|
|
|
when "wiki_page"
|
2016-07-13 15:49:47 -04:00
|
|
|
"Event will be triggered when a wiki page is created/updated"
|
2016-07-06 16:52:00 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def service_event_field_name(event)
|
2016-08-30 17:39:25 -04:00
|
|
|
event = event.pluralize if %w[merge_request issue confidential_issue].include?(event)
|
2016-07-06 16:52:00 -04:00
|
|
|
"#{event}_events"
|
|
|
|
end
|
|
|
|
end
|