Commit d8dccea0 authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Merge branch 'migrate-admin-background-migrations-tabs-to-gl-tabs-nav' into 'master'

Migrate background migrations tabs to gl_tabs_nav

See merge request gitlab-org/gitlab!79656
parents ce2b8e81 b7944dc3
- page_title _('Background Migrations') - page_title _('Background Migrations')
.tabs.gl-tabs = gl_tabs_nav do
%div = gl_tab_link_to admin_background_migrations_path, item_active: @current_tab == 'queued' do
%ul.nav.gl-tabs-nav{ role: 'tablist' } = _('Queued')
- active_tab_classes = ['gl-tab-nav-item-active', 'gl-tab-nav-item-active-indigo'] = gl_tab_counter_badge limited_counter_with_delimiter(@relations_by_tab['queued'])
= gl_tab_link_to admin_background_migrations_path(tab: 'failed'), item_active: @current_tab == 'failed' do
= _('Failed')
= gl_tab_counter_badge limited_counter_with_delimiter(@relations_by_tab['failed'])
= gl_tab_link_to admin_background_migrations_path(tab: 'finished'), item_active: @current_tab == 'finished' do
= _('Finished')
= gl_tab_counter_badge limited_counter_with_delimiter(@relations_by_tab['finished'])
%li.nav-item{ role: 'presentation' } .tab-content.gl-tab-content
%a.nav-link.gl-tab-nav-item{ href: admin_background_migrations_path, class: (active_tab_classes if @current_tab == 'queued'), role: 'tab' } .tab-pane.active{ role: 'tabpanel' }
= _('Queued') %table.table.b-table.gl-table.b-table-stacked-md{ role: 'table' }
= gl_tab_counter_badge limited_counter_with_delimiter(@relations_by_tab['queued']) %thead{ role: 'rowgroup' }
%li.nav-item{ role: 'presentation' } %tr{ role: 'row' }
%a.nav-link.gl-tab-nav-item{ href: admin_background_migrations_path(tab: 'failed'), class: (active_tab_classes if @current_tab == 'failed'), role: 'tab' } %th.table-th-transparent.border-bottom{ role: 'cell' }= _('Migration')
= _('Failed') %th.table-th-transparent.border-bottom{ role: 'cell' }= _('Progress')
= gl_tab_counter_badge limited_counter_with_delimiter(@relations_by_tab['failed']) %th.table-th-transparent.border-bottom{ role: 'cell' }= _('Status')
%li.nav-item{ role: 'presentation' } %th.table-th-transparent.border-bottom{ role: 'cell' }
%a.nav-link.gl-tab-nav-item{ href: admin_background_migrations_path(tab: 'finished'), class: (active_tab_classes if @current_tab == 'finished'), role: 'tab' } %tbody{ role: 'rowgroup' }
= _('Finished') = render partial: 'migration', collection: @migrations
= gl_tab_counter_badge limited_counter_with_delimiter(@relations_by_tab['finished'])
.tab-content.gl-tab-content = paginate_collection @migrations
.tab-pane.active{ role: 'tabpanel' }
%table.table.b-table.gl-table.b-table-stacked-md{ role: 'table' }
%thead{ role: 'rowgroup' }
%tr{ role: 'row' }
%th.table-th-transparent.border-bottom{ role: 'cell' }= _('Migration')
%th.table-th-transparent.border-bottom{ role: 'cell' }= _('Progress')
%th.table-th-transparent.border-bottom{ role: 'cell' }= _('Status')
%th.table-th-transparent.border-bottom{ role: 'cell' }
%tbody{ role: 'rowgroup' }
= render partial: 'migration', collection: @migrations
= paginate_collection @migrations
...@@ -68,7 +68,7 @@ RSpec.describe "Admin > Admin sees background migrations" do ...@@ -68,7 +68,7 @@ RSpec.describe "Admin > Admin sees background migrations" do
tab.click tab.click
expect(page).to have_current_path(admin_background_migrations_path(tab: 'failed')) expect(page).to have_current_path(admin_background_migrations_path(tab: 'failed'))
expect(tab[:class]).to include('gl-tab-nav-item-active', 'gl-tab-nav-item-active-indigo') expect(tab[:class]).to include('gl-tab-nav-item-active')
expect(page).to have_selector('tbody tr', count: 1) expect(page).to have_selector('tbody tr', count: 1)
...@@ -93,7 +93,7 @@ RSpec.describe "Admin > Admin sees background migrations" do ...@@ -93,7 +93,7 @@ RSpec.describe "Admin > Admin sees background migrations" do
tab.click tab.click
expect(page).to have_current_path(admin_background_migrations_path(tab: 'finished')) expect(page).to have_current_path(admin_background_migrations_path(tab: 'finished'))
expect(tab[:class]).to include('gl-tab-nav-item-active', 'gl-tab-nav-item-active-indigo') expect(tab[:class]).to include('gl-tab-nav-item-active')
expect(page).to have_selector('tbody tr', count: 1) expect(page).to have_selector('tbody tr', count: 1)
......
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