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!
|
|
|
|
|
2021-01-03 14:25:43 +05:30
|
|
|
feature_category :integrations
|
|
|
|
|
2020-04-22 19:07:51 +05:30
|
|
|
def index
|
2021-01-29 00:20:46 +05:30
|
|
|
@integrations = Service.find_or_initialize_all_non_project_specific(Service.for_group(group)).sort_by(&:title)
|
2020-11-24 15:15:51 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def edit
|
|
|
|
@default_integration = Service.default_integration(integration.type, group)
|
|
|
|
|
|
|
|
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)
|
|
|
|
Service.find_or_initialize_non_project_specific_integration(name, group_id: group.id)
|
2020-04-22 19:07:51 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def scoped_edit_integration_path(integration)
|
|
|
|
edit_group_settings_integration_path(group, integration)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|