summaryrefslogtreecommitdiff
path: root/app/views/admin/users
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-12-17 11:59:07 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-12-17 11:59:07 +0000
commit8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch)
tree544930fb309b30317ae9797a9683768705d664c4 /app/views/admin/users
parent4b1de649d0168371549608993deac953eb692019 (diff)
downloadgitlab-ce-8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca.tar.gz
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'app/views/admin/users')
-rw-r--r--app/views/admin/users/_approve_user.html.haml2
-rw-r--r--app/views/admin/users/_modals.html.haml9
-rw-r--r--app/views/admin/users/_reject_pending_user.html.haml7
-rw-r--r--app/views/admin/users/_user.html.haml15
-rw-r--r--app/views/admin/users/_user_deactivation_effects.html.haml18
-rw-r--r--app/views/admin/users/_user_reject_effects.html.haml10
-rw-r--r--app/views/admin/users/index.html.haml8
-rw-r--r--app/views/admin/users/show.html.haml104
8 files changed, 84 insertions, 89 deletions
diff --git a/app/views/admin/users/_approve_user.html.haml b/app/views/admin/users/_approve_user.html.haml
index b4d960d909c..f61c9fa4b80 100644
--- a/app/views/admin/users/_approve_user.html.haml
+++ b/app/views/admin/users/_approve_user.html.haml
@@ -4,4 +4,4 @@
.card-body
= render partial: 'admin/users/user_approve_effects'
%br
- = link_to s_('AdminUsers|Approve user'), approve_admin_user_path(user), method: :put, class: "btn gl-button btn-info", data: { confirm: s_('AdminUsers|Are you sure?') }
+ = link_to s_('AdminUsers|Approve user'), approve_admin_user_path(user), method: :put, class: "btn gl-button btn-info", data: { confirm: s_('AdminUsers|Are you sure?'), qa_selector: 'approve_user_button' }
diff --git a/app/views/admin/users/_modals.html.haml b/app/views/admin/users/_modals.html.haml
index e56bbd06575..f6e7cefafe7 100644
--- a/app/views/admin/users/_modals.html.haml
+++ b/app/views/admin/users/_modals.html.haml
@@ -1,10 +1,5 @@
-#user-modal
-#modal-texts.hidden{ "hidden": true, "aria-hidden": true }
- %div{ data: { modal: "deactivate",
- title: s_("AdminUsers|Deactivate User %{username}?"),
- action: s_("AdminUsers|Deactivate") } }
- = render partial: 'admin/users/user_deactivation_effects'
-
+#js-delete-user-modal
+#js-modal-texts.hidden{ "hidden": true, "aria-hidden": true }
%div{ data: { modal: "delete",
title: s_("AdminUsers|Delete User %{username}?"),
action: s_('AdminUsers|Delete user'),
diff --git a/app/views/admin/users/_reject_pending_user.html.haml b/app/views/admin/users/_reject_pending_user.html.haml
new file mode 100644
index 00000000000..17108427330
--- /dev/null
+++ b/app/views/admin/users/_reject_pending_user.html.haml
@@ -0,0 +1,7 @@
+.card.border-danger
+ .card-header.bg-danger.gl-text-white
+ = s_('AdminUsers|This user has requested access')
+ .card-body
+ = render partial: 'admin/users/user_reject_effects'
+ %br
+ = link_to s_('AdminUsers|Reject request'), reject_admin_user_path(user), method: :delete, class: "btn gl-button btn-danger", data: { confirm: s_('AdminUsers|Are you sure?') }
diff --git a/app/views/admin/users/_user.html.haml b/app/views/admin/users/_user.html.haml
index 679c4805280..31fd3aea94d 100644
--- a/app/views/admin/users/_user.html.haml
+++ b/app/views/admin/users/_user.html.haml
@@ -37,26 +37,25 @@
- elsif user.blocked?
- if user.blocked_pending_approval?
= link_to s_('AdminUsers|Approve'), approve_admin_user_path(user), method: :put
- %button.btn.btn-default-tertiary.js-confirm-modal-button{ data: user_block_data(user, user_block_effects) }
- = s_('AdminUsers|Block')
+ = link_to s_('AdminUsers|Reject'), reject_admin_user_path(user), method: :delete
- else
- = link_to _('Unblock'), unblock_admin_user_path(user), method: :put
+ %button.btn.btn-default-tertiary.js-confirm-modal-button{ data: user_unblock_data(user) }
+ = s_('AdminUsers|Unblock')
- else
%button.btn.btn-default-tertiary.js-confirm-modal-button{ data: user_block_data(user, user_block_effects) }
= s_('AdminUsers|Block')
- if user.can_be_deactivated?
%li
- %button.btn.btn-default-tertiary{ data: { 'gl-modal-action': 'deactivate',
- url: deactivate_admin_user_path(user),
- username: sanitize_name(user.name) } }
+ %button.btn.btn-default-tertiary.js-confirm-modal-button{ data: user_deactivation_data(user, user_deactivation_effects) }
= s_('AdminUsers|Deactivate')
- elsif user.deactivated?
%li
- = link_to _('Activate'), activate_admin_user_path(user), method: :put
+ %button.btn.btn-default-tertiary.js-confirm-modal-button{ data: user_activation_data(user) }
+ = s_('AdminUsers|Activate')
- if user.access_locked?
%li
= link_to _('Unlock'), unlock_admin_user_path(user), method: :put, data: { confirm: _('Are you sure?') }
- - if can?(current_user, :destroy_user, user)
+ - if can?(current_user, :destroy_user, user) && !user.blocked_pending_approval?
%li.divider
- if user.can_be_removed?
%li
diff --git a/app/views/admin/users/_user_deactivation_effects.html.haml b/app/views/admin/users/_user_deactivation_effects.html.haml
deleted file mode 100644
index dc3896e18c0..00000000000
--- a/app/views/admin/users/_user_deactivation_effects.html.haml
+++ /dev/null
@@ -1,18 +0,0 @@
-%p
- = s_('AdminUsers|Deactivating a user has the following effects:')
-%ul
- %li
- = s_('AdminUsers|The user will be logged out')
- %li
- = s_('AdminUsers|The user will not be able to access git repositories')
- %li
- = s_('AdminUsers|The user will not be able to access the API')
- %li
- = s_('AdminUsers|The user will not receive any notifications')
- %li
- = s_('AdminUsers|The user will not be able to use slash commands')
- %li
- = s_('AdminUsers|When the user logs back in, their account will reactivate as a fully active account')
- %li
- = s_('AdminUsers|Personal projects, group and user history will be left intact')
- = render_if_exists 'admin/users/user_deactivation_effects_on_seats'
diff --git a/app/views/admin/users/_user_reject_effects.html.haml b/app/views/admin/users/_user_reject_effects.html.haml
new file mode 100644
index 00000000000..17b6862b0cc
--- /dev/null
+++ b/app/views/admin/users/_user_reject_effects.html.haml
@@ -0,0 +1,10 @@
+%p
+ = s_('AdminUsers|Rejected users:')
+%ul
+ %li
+ = s_('AdminUsers|Cannot sign in or access instance information')
+ %li
+ = s_('AdminUsers|Will be deleted')
+%p
+ - link_start = '<a href="%{url}">'.html_safe % { url: help_page_path("user/profile/account/delete_account", anchor: "associated-records") }
+ = s_('AdminUsers|For more information, please refer to the %{link_start}user account deletion documentation.%{link_end}').html_safe % { link_start: link_start, link_end: '</a>'.html_safe }
diff --git a/app/views/admin/users/index.html.haml b/app/views/admin/users/index.html.haml
index 2e179d2d845..b86abb893a9 100644
--- a/app/views/admin/users/index.html.haml
+++ b/app/views/admin/users/index.html.haml
@@ -31,7 +31,7 @@
= s_('AdminUsers|Blocked')
%small.badge.badge-pill= limited_counter_with_delimiter(User.blocked)
= nav_link(html_options: { class: "#{active_when(params[:filter] == 'blocked_pending_approval')} filter-blocked-pending-approval" }) do
- = link_to admin_users_path(filter: "blocked_pending_approval") do
+ = link_to admin_users_path(filter: "blocked_pending_approval"), data: { qa_selector: 'pending_approval_tab' } do
= s_('AdminUsers|Pending approval')
%small.badge.badge-pill= limited_counter_with_delimiter(User.blocked_pending_approval)
= nav_link(html_options: { class: active_when(params[:filter] == 'deactivated') }) do
@@ -69,7 +69,11 @@
= link_to admin_users_path(sort: value, filter: params[:filter], search_query: params[:search_query]) do
= title
-- if @users.empty?
+- if Feature.enabled?(:vue_admin_users)
+ #js-admin-users-app{ data: admin_users_data_attributes(@users) }
+ .gl-spinner-container.gl-my-7
+ %span.gl-vertical-align-bottom.gl-spinner.gl-spinner-dark.gl-spinner-lg{ aria: { label: _('Loading') } }
+- elsif @users.empty?
.nothing-here-block.border-top-0
= s_('AdminUsers|No users found')
- else
diff --git a/app/views/admin/users/show.html.haml b/app/views/admin/users/show.html.haml
index 9c6f151a6b1..26f78ea4d6a 100644
--- a/app/views/admin/users/show.html.haml
+++ b/app/views/admin/users/show.html.haml
@@ -42,7 +42,7 @@
= sprite_icon('close', size: 16, css_class: 'gl-icon')
%li
%span.light ID:
- %strong
+ %strong{ data: { qa_selector: 'user_id_content' } }
= @user.id
%li
%span.light= _('Namespace ID:')
@@ -158,24 +158,21 @@
.card-body
= render partial: 'admin/users/user_activation_effects'
%br
- = link_to 'Activate user', activate_admin_user_path(@user), method: :put, class: "btn gl-button btn-info", data: { confirm: 'Are you sure?' }
+ %button.btn.gl-button.btn-info.js-confirm-modal-button{ data: user_activation_data(@user) }
+ = s_('AdminUsers|Activate user')
- elsif @user.can_be_deactivated?
.card.border-warning
.card-header.bg-warning.text-white
Deactivate this user
.card-body
- = render partial: 'admin/users/user_deactivation_effects'
+ = user_deactivation_effects
%br
- %button.btn.gl-button.btn-warning{ data: { 'gl-modal-action': 'deactivate',
- content: 'You can always re-activate their account, their data will remain intact.',
- url: deactivate_admin_user_path(@user),
- username: sanitize_name(@user.name) } }
+ %button.btn.gl-button.btn-warning.js-confirm-modal-button{ data: user_deactivation_data(@user, s_('AdminUsers|You can always re-activate their account, their data will remain intact.')) }
= s_('AdminUsers|Deactivate user')
-
- if @user.blocked?
- if @user.blocked_pending_approval?
= render 'admin/users/approve_user', user: @user
- = render 'admin/users/block_user', user: @user
+ = render 'admin/users/reject_pending_user', user: @user
- else
.card.border-info
.card-header.gl-bg-blue-500.gl-text-white
@@ -186,7 +183,8 @@
%li Log in
%li Access Git repositories
%br
- = link_to 'Unblock user', unblock_admin_user_path(@user), method: :put, class: "btn gl-button btn-info", data: { confirm: s_('AdminUsers|Are you sure?') }
+ %button.btn.gl-button.btn-info.js-confirm-modal-button{ data: user_unblock_data(@user) }
+ = s_('AdminUsers|Unblock user')
- elsif !@user.internal?
= render 'admin/users/block_user', user: @user
@@ -198,52 +196,52 @@
%p This user has been temporarily locked due to excessive number of failed logins. You may manually unlock the account.
%br
= link_to 'Unlock user', unlock_admin_user_path(@user), method: :put, class: "btn gl-button btn-info", data: { confirm: 'Are you sure?' }
-
- .card.border-danger
- .card-header.bg-danger.text-white
- = s_('AdminUsers|Delete user')
- .card-body
- - if @user.can_be_removed? && can?(current_user, :destroy_user, @user)
- %p Deleting a user has the following effects:
- = render 'users/deletion_guidance', user: @user
- %br
- %button.delete-user-button.btn.gl-button.btn-danger{ data: { 'gl-modal-action': 'delete',
- delete_user_url: admin_user_path(@user),
- block_user_url: block_admin_user_path(@user),
- username: sanitize_name(@user.name) } }
- = s_('AdminUsers|Delete user')
- - else
- - if @user.solo_owned_groups.present?
- %p
- This user is currently an owner in these groups:
- %strong= @user.solo_owned_groups.map(&:name).join(', ')
+ - if !@user.blocked_pending_approval?
+ .card.border-danger
+ .card-header.bg-danger.text-white
+ = s_('AdminUsers|Delete user')
+ .card-body
+ - if @user.can_be_removed? && can?(current_user, :destroy_user, @user)
+ %p Deleting a user has the following effects:
+ = render 'users/deletion_guidance', user: @user
+ %br
+ %button.delete-user-button.btn.gl-button.btn-danger{ data: { 'gl-modal-action': 'delete',
+ delete_user_url: admin_user_path(@user),
+ block_user_url: block_admin_user_path(@user),
+ username: sanitize_name(@user.name) } }
+ = s_('AdminUsers|Delete user')
+ - else
+ - if @user.solo_owned_groups.present?
+ %p
+ This user is currently an owner in these groups:
+ %strong= @user.solo_owned_groups.map(&:name).join(', ')
+ %p
+ You must transfer ownership or delete these groups before you can delete this user.
+ - else
+ %p
+ You don't have access to delete this user.
+
+ .card.border-danger
+ .card-header.bg-danger.text-white
+ = s_('AdminUsers|Delete user and contributions')
+ .card-body
+ - if can?(current_user, :destroy_user, @user)
%p
- You must transfer ownership or delete these groups before you can delete this user.
+ This option deletes the user and any contributions that
+ would usually be moved to the
+ = succeed "." do
+ = link_to "system ghost user", help_page_path("user/profile/account/delete_account")
+ As well as the user's personal projects, groups owned solely by
+ the user, and projects in them, will also be removed. Commits
+ to other projects are unaffected.
+ %br
+ %button.delete-user-button.btn.gl-button.btn-danger{ data: { 'gl-modal-action': 'delete-with-contributions',
+ delete_user_url: admin_user_path(@user, hard_delete: true),
+ block_user_url: block_admin_user_path(@user),
+ username: @user.name } }
+ = s_('AdminUsers|Delete user and contributions')
- else
%p
You don't have access to delete this user.
- .card.border-danger
- .card-header.bg-danger.text-white
- = s_('AdminUsers|Delete user and contributions')
- .card-body
- - if can?(current_user, :destroy_user, @user)
- %p
- This option deletes the user and any contributions that
- would usually be moved to the
- = succeed "." do
- = link_to "system ghost user", help_page_path("user/profile/account/delete_account")
- As well as the user's personal projects, groups owned solely by
- the user, and projects in them, will also be removed. Commits
- to other projects are unaffected.
- %br
- %button.delete-user-button.btn.gl-button.btn-danger{ data: { 'gl-modal-action': 'delete-with-contributions',
- delete_user_url: admin_user_path(@user, hard_delete: true),
- block_user_url: block_admin_user_path(@user),
- username: @user.name } }
- = s_('AdminUsers|Delete user and contributions')
- - else
- %p
- You don't have access to delete this user.
-
= render partial: 'admin/users/modals'