diff options
author | Rémy Coutable <remy@rymai.me> | 2017-01-20 10:05:19 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-01-20 10:05:19 +0000 |
commit | 34ef6ce3d3dc46ffc2b34f5882ddf2a2454ec7b6 (patch) | |
tree | 348f0e305df7fa8483969c231408932765d2959d /app/controllers | |
parent | 5a41d92b9d73cbc41b649239e40a15955094f77e (diff) | |
parent | 8f391fd373a3789b021d07bb23dc837e91c65da2 (diff) | |
download | gitlab-ce-34ef6ce3d3dc46ffc2b34f5882ddf2a2454ec7b6.tar.gz |
Merge branch '26138-combine-webhooks-and-services-settings-pages' into 'master'
Moved the webhooks and services gear options to a single one called integrations
See merge request !8380
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/projects/hooks_controller.rb | 14 | ||||
-rw-r--r-- | app/controllers/projects/services_controller.rb | 4 | ||||
-rw-r--r-- | app/controllers/projects/settings/integrations_controller.rb | 18 |
3 files changed, 22 insertions, 14 deletions
diff --git a/app/controllers/projects/hooks_controller.rb b/app/controllers/projects/hooks_controller.rb index 0ae8ff98009..b668a9331e7 100644 --- a/app/controllers/projects/hooks_controller.rb +++ b/app/controllers/projects/hooks_controller.rb @@ -6,21 +6,15 @@ class Projects::HooksController < Projects::ApplicationController layout "project_settings" - def index - @hooks = @project.hooks - @hook = ProjectHook.new - end - def create @hook = @project.hooks.new(hook_params) @hook.save - if @hook.valid? - redirect_to namespace_project_hooks_path(@project.namespace, @project) - else + unless @hook.valid? @hooks = @project.hooks.select(&:persisted?) - render :index + flash[:alert] = @hook.errors.full_messages.join.html_safe end + redirect_to namespace_project_settings_integrations_path(@project.namespace, @project) end def test @@ -44,7 +38,7 @@ class Projects::HooksController < Projects::ApplicationController def destroy hook.destroy - redirect_to namespace_project_hooks_path(@project.namespace, @project) + redirect_to namespace_project_settings_integrations_path(@project.namespace, @project) end private diff --git a/app/controllers/projects/services_controller.rb b/app/controllers/projects/services_controller.rb index 30c2a5d9982..17cb1d5be24 100644 --- a/app/controllers/projects/services_controller.rb +++ b/app/controllers/projects/services_controller.rb @@ -9,10 +9,6 @@ class Projects::ServicesController < Projects::ApplicationController layout "project_settings" - def index - @services = @project.find_or_initialize_services - end - def edit end diff --git a/app/controllers/projects/settings/integrations_controller.rb b/app/controllers/projects/settings/integrations_controller.rb new file mode 100644 index 00000000000..fb2a4837735 --- /dev/null +++ b/app/controllers/projects/settings/integrations_controller.rb @@ -0,0 +1,18 @@ +module Projects + module Settings + class IntegrationsController < Projects::ApplicationController + include ServiceParams + + before_action :authorize_admin_project! + layout "project_settings" + + def show + @hooks = @project.hooks + @hook = ProjectHook.new + + # Services + @services = @project.find_or_initialize_services + end + end + end +end |