A platform for community discussion. Free, open, simple.
UX: Require a password for invited users (#16291)
Dan Ungureanu7179fbab7734
diff --git a/app/assets/javascripts/discourse/app/controllers/invites-show.js b/app/assets/javascripts/discourse/app/controllers/invites-show.jsindex 4a6307d75c0..7079a5ea2cb 100644--- a/app/assets/javascripts/discourse/app/controllers/invites-show.js+++ b/app/assets/javascripts/discourse/app/controllers/invites-show.js@@ -1,4 +1,4 @@-import { alias, notEmpty, or, readOnly } from "@ember/object/computed";+import { alias, not, or, readOnly } from "@ember/object/computed";import Controller, { inject as controller } from "@ember/controller";import DiscourseURL from "discourse/lib/url";import EmberObject from "@ember/object";@@ -33,7 +33,7 @@ export default Controller.extend(emailVerifiedByLink: alias("model.email_verified_by_link"),differentExternalEmail: alias("model.different_external_email"),accountUsername: alias("model.username"),- passwordRequired: notEmpty("accountPassword"),+ passwordRequired: not("externalAuthsOnly"),successMessage: null,errorMessage: null,userFields: null,diff --git a/app/assets/javascripts/discourse/app/templates/invites/show.hbs b/app/assets/javascripts/discourse/app/templates/invites/show.hbsindex cda2c355421..a5554b07dd7 100644--- a/app/assets/javascripts/discourse/app/templates/invites/show.hbs+++ b/app/assets/javascripts/discourse/app/templates/invites/show.hbs@@ -97,10 +97,11 @@{{password-field value=accountPassword class=(value-entered accountPassword) type="password" id="new-account-password" capsLockOn=capsLockOn}}<label class="alt-placeholder" for="new-account-password">{{i18n "invites.password_label"}}+ <span class="required">*</span></label>{{input-tip validation=passwordValidation}}<div class="instructions">- {{passwordInstructions}} {{i18n "invites.optional_description"}}+ {{passwordInstructions}}<div class="caps-lock-warning {{unless capsLockOn "invisible"}}">{{d-icon "exclamation-triangle"}} {{i18n "login.caps_lock_warning"}}</div>diff --git a/app/assets/javascripts/discourse/tests/acceptance/invite-accept-test.js b/app/assets/javascripts/discourse/tests/acceptance/invite-accept-test.jsindex 0247a8ea0bb..64b9000802d 100644--- a/app/assets/javascripts/discourse/tests/acceptance/invite-accept-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/invite-accept-test.js@@ -119,6 +119,12 @@ acceptance("Invite accept", function (needs) {);await fillIn("#new-account-email", "[email protected]");+ assert.ok(+ exists(".invites-show .btn-primary:disabled"),+ "submit is disabled because password is not filled"+ );++ await fillIn("#new-account-password", "top$ecret");assert.notOk(exists(".invites-show .btn-primary:disabled"),"submit is enabled"diff --git a/config/locales/client.en.yml b/config/locales/client.en.ymlindex 5a2a02cf363..7dfa54e5161 100644--- a/config/locales/client.en.yml+++ b/config/locales/client.en.yml@@ -1999,7 +1999,6 @@ en:success: "Your account has been created and you're now logged in."name_label: "Name"password_label: "Password"- optional_description: "(optional)"password_reset:continue: "Continue to %{site_name}"