From 65620e157a32f7f8f86d6728225104abf5bacca6 Mon Sep 17 00:00:00 2001 From: Chneemann Date: Fri, 2 Aug 2024 20:43:03 +0200 Subject: [PATCH] bugfixes --- .../components/auth/login/login.component.html | 6 ++++-- .../components/auth/login/login.component.scss | 6 +++++- .../components/auth/login/login.component.ts | 4 ++-- .../auth/register/register.component.html | 17 +++++++++++++---- .../auth/register/register.component.scss | 6 +++++- .../auth/register/register.component.ts | 6 ++++-- frontend/src/assets/style/colors.scss | 2 +- 7 files changed, 34 insertions(+), 13 deletions(-) diff --git a/frontend/src/app/components/auth/login/login.component.html b/frontend/src/app/components/auth/login/login.component.html index 15f4682..3b41349 100644 --- a/frontend/src/app/components/auth/login/login.component.html +++ b/frontend/src/app/components/auth/login/login.component.html @@ -43,7 +43,7 @@ pattern="[^<>]*" minlength="6" [class.error-border]=" - password.invalid && password.touched && authData.password.length > 0 + password.invalid && password.touched && authData.password.length < 6 " required /> @@ -51,13 +51,15 @@ @if (!password.valid && password.touched && authData.password.length < 1) {

Please enter your password

- } @else { @if (authData.password.length < 6 && password.touched) { + } @else { @if (authData.password && authData.password.length < 6 && + password.touched) {

Password is too short, min 6 characters

} }
- @if (authData.password.length < 6 && password.touched) { + @if (!password.valid && password.touched && authData.password.length < + 1) { +

Please enter a password

+ } @else { @if (authData.password && authData.password.length < 6 && + password.touched) {

Password is too short, min 6 characters

- } + } }
diff --git a/frontend/src/app/components/auth/register/register.component.scss b/frontend/src/app/components/auth/register/register.component.scss index 9aef02e..a948147 100644 --- a/frontend/src/app/components/auth/register/register.component.scss +++ b/frontend/src/app/components/auth/register/register.component.scss @@ -86,6 +86,10 @@ section { } } .error-border { - border: 1px solid red; + border: 1px solid $red; + color: $red; + &::placeholder { + color: $red; + } } } diff --git a/frontend/src/app/components/auth/register/register.component.ts b/frontend/src/app/components/auth/register/register.component.ts index 4cd7e14..f7faadf 100644 --- a/frontend/src/app/components/auth/register/register.component.ts +++ b/frontend/src/app/components/auth/register/register.component.ts @@ -36,8 +36,10 @@ export class RegisterComponent { onSubmit(ngForm: NgForm) { if (ngForm.submitted && ngForm.form.valid) { - console.log(this.authData.mail); - this.authData.mail = ''; + let mail = this.authData.mail; + console.log(this.authData); + ngForm.form.reset(); + ngForm.form.patchValue({ mail: mail }); } } } diff --git a/frontend/src/assets/style/colors.scss b/frontend/src/assets/style/colors.scss index 9ac1bed..5a0bc7f 100644 --- a/frontend/src/assets/style/colors.scss +++ b/frontend/src/assets/style/colors.scss @@ -3,4 +3,4 @@ $white: #fff; $black: #000; $gray: #ababab; $blue: #2e3edf; -$red: #ff0000; +$red: #ff002e;