Commit 6e1b616d authored by Olena Horal-Koretska's avatar Olena Horal-Koretska

Merge branch '344438-migrate-haml-nav-to-gltabs' into 'master'

Convert admin users page tabs to Pajamas

See merge request gitlab-org/gitlab!74014
parents 7020dc6c c96a99d2
...@@ -3,48 +3,38 @@ ...@@ -3,48 +3,38 @@
= sprite_icon('chevron-lg-left', size: 12) = sprite_icon('chevron-lg-left', size: 12)
.fade-right .fade-right
= sprite_icon('chevron-lg-right', size: 12) = sprite_icon('chevron-lg-right', size: 12)
%ul.nav-links.nav.nav-tabs.scrolling-tabs = gl_tabs_nav({ class: 'scrolling-tabs nav-links gl-display-flex gl-flex-grow-1' }) do
= nav_link(html_options: { class: active_when(params[:filter].nil?) }) do = gl_tab_link_to admin_users_path, { item_active: active_when(params[:filter].nil?), class: 'gl-border-0!' } do
= link_to admin_users_path do = s_('AdminUsers|Active')
= s_('AdminUsers|Active') = gl_tab_counter_badge(limited_counter_with_delimiter(User.active_without_ghosts))
%small.badge.gl-tab-counter-badge.badge-muted.badge-pill.gl-badge.sm= limited_counter_with_delimiter(User.active_without_ghosts) = gl_tab_link_to admin_users_path(filter: "admins"), { item_active: active_when(params[:filter] == 'admins'), class: 'gl-border-0!' } do
= nav_link(html_options: { class: active_when(params[:filter] == 'admins') }) do = s_('AdminUsers|Admins')
= link_to admin_users_path(filter: "admins") do = gl_tab_counter_badge(limited_counter_with_delimiter(User.admins))
= s_('AdminUsers|Admins') = gl_tab_link_to admin_users_path(filter: 'two_factor_enabled'), { item_active: active_when(params[:filter] == 'two_factor_enabled'), class: 'filter-two-factor-enabled gl-border-0!' } do
%small.badge.gl-tab-counter-badge.badge-muted.badge-pill.gl-badge.sm= limited_counter_with_delimiter(User.admins) = s_('AdminUsers|2FA Enabled')
= nav_link(html_options: { class: "#{active_when(params[:filter] == 'two_factor_enabled')} filter-two-factor-enabled" }) do = gl_tab_counter_badge(limited_counter_with_delimiter(User.with_two_factor))
= link_to admin_users_path(filter: 'two_factor_enabled') do = gl_tab_link_to admin_users_path(filter: 'two_factor_disabled'), { item_active: active_when(params[:filter] == 'two_factor_disabled'), class: 'filter-two-factor-disabled gl-border-0!' } do
= s_('AdminUsers|2FA Enabled') = s_('AdminUsers|2FA Disabled')
%small.badge.gl-tab-counter-badge.badge-muted.badge-pill.gl-badge.sm= limited_counter_with_delimiter(User.with_two_factor) = gl_tab_counter_badge(limited_counter_with_delimiter(User.without_two_factor))
= nav_link(html_options: { class: "#{active_when(params[:filter] == 'two_factor_disabled')} filter-two-factor-disabled" }) do = gl_tab_link_to admin_users_path(filter: 'external'), { item_active: active_when(params[:filter] == 'external'), class: 'gl-border-0!' } do
= link_to admin_users_path(filter: 'two_factor_disabled') do = s_('AdminUsers|External')
= s_('AdminUsers|2FA Disabled') = gl_tab_counter_badge(limited_counter_with_delimiter(User.external))
%small.badge.gl-tab-counter-badge.badge-muted.badge-pill.gl-badge.sm= limited_counter_with_delimiter(User.without_two_factor) = gl_tab_link_to admin_users_path(filter: "blocked"), { item_active: active_when(params[:filter] == 'blocked'), class: 'gl-border-0!' } do
= nav_link(html_options: { class: active_when(params[:filter] == 'external') }) do = s_('AdminUsers|Blocked')
= link_to admin_users_path(filter: 'external') do = gl_tab_counter_badge(limited_counter_with_delimiter(User.blocked))
= s_('AdminUsers|External')
%small.badge.gl-tab-counter-badge.badge-muted.badge-pill.gl-badge.sm= limited_counter_with_delimiter(User.external)
= nav_link(html_options: { class: active_when(params[:filter] == 'blocked') }) do
= link_to admin_users_path(filter: "blocked") do
= s_('AdminUsers|Blocked')
%small.badge.gl-tab-counter-badge.badge-muted.badge-pill.gl-badge.sm= limited_counter_with_delimiter(User.blocked)
- if ban_feature_available? - if ban_feature_available?
= nav_link(html_options: { class: active_when(params[:filter] == 'banned') }) do = gl_tab_link_to admin_users_path(filter: "banned"), { item_active: active_when(params[:filter] == 'banned'), class: 'gl-border-0!' } do
= link_to admin_users_path(filter: "banned") do = s_('AdminUsers|Banned')
= s_('AdminUsers|Banned') = gl_tab_counter_badge(limited_counter_with_delimiter(User.banned))
%small.badge.gl-tab-counter-badge.badge-muted.badge-pill.gl-badge.sm= limited_counter_with_delimiter(User.banned) = gl_tab_link_to admin_users_path(filter: "blocked_pending_approval"), { item_active: active_when(params[:filter] == 'blocked_pending_approval'), class: 'filter-blocked-pending-approval gl-border-0!', data: { qa_selector: 'pending_approval_tab' } } do
= nav_link(html_options: { class: "#{active_when(params[:filter] == 'blocked_pending_approval')} filter-blocked-pending-approval" }) do = s_('AdminUsers|Pending approval')
= link_to admin_users_path(filter: "blocked_pending_approval"), data: { qa_selector: 'pending_approval_tab' } do = gl_tab_counter_badge(limited_counter_with_delimiter(User.blocked_pending_approval))
= s_('AdminUsers|Pending approval') = gl_tab_link_to admin_users_path(filter: "deactivated"), { item_active: active_when(params[:filter] == 'deactivated'), class: 'gl-border-0!' } do
%small.badge.gl-tab-counter-badge.badge-muted.badge-pill.gl-badge.sm= limited_counter_with_delimiter(User.blocked_pending_approval) = s_('AdminUsers|Deactivated')
= nav_link(html_options: { class: active_when(params[:filter] == 'deactivated') }) do = gl_tab_counter_badge(limited_counter_with_delimiter(User.deactivated))
= link_to admin_users_path(filter: "deactivated") do = gl_tab_link_to admin_users_path(filter: "wop"), { item_active: active_when(params[:filter] == 'wop'), class: 'gl-border-0!' } do
= s_('AdminUsers|Deactivated') = s_('AdminUsers|Without projects')
%small.badge.gl-tab-counter-badge.badge-muted.badge-pill.gl-badge.sm= limited_counter_with_delimiter(User.deactivated) = gl_tab_counter_badge(limited_counter_with_delimiter(User.without_projects))
= nav_link(html_options: { class: active_when(params[:filter] == 'wop') }) do
= link_to admin_users_path(filter: "wop") do
= s_('AdminUsers|Without projects')
%small.badge.gl-tab-counter-badge.badge-muted.badge-pill.gl-badge.sm= limited_counter_with_delimiter(User.without_projects)
.nav-controls .nav-controls
= render_if_exists 'admin/users/admin_email_users' = render_if_exists 'admin/users/admin_email_users'
= render_if_exists 'admin/users/admin_export_user_permissions' = render_if_exists 'admin/users/admin_export_user_permissions'
......
...@@ -165,7 +165,7 @@ RSpec.describe 'Admin::Users' do ...@@ -165,7 +165,7 @@ RSpec.describe 'Admin::Users' do
visit admin_users_path visit admin_users_path
page.within('.filter-two-factor-enabled small') do page.within('.filter-two-factor-enabled .gl-tab-counter-badge') do
expect(page).to have_content('1') expect(page).to have_content('1')
end end
end end
...@@ -182,7 +182,7 @@ RSpec.describe 'Admin::Users' do ...@@ -182,7 +182,7 @@ RSpec.describe 'Admin::Users' do
it 'counts users who have not enabled 2FA' do it 'counts users who have not enabled 2FA' do
visit admin_users_path visit admin_users_path
page.within('.filter-two-factor-disabled small') do page.within('.filter-two-factor-disabled .gl-tab-counter-badge') do
expect(page).to have_content('2') # Including admin expect(page).to have_content('2') # Including admin
end end
end end
...@@ -201,7 +201,7 @@ RSpec.describe 'Admin::Users' do ...@@ -201,7 +201,7 @@ RSpec.describe 'Admin::Users' do
visit admin_users_path visit admin_users_path
page.within('.filter-blocked-pending-approval small') do page.within('.filter-blocked-pending-approval .gl-tab-counter-badge') do
expect(page).to have_content('2') expect(page).to have_content('2')
end end
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