Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/admin/services_controller.rb')
-rw-r--r--app/controllers/admin/services_controller.rb20
1 files changed, 11 insertions, 9 deletions
diff --git a/app/controllers/admin/services_controller.rb b/app/controllers/admin/services_controller.rb
index 9f951e838c8..d34773ee4dc 100644
--- a/app/controllers/admin/services_controller.rb
+++ b/app/controllers/admin/services_controller.rb
@@ -1,28 +1,28 @@
# frozen_string_literal: true
class Admin::ServicesController < Admin::ApplicationController
- include ServiceParams
+ include Integrations::Params
- before_action :service, only: [:edit, :update]
+ before_action :integration, only: [:edit, :update]
before_action :disable_query_limiting, only: [:index]
feature_category :integrations
def index
- @activated_services = Service.for_template.active.sort_by(&:title)
- @existing_instance_types = Service.for_instance.pluck(:type) # rubocop: disable CodeReuse/ActiveRecord
+ @activated_services = Integration.for_template.active.sort_by(&:title)
+ @existing_instance_types = Integration.for_instance.pluck(:type) # rubocop: disable CodeReuse/ActiveRecord
end
def edit
- if service.nil? || Service.instance_exists_for?(service.type)
+ if integration.nil? || Integration.instance_exists_for?(integration.type)
redirect_to admin_application_settings_services_path,
alert: "Service is unknown or it doesn't exist"
end
end
def update
- if service.update(service_params[:service])
- PropagateServiceTemplateWorker.perform_async(service.id) if service.active? # rubocop:disable CodeReuse/Worker
+ if integration.update(integration_params[:integration])
+ PropagateServiceTemplateWorker.perform_async(integration.id) if integration.active? # rubocop:disable CodeReuse/Worker
redirect_to admin_application_settings_services_path,
notice: 'Application settings saved successfully'
@@ -34,9 +34,11 @@ class Admin::ServicesController < Admin::ApplicationController
private
# rubocop: disable CodeReuse/ActiveRecord
- def service
- @service ||= Service.find_by(id: params[:id], template: true)
+ def integration
+ @integration ||= Integration.find_by(id: params[:id], template: true)
+ @service ||= @integration # TODO: https://gitlab.com/gitlab-org/gitlab/-/issues/329759
end
+ alias_method :service, :integration
# rubocop: enable CodeReuse/ActiveRecord
def disable_query_limiting