Ask for confirmation when hiding/blocking users

In the moderation section there's no clear indicator as to what the
"Hide" and "Block" buttons do and the difference between them.

Since we're using confirmation dialogs in all moderation actions except
these ones, we're adding them here as well, so the difference will
appear in the dialog.

This isn't a very good solution, though, since the confirmation dialog
comes after clicking the button and users have already been wondering
whether clicking that button will be the right choice. A better solution
would be making the purpose clear before the button is clicked, although
that's something we don't do anywhere in the admin/moderation sections.
This commit is contained in:
Javi Martín
2021-12-29 20:33:15 +01:00
parent 992da1fef3
commit a31e73bf23
9 changed files with 36 additions and 9 deletions

View File

@@ -68,6 +68,8 @@ class Admin::ActionComponent < ApplicationComponent
else
t("admin.actions.confirm_action", action: text, name: record_name)
end
elsif options[:confirm].respond_to?(:call)
options[:confirm].call(record_name)
else
options[:confirm]
end