2020-04-08 14:13:33 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class Admin::IntegrationsController < Admin::ApplicationController
|
2021-12-11 22:18:48 +05:30
|
|
|
include ::Integrations::Actions
|
2021-01-03 14:25:43 +05:30
|
|
|
|
2021-02-22 17:27:13 +05:30
|
|
|
before_action :not_found, unless: -> { instance_level_integrations? }
|
|
|
|
|
2021-01-03 14:25:43 +05:30
|
|
|
feature_category :integrations
|
2020-04-08 14:13:33 +05:30
|
|
|
|
2021-10-27 15:23:28 +05:30
|
|
|
def overrides
|
|
|
|
respond_to do |format|
|
|
|
|
format.json do
|
|
|
|
projects = Project.with_active_integration(integration.class).merge(::Integration.with_custom_settings)
|
|
|
|
serializer = ::Integrations::ProjectSerializer.new.with_pagination(request, response)
|
|
|
|
|
|
|
|
render json: serializer.represent(projects)
|
|
|
|
end
|
|
|
|
format.html { render 'shared/integrations/overrides' }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-04-22 19:07:51 +05:30
|
|
|
private
|
2020-04-08 14:13:33 +05:30
|
|
|
|
2021-01-29 00:20:46 +05:30
|
|
|
def find_or_initialize_non_project_specific_integration(name)
|
2021-06-08 01:23:25 +05:30
|
|
|
Integration.find_or_initialize_non_project_specific_integration(name, instance: true)
|
2020-04-08 14:13:33 +05:30
|
|
|
end
|
|
|
|
end
|