Skip to content

A platform for community discussion. Free, open, simple.

UX: Require confirmation for clean_up_inactive_users_after_days setting (#36898)

Martin Brennan58a8668d047b
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index 74363a681b0..a2465c52d44 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -8509,17 +8509,20 @@ en:
prompt: "Changing this setting may have far-reaching or unintended consequences for your site. Are you sure you want to proceed?"
confirm: "Yes, I'm sure"
min_password_length:
- prompt: "You’re about to change your password policy. This will affect all users changing their passwords from now on. Are you sure you want to proceed?"
+ prompt: "You're about to change your password policy. This will affect all users changing their passwords from now on. Are you sure you want to proceed?"
confirm: "Yes, update password policy"
min_admin_password_length:
- prompt: "You’re about to change your password policy. This will affect all admins changing their passwords from now on. Are you sure you want to proceed?"
+ prompt: "You're about to change your password policy. This will affect all admins changing their passwords from now on. Are you sure you want to proceed?"
confirm: "Yes, update password policy"
password_unique_charactes:
- prompt: "You’re about to change your password policy. This will affect all users changing their passwords from now on. Are you sure you want to proceed?"
+ prompt: "You're about to change your password policy. This will affect all users changing their passwords from now on. Are you sure you want to proceed?"
confirm: "Yes, update password policy"
block_common_passwords:
- prompt: "You’re about to change your password policy. This will affect all users changing their passwords from now on. Are you sure you want to proceed?"
+ prompt: "You're about to change your password policy. This will affect all users changing their passwords from now on. Are you sure you want to proceed?"
confirm: "Yes, update password policy"
+ clean_up_inactive_users_after_days:
+ prompt: "Setting this value to anything other than 0 will cause users who are no longer active for that many days to be permanently deleted. Are you sure you want to proceed?"
+ confirm: "Yes, I understand that inactive users will be permanently deleted unless I set this value to 0"
job_status:
completed: "Update completed"
enqueued: "Update in progress"
diff --git a/config/site_settings.yml b/config/site_settings.yml
index 2da5c71a682..ef3a12d3af8 100644
--- a/config/site_settings.yml
+++ b/config/site_settings.yml
@@ -1095,6 +1095,7 @@ users:
min: 0
max: 36500
area: "users"
+ requires_confirmation: "simple"
clean_up_unused_staged_users_after_days:
default: 365
min: 0
diff --git a/spec/system/admin_site_setting_bulk_action_spec.rb b/spec/system/admin_site_setting_bulk_action_spec.rb
index 6acb501a74f..667e777c240 100644
--- a/spec/system/admin_site_setting_bulk_action_spec.rb
+++ b/spec/system/admin_site_setting_bulk_action_spec.rb
@@ -36,11 +36,21 @@ describe "Admin Site Setting Bulk Action", type: :system do
banner.click_save
- 2.times do
- expect(dialog).to be_open
- expect(dialog).to have_content("You’re about to change your password policy.")
- dialog.click_yes
- end
+ expect(dialog).to be_open
+ expect(dialog).to have_content(
+ I18n.t(
+ "admin_js.admin.site_settings.requires_confirmation_messages.min_password_length.prompt",
+ ),
+ )
+ dialog.click_yes
+
+ expect(dialog).to be_open
+ expect(dialog).to have_content(
+ I18n.t(
+ "admin_js.admin.site_settings.requires_confirmation_messages.min_admin_password_length.prompt",
+ ),
+ )
+ dialog.click_yes
expect(settings_page).to have_overridden_setting("min_password_length", value: 12)
expect(settings_page).to have_overridden_setting("min_admin_password_length", value: 13)
@@ -57,11 +67,19 @@ describe "Admin Site Setting Bulk Action", type: :system do
banner.click_save
expect(dialog).to be_open
- expect(dialog).to have_content("You’re about to change your password policy.")
+ expect(dialog).to have_content(
+ I18n.t(
+ "admin_js.admin.site_settings.requires_confirmation_messages.min_password_length.prompt",
+ ),
+ )
dialog.click_yes
expect(dialog).to be_open
- expect(dialog).to have_content("You’re about to change your password policy.")
+ expect(dialog).to have_content(
+ I18n.t(
+ "admin_js.admin.site_settings.requires_confirmation_messages.min_admin_password_length.prompt",
+ ),
+ )
dialog.click_no
expect(banner).to be_visible
@@ -79,7 +97,9 @@ describe "Admin Site Setting Bulk Action", type: :system do
banner.click_save
expect(dialog).to be_open
- expect(dialog).to have_content("An error occurred: contact_email: Invalid email address.")
+ expect(dialog).to have_content(
+ I18n.t("js.generic_error_with_reason", error: "contact_email: Invalid email address."),
+ )
dialog.click_ok
expect(banner).to be_visible