Commit 66b4b117 authored by Justin Ho's avatar Justin Ho

Add controller action and HAML views

HAML view is added to the shared/integrations folder
to allow us to re-use this later for group-level integration
overrides.
parent be9ddf35
......@@ -17,7 +17,7 @@ class Admin::IntegrationsController < Admin::ApplicationController
render json: serializer.represent(projects)
end
# TODO frontend will add format.html
format.html { render 'shared/integrations/overrides' }
end
end
......
......@@ -6,7 +6,7 @@ module IntegrationsActions
included do
include Integrations::Params
before_action :integration, only: [:edit, :update, :test]
before_action :integration, only: [:edit, :update, :overrides, :test]
end
def edit
......
......@@ -47,6 +47,10 @@ module IntegrationsHelper
end
end
def scoped_overrides_integration_path(integration, options = {})
overrides_admin_application_settings_integration_path(integration, options)
end
def scoped_test_integration_path(integration)
if @project.present?
test_project_service_path(@project, integration)
......@@ -97,6 +101,12 @@ module IntegrationsHelper
form_data
end
def integration_overrides_data(integration)
{
overrides_path: scoped_overrides_integration_path(integration, format: :json)
}
end
def integration_list_data(integrations)
{
integrations: integrations.map { |i| serialize_integration(i) }.to_json
......
.tabs.gl-tabs
%div
%ul.nav.gl-tabs-nav{ role: 'tablist' }
%li.nav-item{ role: 'presentation' }
%a.nav-link.gl-tab-nav-item{ role: 'tab', href: scoped_edit_integration_path(integration) }
= _('Settings')
%li.nav-item{ role: 'presentation' }
%a.nav-link.gl-tab-nav-item.gl-tab-nav-item-active.gl-tab-nav-item-active-indigo.active{ role: 'tab', href: scoped_overrides_integration_path(integration) }
= s_('Integrations|Projects using custom settings')
.tab-content.gl-tab-content
.tab-pane.active{ role: 'tabpanel' }
= yield
- add_to_breadcrumbs _('Integrations'), scoped_integrations_path
- breadcrumb_title @integration.title
- page_title @integration.title, _('Integrations')
- @content_class = 'limit-container-width' unless fluid_layout
%h3.page-title
= @integration.title
= render 'shared/integrations/tabs', integration: @integration do
.js-vue-integration-overrides{ data: integration_overrides_data(@integration) }
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