Backport changes from EE to minimize the CE/EE diff in Projects::Settings::IntegrationsController
Signed-off-by: Rémy Coutable <remy@rymai.me>
This commit is contained in:
parent
6d81905faf
commit
8d024ba79a
2 changed files with 17 additions and 2 deletions
|
@ -11,7 +11,14 @@ module Projects
|
||||||
@hook = ProjectHook.new
|
@hook = ProjectHook.new
|
||||||
|
|
||||||
# Services
|
# Services
|
||||||
@services = @project.find_or_initialize_services
|
@services = @project.find_or_initialize_services(exceptions: service_exceptions)
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
# Returns a list of services that should be hidden from the list
|
||||||
|
def service_exceptions
|
||||||
|
@project.disabled_services.dup
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -998,7 +998,7 @@ class Project < ActiveRecord::Base
|
||||||
|
|
||||||
available_services_names = Service.available_services_names - exceptions
|
available_services_names = Service.available_services_names - exceptions
|
||||||
|
|
||||||
available_services_names.map do |service_name|
|
available_services = available_services_names.map do |service_name|
|
||||||
service = find_service(services, service_name)
|
service = find_service(services, service_name)
|
||||||
|
|
||||||
if service
|
if service
|
||||||
|
@ -1015,6 +1015,14 @@ class Project < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
available_services.reject do |service|
|
||||||
|
disabled_services.include?(service.to_param)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def disabled_services
|
||||||
|
[]
|
||||||
end
|
end
|
||||||
|
|
||||||
def find_or_initialize_service(name)
|
def find_or_initialize_service(name)
|
||||||
|
|
Loading…
Reference in a new issue