Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
a5cea27a
Commit
a5cea27a
authored
Sep 24, 2020
by
Justin Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move logic to helper method
parent
4b49e8b9
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
3 deletions
+9
-3
app/controllers/admin/application_settings_controller.rb
app/controllers/admin/application_settings_controller.rb
+2
-1
app/controllers/admin/integrations_controller.rb
app/controllers/admin/integrations_controller.rb
+2
-1
app/helpers/services_helper.rb
app/helpers/services_helper.rb
+4
-0
app/views/layouts/nav/sidebar/_admin.html.haml
app/views/layouts/nav/sidebar/_admin.html.haml
+1
-1
No files found.
app/controllers/admin/application_settings_controller.rb
View file @
a5cea27a
...
...
@@ -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
...
...
app/controllers/admin/integrations_controller.rb
View file @
a5cea27a
...
...
@@ -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
)
...
...
app/helpers/services_helper.rb
View file @
a5cea27a
...
...
@@ -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
...
...
app/views/layouts/nav/sidebar/_admin.html.haml
View file @
a5cea27a
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment