UX: Always disable create account button when user fields are invalid

Previously the button would never be disabled when an external authenticator was being used. The validation error would only appear after submit
This commit is contained in:
David Taylor 2020-02-07 13:20:50 +00:00
parent 252989e261
commit bc1977ef93
1 changed files with 4 additions and 4 deletions

View File

@ -69,13 +69,13 @@ export default Controller.extend(
"formSubmitted"
)
submitDisabled() {
if (!this.get("emailValidation.failed") && !this.passwordRequired)
return false; // 3rd party auth
if (this.formSubmitted) return true;
if (this.get("nameValidation.failed")) return true;
if (this.get("emailValidation.failed")) return true;
if (this.get("usernameValidation.failed")) return true;
if (this.get("passwordValidation.failed")) return true;
if (this.get("usernameValidation.failed") && this.usernameRequired)
return true;
if (this.get("passwordValidation.failed") && this.passwordRequired)
return true;
if (this.get("userFieldsValidation.failed")) return true;
return false;