debian-mirror-gitlab/app/controllers/groups/settings/integrations_controller.rb

36 lines
851 B
Ruby
Raw Normal View History

2020-04-22 19:07:51 +05:30
# frozen_string_literal: true
module Groups
module Settings
class IntegrationsController < Groups::ApplicationController
include IntegrationsActions
before_action :authorize_admin_group!
def index
2020-11-24 15:15:51 +05:30
@integrations = Service.find_or_initialize_all(Service.for_group(group)).sort_by(&:title)
end
def edit
@default_integration = Service.default_integration(integration.type, group)
super
2020-04-22 19:07:51 +05:30
end
private
def find_or_initialize_integration(name)
2020-11-24 15:15:51 +05:30
Service.find_or_initialize_integration(name, group_id: group.id)
2020-04-22 19:07:51 +05:30
end
def integrations_enabled?
Feature.enabled?(:group_level_integrations, group)
end
def scoped_edit_integration_path(integration)
edit_group_settings_integration_path(group, integration)
end
end
end
end