From 515c7e1b07b28d32ab76ac09ba627f228150f217 Mon Sep 17 00:00:00 2001
From: Artem Dzhereleiko
Date: Fri, 8 Dec 2023 16:06:46 +0200
Subject: [PATCH] UI: Refactoring
---
.../home/pages/admin/security-settings.component.html | 8 ++------
.../home/pages/admin/security-settings.component.ts | 3 ---
.../modules/home/pages/security/security.component.html | 5 +++--
.../app/modules/home/pages/security/security.component.ts | 4 ++--
4 files changed, 7 insertions(+), 13 deletions(-)
diff --git a/ui-ngx/src/app/modules/home/pages/admin/security-settings.component.html b/ui-ngx/src/app/modules/home/pages/admin/security-settings.component.html
index 189d75d56d..886dd79ef6 100644
--- a/ui-ngx/src/app/modules/home/pages/admin/security-settings.component.html
+++ b/ui-ngx/src/app/modules/home/pages/admin/security-settings.component.html
@@ -73,6 +73,7 @@
admin.maximum-password-length
+
{{ 'admin.maximum-password-length-min' | translate }}
@@ -157,13 +158,8 @@
admin.allow-whitespace
-
+
{{'admin.force-reset-password-if-no-valid' | translate}}
-
-
diff --git a/ui-ngx/src/app/modules/home/pages/admin/security-settings.component.ts b/ui-ngx/src/app/modules/home/pages/admin/security-settings.component.ts
index 4ca662763a..a2d43e1a8f 100644
--- a/ui-ngx/src/app/modules/home/pages/admin/security-settings.component.ts
+++ b/ui-ngx/src/app/modules/home/pages/admin/security-settings.component.ts
@@ -213,7 +213,4 @@ export class SecuritySettingsComponent extends PageComponent implements HasConfi
confirmForm(): UntypedFormGroup {
return this.securitySettingsFormGroup.dirty ? this.securitySettingsFormGroup : this.jwtSecuritySettingsFormGroup;
}
-
- protected readonly queueProcessingStrategyTypes = QueueProcessingStrategyTypes;
- protected readonly queueProcessingStrategyTypesMap = QueueProcessingStrategyTypesMap;
}
diff --git a/ui-ngx/src/app/modules/home/pages/security/security.component.html b/ui-ngx/src/app/modules/home/pages/security/security.component.html
index 9d40e0786b..b87507f957 100644
--- a/ui-ngx/src/app/modules/home/pages/security/security.component.html
+++ b/ui-ngx/src/app/modules/home/pages/security/security.component.html
@@ -44,10 +44,11 @@
{{ 'security.password-requirement.incorrect-password-try-again' | translate }}
-
+
login.new-password
+
{{ 'security.password-requirement.character' | translate : {count: passwordPolicy.minimumLength} }}
- 0">
+
0">
security.password-requirement.at-most
diff --git a/ui-ngx/src/app/modules/home/pages/security/security.component.ts b/ui-ngx/src/app/modules/home/pages/security/security.component.ts
index d79a6c59b4..0f9b9cef2c 100644
--- a/ui-ngx/src/app/modules/home/pages/security/security.component.ts
+++ b/ui-ngx/src/app/modules/home/pages/security/security.component.ts
@@ -171,6 +171,7 @@ export class SecurityComponent extends PageComponent implements OnInit, OnDestro
private loadPasswordPolicy() {
this.authService.getUserPasswordPolicy().subscribe(policy => {
this.passwordPolicy = policy;
+ this.passwordPolicy.maximumLength = 7;
this.changePassword.get('newPassword').setValidators([
this.passwordStrengthValidator(),
this.samePasswordValidation(true, 'currentPassword'),
@@ -213,8 +214,7 @@ export class SecurityComponent extends PageComponent implements OnInit, OnDestro
errors.minLength = true;
}
- if (this.passwordPolicy?.maximumLength > 0 &&
- (value.length > this.passwordPolicy?.maximumLength || value.length < this.passwordPolicy.minimumLength)) {
+ if (!value.length || this.passwordPolicy.maximumLength > 0 && value.length > this.passwordPolicy.maximumLength) {
errors.maxLength = true;
}