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
8fdb3156
Commit
8fdb3156
authored
May 16, 2018
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract EE-specific code from Projects::Settings::IntegrationsController
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
05d55d88
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
21 deletions
+37
-21
app/controllers/projects/settings/integrations_controller.rb
app/controllers/projects/settings/integrations_controller.rb
+3
-11
app/models/project.rb
app/models/project.rb
+9
-1
ee/app/controllers/ee/projects/settings/integrations_controller.rb
...ntrollers/ee/projects/settings/integrations_controller.rb
+24
-0
ee/app/models/ee/project.rb
ee/app/models/ee/project.rb
+1
-9
No files found.
app/controllers/projects/settings/integrations_controller.rb
View file @
8fdb3156
module
Projects
module
Settings
class
IntegrationsController
<
Projects
::
ApplicationController
prepend
EE
::
Projects
::
Settings
::
IntegrationsController
include
ServiceParams
before_action
:authorize_admin_project!
...
...
@@ -18,17 +20,7 @@ module Projects
# Returns a list of services that should be hidden from the list
def
service_exceptions
exceptions
=
@project
.
disabled_services
.
dup
exceptions
<<
slack_service
end
def
slack_service
if
Gitlab
::
CurrentSettings
.
slack_app_enabled
'slack_slash_commands'
else
'gitlab_slack_application'
end
@project
.
disabled_services
.
dup
end
end
end
...
...
app/models/project.rb
View file @
8fdb3156
...
...
@@ -1014,7 +1014,7 @@ class Project < ActiveRecord::Base
available_services_names
=
Service
.
available_services_names
-
exceptions
available_services_names
.
map
do
|
service_name
|
available_services
=
available_services
_names
.
map
do
|
service_name
|
service
=
find_service
(
services
,
service_name
)
if
service
...
...
@@ -1031,6 +1031,14 @@ class Project < ActiveRecord::Base
end
end
end
available_services
.
reject
do
|
service
|
disabled_services
.
include?
(
service
.
to_param
)
end
end
def
disabled_services
[]
end
def
find_or_initialize_service
(
name
)
...
...
ee/app/controllers/ee/projects/settings/integrations_controller.rb
0 → 100644
View file @
8fdb3156
module
EE
module
Projects
module
Settings
module
IntegrationsController
extend
::
Gitlab
::
Utils
::
Override
private
override
:service_exceptions
def
service_exceptions
super
<<
slack_service
end
def
slack_service
if
::
Gitlab
::
CurrentSettings
.
slack_app_enabled
'slack_slash_commands'
else
'gitlab_slack_application'
end
end
end
end
end
end
ee/app/models/ee/project.rb
View file @
8fdb3156
...
...
@@ -448,15 +448,7 @@ module EE
).
create
end
# Override to reject disabled services
def
find_or_initialize_services
(
exceptions:
[])
available_services
=
super
available_services
.
reject
do
|
service
|
disabled_services
.
include?
(
service
.
to_param
)
end
end
override
:disabled_services
def
disabled_services
strong_memoize
(
:disabled_services
)
do
disabled_services
=
[]
...
...
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