A platform for community discussion. Free, open, simple.
DEV: Update verbiage around remove password modal, swap button for a link (#32338)
Chris Albertib724181bdf03
diff --git a/app/assets/javascripts/discourse/app/controllers/preferences/security.js b/app/assets/javascripts/discourse/app/controllers/preferences/security.jsindex 976779d9f37..5b0d7cd4d6c 100644--- a/app/assets/javascripts/discourse/app/controllers/preferences/security.js+++ b/app/assets/javascripts/discourse/app/controllers/preferences/security.js@@ -146,6 +146,7 @@ export default class SecurityController extends Controller {this.dialog.deleteConfirm({title: i18n("user.change_password.remove"),message: i18n("user.change_password.remove_detail"),+ confirmButtonLabel: "user.change_password.remove",confirmButtonIcon: "trash-can",didConfirm: () => {this.set("removePasswordInProgress", true);diff --git a/app/assets/javascripts/discourse/app/templates/preferences/security.gjs b/app/assets/javascripts/discourse/app/templates/preferences/security.gjsindex 1f77f624c64..4b6989585a1 100644--- a/app/assets/javascripts/discourse/app/templates/preferences/security.gjs+++ b/app/assets/javascripts/discourse/app/templates/preferences/security.gjs@@ -42,17 +42,15 @@ export default RouteTemplate({{#if @controller.associatedAccountsLoaded}}{{#if @controller.canRemovePassword}}<div class="controls">- <DButton- @action={{@controller.removePassword}}- @icon="trash-can"- @label="user.change_password.remove"- class="btn-default"- @isLoading={{@controller.removePasswordInProgress}}- id="remove-password-button"- />- </div>- <div class="instructions">- {{i18n "user.change_password.remove_detail"}}+ <a+ href+ {{on "click" @controller.removePassword}}+ hidden={{@controller.removePasswordInProgress}}+ id="remove-password-link"+ >+ {{icon "trash-can"}}+ {{i18n "user.change_password.remove"}}+ </a></div>{{/if}}{{else}}diff --git a/app/assets/javascripts/discourse/tests/acceptance/user-preferences-security-test.js b/app/assets/javascripts/discourse/tests/acceptance/user-preferences-security-test.jsindex 29ecb8474c1..ef16a0368a9 100644--- a/app/assets/javascripts/discourse/tests/acceptance/user-preferences-security-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/user-preferences-security-test.js@@ -234,7 +234,7 @@ acceptance("User Preferences - Security", function (needs) {await visit("/u/eviltrout/preferences/security");// eviltrout starts with an entry in associated_accounts, can remove passwordassert- .dom("#remove-password-button")+ .dom("#remove-password-link").exists("shows for user with associated account");updateCurrentUser({@@ -242,7 +242,7 @@ acceptance("User Preferences - Security", function (needs) {});assert- .dom("#remove-password-button")+ .dom("#remove-password-link").doesNotExist("does not show for user with no associated account and no passkeys");@@ -257,14 +257,14 @@ acceptance("User Preferences - Security", function (needs) {},],});- assert.dom("#remove-password-button").exists("shows for user with passkey");+ assert.dom("#remove-password-link").exists("shows for user with passkey");});test("Removing User Password", async function (assert) {await visit("/u/eviltrout/preferences/security");// eviltrout starts with an entry in associated_accounts, can remove password- await click("#remove-password-button");+ await click("#remove-password-link");assert.dom(".dialog-body .confirm-session").exists(@@ -277,7 +277,7 @@ acceptance("User Preferences - Security", function (needs) {.hasText(i18n("user.change_password.remove_detail"));await click(".dialog-footer .btn-danger");assert- .dom("#remove-password-button")+ .dom("#remove-password-link").doesNotExist("hides remove password button once password is removed");assert.dom("#change-password-button")diff --git a/config/locales/client.en.yml b/config/locales/client.en.ymlindex 6b4e53b458e..f4911d7fa82 100644--- a/config/locales/client.en.yml+++ b/config/locales/client.en.yml@@ -1617,7 +1617,7 @@ en:verify_identity: "To continue, please verify your identity."title: "Password Reset"remove: "Remove Password"- remove_detail: "This completely erases your password. Your account will no longer be accessible by using your password to log in unless you reset it."+ remove_detail: "Your account will no longer be accessible with a password unless you reset it."second_factor_backup:title: "Two-Factor Backup Codes"diff --git a/spec/system/user_page/user_preferences_security_spec.rb b/spec/system/user_page/user_preferences_security_spec.rbindex da0ebf1e6a5..177f7459799 100644--- a/spec/system/user_page/user_preferences_security_spec.rb+++ b/spec/system/user_page/user_preferences_security_spec.rb@@ -95,10 +95,10 @@ describe "User preferences | Security", type: :system do# close the dialog (don't delete the key, we need it to login in the next step)find(".dialog-close").click- find("#remove-password-button").click+ find("#remove-password-link").click# already confirmed session for the passkey, so this will go straight for the confirmation dialogfind(".dialog-footer .btn-danger").click- expect(user_preferences_security_page).to have_no_css("#remove-password-button")+ expect(user_preferences_security_page).to have_no_css("#remove-password-link")user_menu.sign_out