Commit 9f0d7945 authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Moved the webhooks and services gear options to a single one called integrations

parent 61b6643e
...@@ -7,8 +7,7 @@ class Projects::HooksController < Projects::ApplicationController ...@@ -7,8 +7,7 @@ class Projects::HooksController < Projects::ApplicationController
layout "project_settings" layout "project_settings"
def index def index
@hooks = @project.hooks redirect_to namespace_project_settings_integrations_path(@project.namespace, @project)
@hook = ProjectHook.new
end end
def create def create
...@@ -16,7 +15,7 @@ class Projects::HooksController < Projects::ApplicationController ...@@ -16,7 +15,7 @@ class Projects::HooksController < Projects::ApplicationController
@hook.save @hook.save
if @hook.valid? if @hook.valid?
redirect_to namespace_project_hooks_path(@project.namespace, @project) redirect_to namespace_project_settings_integrations_path(@project.namespace, @project)
else else
@hooks = @project.hooks.select(&:persisted?) @hooks = @project.hooks.select(&:persisted?)
render :index render :index
...@@ -44,7 +43,7 @@ class Projects::HooksController < Projects::ApplicationController ...@@ -44,7 +43,7 @@ class Projects::HooksController < Projects::ApplicationController
def destroy def destroy
hook.destroy hook.destroy
redirect_to namespace_project_hooks_path(@project.namespace, @project) redirect_to namespace_project_settings_integrations_path(@project.namespace, @project)
end end
private private
......
...@@ -10,7 +10,7 @@ class Projects::ServicesController < Projects::ApplicationController ...@@ -10,7 +10,7 @@ class Projects::ServicesController < Projects::ApplicationController
layout "project_settings" layout "project_settings"
def index def index
@services = @project.find_or_initialize_services redirect_to namespace_project_settings_integrations_path(@project.namespace, @project)
end end
def edit def edit
......
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
...@@ -208,6 +208,9 @@ module GitlabRoutingHelper ...@@ -208,6 +208,9 @@ module GitlabRoutingHelper
end end
# Settings # Settings
def project_settings_integrations_path(project, *args)
namespace_project_settings_integrations_path(project.namespace, project, *args)
end
def project_settings_members_path(project, *args) def project_settings_members_path(project, *args)
namespace_project_settings_members_path(project.namespace, project, *args) namespace_project_settings_members_path(project.namespace, project, *args)
end end
......
...@@ -8,14 +8,10 @@ ...@@ -8,14 +8,10 @@
= link_to namespace_project_deploy_keys_path(@project.namespace, @project), title: 'Deploy Keys' do = link_to namespace_project_deploy_keys_path(@project.namespace, @project), title: 'Deploy Keys' do
%span %span
Deploy Keys Deploy Keys
= nav_link(controller: :hooks) do = nav_link(controller: :integrations) do
= link_to namespace_project_hooks_path(@project.namespace, @project), title: 'Webhooks' do = link_to namespace_project_settings_integrations_path(@project.namespace, @project), title: 'Webhooks' do
%span %span
Webhooks Integrations
= nav_link(controller: :services) do
= link_to namespace_project_services_path(@project.namespace, @project), title: 'Services' do
%span
Services
= nav_link(controller: :protected_branches) do = nav_link(controller: :protected_branches) do
= link_to namespace_project_protected_branches_path(@project.namespace, @project), title: 'Protected Branches' do = link_to namespace_project_protected_branches_path(@project.namespace, @project), title: 'Protected Branches' do
%span %span
......
- page_title "Services"
.row.prepend-top-default.append-bottom-default .row.prepend-top-default.append-bottom-default
.col-lg-3 .col-lg-3
%h4.prepend-top-0 %h4.prepend-top-0
......
- page_title 'Integrations'
= render 'projects/hooks/index'
= render 'projects/services/index'
...@@ -307,9 +307,9 @@ constraints(ProjectUrlConstrainer.new) do ...@@ -307,9 +307,9 @@ constraints(ProjectUrlConstrainer.new) do
end end
end end
end end
namespace :settings do namespace :settings do
resource :members, only: [:show] resource :members, only: [:show]
resource :integrations, only: [:show]
end end
# Since both wiki and repository routing contains wildcard characters # Since both wiki and repository routing contains wildcard characters
......
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