Migrate app/views/admin/users/_head.html.haml to Pajamas::ButtonComponent
requested to merge 363918-migrate-app-views-admin-users-_head-html-haml-to-pajamas-buttoncomponent into master
What does this MR do and why?
Migrate app/views/admin/users/_head.html.haml to Pajamas::ButtonComponent
Screenshots or screen recordings
How to set up and validate locally
- Go to Admin > Users then click on any user name. For example,
http://127.0.0.1:3000/admin/users/reported_user_6
. - Apply this diff to force show the button:
diff --git a/app/views/admin/users/_head.html.haml b/app/views/admin/users/_head.html.haml
index 529692df0b6..31814c7ab4c 100644
--- a/app/views/admin/users/_head.html.haml
+++ b/app/views/admin/users/_head.html.haml
@@ -31,7 +31,7 @@
.gl-p-2
- if impersonation_enabled? && @user.can?(:log_in)
= link_to _('Impersonate'), impersonate_admin_user_path(@user), method: :post, class: "btn btn-default gl-button", data: { qa_selector: 'impersonate_user_link' }
- - if can_force_email_confirmation?(@user)
+ - if true
= render Pajamas::ButtonComponent.new(variant: :confirm, button_options: { class: 'js-confirm-modal-button', data: confirm_user_data(@user) }) do
= _('Confirm user')
.gl-p-2
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #363918 (closed)
Edited by Justin Ho Tuan Duong