Commit 30c7b1e2 authored by Zack Cuddy's avatar Zack Cuddy

Geo Replication - Convert Nav to GlTabs

This change converts the
Geo Replication Nav
to GlTabs.
parent 96d653f8
......@@ -5,17 +5,8 @@
= _('Geo Replication')
%p
= s_('Geo|Review replication status, and resynchronize and reverify items with the primary site.')
%ul.nav-links.nav.nav-tabs.border-top.border-bottom.border-secondary-100
= nav_link(path: 'admin/geo/projects#index', html_options: { class: 'gl-pr-2' }) do
= link_to admin_geo_projects_path, title: _('Projects') do
%span
= _('Projects')
= nav_link(path: 'admin/geo/designs#index', html_options: { class: 'gl-pr-2' }) do
= link_to admin_geo_designs_path, title: _('Designs') do
%span
= _('Designs')
= gl_tabs_nav({ class: 'border-top border-bottom border-secondary-100' }) do
= gl_tab_link_to _('Projects'), admin_geo_replicables_path(replicable_name_plural: 'projects'), { title: _('Projects'), class: 'gl-mr-2' }
= gl_tab_link_to _('Designs'), admin_geo_replicables_path(replicable_name_plural: 'designs'), { title: _('Designs'), class: 'gl-mr-2' }
- Gitlab::Geo.enabled_replicator_classes.each do |replicator_class|
= nav_link(page: [{ controller: 'admin/geo/replicables', action: 'index', replicable_name_plural: replicator_class.replicable_name_plural }], html_options: { class: 'gl-pr-2' }) do
= link_to admin_geo_replicables_path(replicable_name_plural: replicator_class.replicable_name_plural), title: replicator_class.replicable_title_plural do
%span
= replicator_class.replicable_title_plural
= gl_tab_link_to replicator_class.replicable_title_plural, admin_geo_replicables_path(replicable_name_plural: replicator_class.replicable_name_plural), { title: replicator_class.replicable_title_plural, class: 'gl-mr-2' }
......@@ -22,20 +22,20 @@ RSpec.describe 'admin Geo Replication Nav', :js, :geo do
end
it 'has active class' do
navigation_link = page.find("a[title=\"#{link_name}\"]").find(:xpath, '..')
navigation_link = page.find('a', text: link_name)
expect(navigation_link[:class]).to include('active')
end
end
describe 'visit admin/geo/replication/projects' do
it_behaves_like 'active sidebar link', 'Projects' do
let(:path) { admin_geo_projects_path }
let(:path) { admin_geo_replicables_path(replicable_name_plural: 'projects') }
end
end
describe 'visit admin/geo/replication/designs' do
it_behaves_like 'active sidebar link', 'Designs' do
let(:path) { admin_geo_designs_path }
let(:path) { admin_geo_replicables_path(replicable_name_plural: 'designs') }
end
end
......@@ -46,11 +46,11 @@ RSpec.describe 'admin Geo Replication Nav', :js, :geo do
end
end
it 'displays enable replicator replication details nav links' do
it 'displays enabled replicator replication details nav links' do
visit admin_geo_replicables_path(replicable_name_plural: 'projects')
Gitlab::Geo.enabled_replicator_classes.each do |replicator_class|
navbar = page.find(".nav-links.nav.nav-tabs")
navbar = page.find(".gl-tabs-nav")
expect(navbar).to have_link replicator_class.replicable_title_plural
end
......
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