diff --git a/app/views/admin/users/_users.html.haml b/app/views/admin/users/_users.html.haml index bc972af9ea20ece26eddd77c9c67d708c3ea4b53..d4158160ad72fb64e5b811d2c6704a5f865fd5b1 100644 --- a/app/views/admin/users/_users.html.haml +++ b/app/views/admin/users/_users.html.haml @@ -7,7 +7,7 @@ - c.with_body do = render 'shared/registration_features_discovery_message', feature_title: s_('RegistrationFeatures|send emails to users') -.gl-flex.gl-items-start.gl-flex-wrap.md:gl-flex-nowrap.gl-gap-4.row-content-block.gl-border-0{ data: { testid: "filtered-search-block" } } +.gl-flex.gl-items-start.gl-flex-wrap.md:gl-flex-nowrap.gl-gap-4.gl-py-4.gl-border-0{ data: { testid: "filtered-search-block" } } #js-admin-users-filter-app .gl-shrink-0 = gl_redirect_listbox_tag admin_users_sort_options(filter: params[:filter], search_query: params[:search_query]), @sort, data: { placement: 'right' } diff --git a/app/views/admin/users/index.html.haml b/app/views/admin/users/index.html.haml index 02db356d1412ed6afb85144a6041c1c6c3fe1bbf..584ffad44538afce32224af238346ebde3b75202 100644 --- a/app/views/admin/users/index.html.haml +++ b/app/views/admin/users/index.html.haml @@ -6,10 +6,28 @@ = render_if_exists 'admin/users/admin_export_user_permissions' = render Pajamas::ButtonComponent.new(variant: :confirm, href: new_admin_user_path) do = s_('AdminUsers|New user') - .top-area = render 'tabs' .tab-content .tab-pane.active + .gl-grid.gl-gap-5.gl-mt-4.md:gl-grid-cols-3 + = render Pajamas::CardComponent.new do |c| + - c.with_body do + %div + = render Pajamas::SingleStatComponent.new(title: s_('AdminUsers|Pending approval'), stat_value: limited_counter_with_delimiter(User.blocked_pending_approval)) + = render Pajamas::ButtonComponent.new(size: :small, button_options: { class: 'gl-w-max' }, variant: :link, block: false, href: admin_users_path(filter: "blocked_pending_approval")) do + = s_('AdminUsers|Filter list') + = render Pajamas::CardComponent.new do |c| + - c.with_body do + %div + = render Pajamas::SingleStatComponent.new(title: s_('AdminUsers|Without two-factor authentication'), stat_value: limited_counter_with_delimiter(User.without_two_factor)) + = render Pajamas::ButtonComponent.new(size: :small, button_options: { class: 'gl-w-max' }, variant: :link, block: false, href: admin_users_path(filter: "two_factor_disabled")) do + = s_('AdminUsers|Filter list') + = render Pajamas::CardComponent.new do |c| + - c.with_body do + %div + = render Pajamas::SingleStatComponent.new(title: s_('AdminUsers|Administrators'), stat_value: limited_counter_with_delimiter(User.admins)) + = render Pajamas::ButtonComponent.new(size: :small, button_options: { class: 'gl-w-max' }, variant: :link, block: false, href: admin_users_path(filter: "admins")) do + = s_('AdminUsers|Filter list') = render 'users' diff --git a/ee/spec/features/admin/admin_users_spec.rb b/ee/spec/features/admin/admin_users_spec.rb index 2486f3f26b48f68154e5485c5b16b47babe92171..987744929fd220ea2d4e43d0978cfb9132372e6e 100644 --- a/ee/spec/features/admin/admin_users_spec.rb +++ b/ee/spec/features/admin/admin_users_spec.rb @@ -12,6 +12,24 @@ end describe 'GET /admin/users' do + describe 'user stat cards' do + before do + visit admin_users_path + end + + it "has 'users blocked pending approval' filter" do + expect(page).to have_link(href: admin_users_path(filter: "blocked_pending_approval")) + end + + it "has 'users with two factor disabled' filter" do + expect(page).to have_link(href: admin_users_path(filter: "two_factor_disabled")) + end + + it "has 'admin users' filter" do + expect(page).to have_link(href: admin_users_path(filter: "admins")) + end + end + describe 'send emails to users' do context 'when `send_emails_from_admin_area` feature is enabled' do before do diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 89e6279f7de4eb46bb26bc2d8101089a943235c9..e8d77bc7f57af2e952f8bac11e93c44f9df34ea0 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -4493,6 +4493,9 @@ msgstr "" msgid "AdminUsers|Administrator" msgstr "" +msgid "AdminUsers|Administrators" +msgstr "" + msgid "AdminUsers|An error occurred while fetching this user's contributions, and the request cannot return the number of issues, merge requests, groups, and projects linked to this user. If you proceed with deleting the user, all their contributions will still be deleted." msgstr "" @@ -4604,6 +4607,9 @@ msgstr "" msgid "AdminUsers|External users cannot see internal or private projects unless access is explicitly granted. Also, external users cannot create projects, groups, or personal snippets." msgstr "" +msgid "AdminUsers|Filter list" +msgstr "" + msgid "AdminUsers|For more information, please refer to the %{link_start}user account deletion documentation.%{link_end}" msgstr "" @@ -4820,6 +4826,9 @@ msgstr "" msgid "AdminUsers|Without projects" msgstr "" +msgid "AdminUsers|Without two-factor authentication" +msgstr "" + msgid "AdminUsers|You are about to permanently delete the user %{username}. Issues, merge requests, and groups linked to them will be transferred to a system-wide \"Ghost-user\". To avoid data loss, consider using the %{strongStart}block user%{strongEnd} feature instead. Once you %{strongStart}Delete user%{strongEnd}, it cannot be undone or recovered." msgstr ""