2016-08-24 12:49:21 +05:30
|
|
|
module ServicesHelper
|
|
|
|
def service_event_description(event)
|
|
|
|
case event
|
|
|
|
when "push"
|
|
|
|
"Event will be triggered by a push to the repository"
|
|
|
|
when "tag_push"
|
|
|
|
"Event will be triggered when a new tag is pushed to the repository"
|
|
|
|
when "note"
|
|
|
|
"Event will be triggered when someone adds a comment"
|
|
|
|
when "issue"
|
2016-09-29 09:46:39 +05:30
|
|
|
"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-08-24 12:49:21 +05:30
|
|
|
when "merge_request"
|
|
|
|
"Event will be triggered when a merge request is created/updated/merged"
|
|
|
|
when "build"
|
|
|
|
"Event will be triggered when a build status changes"
|
|
|
|
when "wiki_page"
|
|
|
|
"Event will be triggered when a wiki page is created/updated"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def service_event_field_name(event)
|
2016-09-29 09:46:39 +05:30
|
|
|
event = event.pluralize if %w[merge_request issue confidential_issue].include?(event)
|
2016-08-24 12:49:21 +05:30
|
|
|
"#{event}_events"
|
|
|
|
end
|
|
|
|
end
|