Commit f575d1d9 authored by James Edwards-Jones's avatar James Edwards-Jones

Hides Triggers if integration only has one event

Removes confusing/unnecessary checkboxes when trying to configure an
integration. If there is only one supported event we don't need to
allow these to be individually disabled since the integration can be
disabled instead.

E.g. Project Integrations for GitHub, Bugzilla, Asana, Pipeline emails and Gemnasium
parent 12353ea6
......@@ -131,7 +131,14 @@ class Service < ActiveRecord::Base
end
def configurable_events
self.class.supported_events
events = self.class.supported_events
# No need to disable individual triggers when there is only one
if events.count == 1
[]
else
events
end
end
def supported_events
......
......@@ -38,10 +38,6 @@ class GithubService < Service
%w(pipeline)
end
def configurable_events
[]
end
def can_test?
project.pipelines.any?
end
......
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