Commit 8ed4da1d authored by Simon Knox's avatar Simon Knox

Merge branch 'integrations-overrides-tabs-refactor' into 'master'

Use gl_tabs_nav helper for integration overrides

See merge request gitlab-org/gitlab!71877
parents d5166223 d9aff879
......@@ -125,15 +125,6 @@ module IntegrationsHelper
!Gitlab.com?
end
def integration_tabs(integration:)
[
{ key: 'edit', text: _('Settings'), href: scoped_edit_integration_path(integration) },
(
{ key: 'overrides', text: s_('Integrations|Projects using custom settings'), href: scoped_overrides_integration_path(integration) } if integration.instance_level?
)
].compact
end
def jira_issue_breadcrumb_link(issue_reference)
link_to '', { class: 'gl-display-flex gl-align-items-center gl-white-space-nowrap' } do
icon = image_tag image_path('illustrations/logos/jira.svg'), width: 15, height: 15, class: 'gl-mr-2'
......
- active_tab = local_assigns.fetch(:active_tab, 'edit')
- active_classes = 'gl-tab-nav-item-active gl-tab-nav-item-active-indigo active'
- tabs = integration_tabs(integration: integration)
- if tabs.length <= 1
= yield
- else
- if integration.instance_level?
.tabs.gl-tabs
%div
%ul.nav.gl-tabs-nav{ role: 'tablist' }
- tabs.each do |tab|
%li.nav-item{ role: 'presentation' }
%a.nav-link.gl-tab-nav-item{ role: 'tab', class: (active_classes if tab[:key] == active_tab), href: tab[:href] }
= tab[:text]
= gl_tabs_nav({ class: 'gl-mb-5' }) do
= gl_tab_link_to _('Settings'), scoped_edit_integration_path(integration)
= gl_tab_link_to s_('Integrations|Projects using custom settings'), scoped_overrides_integration_path(integration)
.tab-content.gl-tab-content
.tab-pane.gl-pt-3.active{ role: 'tabpanel' }
= yield
= yield
- else
= yield
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