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