Commit a5cea27a authored by Justin Ho's avatar Justin Ho

Move logic to helper method

parent 4b49e8b9
......@@ -2,6 +2,7 @@
class Admin::ApplicationSettingsController < Admin::ApplicationController
include InternalRedirect
include ServicesHelper
# NOTE: Use @application_setting in this controller when you need to access
# application_settings after it has been modified. This is because the
......@@ -32,7 +33,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
end
def integrations
return not_found if Gitlab.com?
return not_found unless instance_level_integrations?
@integrations = Service.find_or_initialize_all(Service.for_instance).sort_by(&:title)
end
......
......@@ -2,6 +2,7 @@
class Admin::IntegrationsController < Admin::ApplicationController
include IntegrationsActions
include ServicesHelper
private
......@@ -10,7 +11,7 @@ class Admin::IntegrationsController < Admin::ApplicationController
end
def integrations_enabled?
!Gitlab.com?
instance_level_integrations?
end
def scoped_edit_integration_path(integration)
......
......@@ -124,6 +124,10 @@ module ServicesHelper
@group.present? && Feature.enabled?(:group_level_integrations, @group)
end
def instance_level_integrations?
!Gitlab.com?
end
extend self
private
......
......@@ -260,7 +260,7 @@
= link_to general_admin_application_settings_path, title: _('General'), class: 'qa-admin-settings-general-item' do
%span
= _('General')
- unless Gitlab.com?
- if instance_level_integrations?
= nav_link(path: ['application_settings#integrations', 'integrations#edit']) do
= link_to integrations_admin_application_settings_path, title: _('Integrations'), data: { qa_selector: 'integration_settings_link' } do
%span
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment