From 4336e3976c7987ee46fe8b7021ac586da62e70bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johnny=20G=C3=A9rard?= Date: Sun, 10 Nov 2024 16:36:35 +0100 Subject: [PATCH] feat: improve password validation feedback display --- client/public/icons/error.svg | 1 + client/src/app/app.component.ts | 2 +- .../password-strength-meter.component.html | 9 ++++++++- .../password-strength-meter.component.scss | 5 +++-- .../password-strength-meter.component.ts | 1 + client/src/app/pipes/password-error.pipe.ts | 2 +- .../src/app/validators/password-validator-factory.ts | 12 +++++------- 7 files changed, 20 insertions(+), 12 deletions(-) create mode 100644 client/public/icons/error.svg diff --git a/client/public/icons/error.svg b/client/public/icons/error.svg new file mode 100644 index 0000000..22625b2 --- /dev/null +++ b/client/public/icons/error.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts index a7dc4dc..8383113 100644 --- a/client/src/app/app.component.ts +++ b/client/src/app/app.component.ts @@ -18,7 +18,7 @@ export class AppComponent { #sanitizer = inject(DomSanitizer); constructor() { - for (const name of ["visibility", "visibility_off", "info"]) { + for (const name of ["error", "info", "visibility", "visibility_off"]) { this.#registerIcon(name); } diff --git a/client/src/app/components/password-strength-meter/password-strength-meter.component.html b/client/src/app/components/password-strength-meter/password-strength-meter.component.html index b61aa12..0e8702e 100644 --- a/client/src/app/components/password-strength-meter/password-strength-meter.component.html +++ b/client/src/app/components/password-strength-meter/password-strength-meter.component.html @@ -15,11 +15,18 @@
+@if (warning()) { +
+ + + {{ warning() }} +
+} @if (suggestions().length) {