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

36 lines
901 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
2021-12-11 22:18:48 +05:30
include ::Integrations::Actions
2020-04-22 19:07:51 +05:30
before_action :authorize_admin_group!
2022-05-07 20:08:51 +05:30
before_action do
push_frontend_feature_flag(:integration_form_sections, group, default_enabled: :yaml)
end
2021-01-03 14:25:43 +05:30
feature_category :integrations
2021-04-29 21:17:54 +05:30
layout 'group_settings'
2020-04-22 19:07:51 +05:30
def index
2021-06-08 01:23:25 +05:30
@integrations = Integration.find_or_initialize_all_non_project_specific(Integration.for_group(group)).sort_by(&:title)
2020-11-24 15:15:51 +05:30
end
def edit
2021-06-08 01:23:25 +05:30
@default_integration = Integration.default_integration(integration.type, group)
2020-11-24 15:15:51 +05:30
super
2020-04-22 19:07:51 +05:30
end
private
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, group_id: group.id)
2020-04-22 19:07:51 +05:30
end
end
end
end