Commit 951313ad authored by Andrew Fontaine's avatar Andrew Fontaine

Merge branch '230794-convert-geo-replication-nav' into 'master'

Geo Replication - Convert Nav to GlTabs

See merge request gitlab-org/gitlab!77622
parents e3426d08 30c7b1e2
...@@ -5,17 +5,8 @@ ...@@ -5,17 +5,8 @@
= _('Geo Replication') = _('Geo Replication')
%p %p
= s_('Geo|Review replication status, and resynchronize and reverify items with the primary site.') = 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 = gl_tabs_nav({ class: 'border-top border-bottom border-secondary-100' }) do
= nav_link(path: 'admin/geo/projects#index', html_options: { class: 'gl-pr-2' }) do = gl_tab_link_to _('Projects'), admin_geo_replicables_path(replicable_name_plural: 'projects'), { title: _('Projects'), class: 'gl-mr-2' }
= link_to admin_geo_projects_path, title: _('Projects') do = gl_tab_link_to _('Designs'), admin_geo_replicables_path(replicable_name_plural: 'designs'), { title: _('Designs'), class: 'gl-mr-2' }
%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')
- Gitlab::Geo.enabled_replicator_classes.each do |replicator_class| - 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 = 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' }
= 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
...@@ -22,20 +22,20 @@ RSpec.describe 'admin Geo Replication Nav', :js, :geo do ...@@ -22,20 +22,20 @@ RSpec.describe 'admin Geo Replication Nav', :js, :geo do
end end
it 'has active class' do 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') expect(navigation_link[:class]).to include('active')
end end
end end
describe 'visit admin/geo/replication/projects' do describe 'visit admin/geo/replication/projects' do
it_behaves_like 'active sidebar link', '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
end end
describe 'visit admin/geo/replication/designs' do describe 'visit admin/geo/replication/designs' do
it_behaves_like 'active sidebar link', '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
end end
...@@ -46,11 +46,11 @@ RSpec.describe 'admin Geo Replication Nav', :js, :geo do ...@@ -46,11 +46,11 @@ RSpec.describe 'admin Geo Replication Nav', :js, :geo do
end end
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') visit admin_geo_replicables_path(replicable_name_plural: 'projects')
Gitlab::Geo.enabled_replicator_classes.each do |replicator_class| 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 expect(navbar).to have_link replicator_class.replicable_title_plural
end 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