- Length between {{passwordResponse.passwordLengthMin}}
- and {{passwordResponse.passwordLengthMax}} characters
+ class='fa-solid fa-square-check mr-2'>{{ t('change password.rules.length between', {lengthMin:
+ passwordResponse.passwordLengthMin, lengthMax: passwordResponse.passwordLengthMax}) }}
- Must contain at least 2 numbers
+ class='fa-solid fa-square-check mr-2'>{{ t('change password.rules.required numbers') }}
- Must contain at least 1 lowercase letter
+ class='fa-solid fa-square-check mr-2'>{{ t('change password.rules.required lowercase') }}
- Must contain at least 1 uppercase letter
+ class='fa-solid fa-square-check mr-2'>{{ t('change password.rules.required uppercase') }}
- Must contain at least 1 special character
+ class='fa-solid fa-square-check mr-2'>{{ t('change password.rules.required special') }}
- Must not re-use previous
- {{passwordResponse.numberOfHistoricalPasswords}} passwords
+ class='fa-solid fa-square-check mr-2'>{{ t('change password.rules.previous count', {count:
+ passwordResponse.numberOfHistoricalPasswords}) }}
0" [innerHTML]="message">
@@ -55,39 +55,38 @@
diff --git a/CSETWebNg/src/app/dialogs/change-password/change-password.component.ts b/CSETWebNg/src/app/dialogs/change-password/change-password.component.ts
index 69e2c8c5f9..ff43d827d1 100644
--- a/CSETWebNg/src/app/dialogs/change-password/change-password.component.ts
+++ b/CSETWebNg/src/app/dialogs/change-password/change-password.component.ts
@@ -29,6 +29,7 @@ import { environment } from '../../../environments/environment';
import { ChangePassword } from '../../models/reset-pass.model';
import { AuthenticationService } from '../../services/authentication.service';
import { BehaviorSubject, Observable } from 'rxjs';
+import { TranslocoService } from '@ngneat/transloco';
@Component({
selector: 'app-change-password',
@@ -48,7 +49,7 @@ export class ChangePasswordComponent implements OnInit {
private _passwordContainsNumbers: BehaviorSubject
= new BehaviorSubject(false);
public passwordContainsNumbers: Observable = this._passwordContainsNumbers.asObservable();
- msgChangeTempPw = 'Temporary password must be changed on first logon.';
+ msgChangeTempPw = this.tSvc.translate('change password.change temp on logon');
check = true;
passwordResponse: any = {
passwordLengthMin: 13,
@@ -64,6 +65,7 @@ export class ChangePasswordComponent implements OnInit {
constructor(private auth: AuthenticationService,
private router: Router,
+ public tSvc: TranslocoService,
public dialogRef: MatDialogRef,
private ref: ChangeDetectorRef,
private appRef: ApplicationRef,
@@ -76,12 +78,18 @@ export class ChangePasswordComponent implements OnInit {
this.warning = data.warning;
}
+ /**
+ *
+ */
ngOnInit() {
if (this.warning) {
this.message = this.msgChangeTempPw;
}
}
+ /**
+ *
+ */
onPasswordChangeClick(fReg: NgForm): void {
if (this.cpwd.newPassword !== this.cpwd.confirmPassword) {
return;
@@ -90,11 +98,12 @@ export class ChangePasswordComponent implements OnInit {
this.auth.changePassword(this.cpwd).subscribe(
(response: any) => {
this.passwordResponse = JSON.parse(response);
+
if (this.passwordResponse.isValid) {
this.dialogRef.close(true);
} else {
this.warning = true;
- this.message = this.passwordResponse.message;
+ this.message = this.tSvc.translate('change password.' + this.passwordResponse.message);
this.ref.detectChanges();
}
},
@@ -105,6 +114,9 @@ export class ChangePasswordComponent implements OnInit {
});
}
+ /**
+ *
+ */
checkPassword(event) {
var temp: ChangePassword = {
newPassword: event ?? '',
@@ -125,6 +137,9 @@ export class ChangePasswordComponent implements OnInit {
});
}
+ /**
+ *
+ */
cancel() {
this.dialogRef.close();
@@ -135,6 +150,9 @@ export class ChangePasswordComponent implements OnInit {
}
}
+ /**
+ *
+ */
togglePasswordVisibility() {
this.showPassword = !this.showPassword;
}
diff --git a/CSETWebNg/src/app/initial/landing-page-tabs/landing-page-tabs.component.ts b/CSETWebNg/src/app/initial/landing-page-tabs/landing-page-tabs.component.ts
index 7eab1c2bc0..45bb03c24d 100644
--- a/CSETWebNg/src/app/initial/landing-page-tabs/landing-page-tabs.component.ts
+++ b/CSETWebNg/src/app/initial/landing-page-tabs/landing-page-tabs.component.ts
@@ -28,6 +28,7 @@ import { filter } from 'rxjs/operators';
import { AuthenticationService } from '../../services/authentication.service';
import { ChangePasswordComponent } from "../../dialogs/change-password/change-password.component";
import { AlertComponent } from '../../dialogs/alert/alert.component';
+import { TranslocoService } from '@ngneat/transloco';
@Component({
@@ -46,6 +47,7 @@ export class LandingPageTabsComponent implements OnInit, AfterViewInit {
constructor(
private route: ActivatedRoute,
private router: Router,
+ private tSvc: TranslocoService,
public authSvc: AuthenticationService,
public dialog: MatDialog
) { }
@@ -133,8 +135,8 @@ export class LandingPageTabsComponent implements OnInit, AfterViewInit {
if (passwordChangeSuccess) {
this.dialog.open(AlertComponent, {
data: {
- messageText: 'Your password has been changed successfully.',
- title: 'Password Changed',
+ messageText: this.tSvc.translate('change password.changed message'),
+ title: this.tSvc.translate('change password.changed dialog title'),
iconClass: 'cset-icons-check-circle'
}
});
diff --git a/CSETWebNg/src/assets/i18n/en.json b/CSETWebNg/src/assets/i18n/en.json
index 71993d715f..d3b7b4851f 100644
--- a/CSETWebNg/src/assets/i18n/en.json
+++ b/CSETWebNg/src/assets/i18n/en.json
@@ -204,7 +204,8 @@
"questions mode": "Questions Mode",
"requirements mode": "Requirements Mode",
"add document": "Add a document",
- "copy text": "Copy Texzt"
+ "copy text": "Copy Text",
+ "change password": "Change Password"
},
"contact": {
"contacts": "Contacts",
@@ -784,6 +785,29 @@
"not valid email": "Not a valid email",
"emails do not match": "Emails do not match"
},
+ "change password": {
+ "dialog title": "Change Password",
+ "current password": "Current Password",
+ "show passwords": "Show Passwords",
+ "hide passwords": "Hide Passwords",
+ "new password": "New Password",
+ "confirm new password": "Confirm New Password",
+ "passwords do not match": "Passwords do not match",
+ "new and confirmation required": "New Password and Confirmation are required",
+ "change temp on logon": "Temporary password must be changed on first logon",
+ "current invalid": "Current password is invalid.
Correct it or request a new temporary password.",
+ "rules not satisfied": "New password does not satisfy all password policy requirements.",
+ "rules": {
+ "length between": "Length between {{lengthMin}} and {{lengthMax}} characters",
+ "required numbers": "Must contain at least 2 numbers",
+ "required lowercase": "Must contain at least 1 lowercase character",
+ "required uppercase": "Must contain at least 1 uppercase character",
+ "required special": "Must contain at least 1 special character",
+ "previous count": "Must not re-use previous {{count}} passwords"
+ },
+ "changed dialog title": "Password Changed",
+ "changed message": "Your password has been changed successfully"
+ },
"about": {
"about": "About",
"version": "Version",
diff --git a/CSETWebNg/src/assets/i18n/es.json b/CSETWebNg/src/assets/i18n/es.json
index 89a653b8e5..3d7f291795 100644
--- a/CSETWebNg/src/assets/i18n/es.json
+++ b/CSETWebNg/src/assets/i18n/es.json
@@ -260,7 +260,8 @@
"questions mode": "Modo preguntas",
"requirements mode": "Modo requisitos",
"add document": "Agregar documento",
- "copy text": "Copiar texto"
+ "copy text": "Copiar texto",
+ "change password": "Cambiar la contraseña"
},
"answer-options": {
"button-labels": {
@@ -782,6 +783,29 @@
"not valid email": "Email no es válido",
"emails do not match": "Los correos electrónicos no coinciden"
},
+ "change password": {
+ "dialog title": "Cambiar la contraseña",
+ "current password": "Contraseña actual",
+ "show passwords": "Mostrar contraseñas",
+ "hide passwords": "Ocultar contraseñas",
+ "new password": "Nueva contraseña",
+ "confirm new password": "Confirmar nueva contraseña",
+ "passwords do not match": "Las contraseñas no coinciden",
+ "new and confirmation required": "Se requiere nueva contraseña y confirmación",
+ "change temp on logon": "La contraseña temporal debe cambiarse en el primer inicio de sesión",
+ "current invalid": "La contraseña actual no es válida.
Corríjala o solicite una nueva contraseña temporal.",
+ "rules not satisfied": "La nueva contraseña no cumple con todos los requisitos de la política de contraseñas.",
+ "rules": {
+ "length between": "Longitud entre {{lengthMin}} y {{lengthMax}} caracteres",
+ "required numbers": "Debe contener al menos 2 números",
+ "required lowercase": "Debe contener al menos 1 carácter en minúscula",
+ "required uppercase": "Debe contener al menos 1 carácter en mayúscula",
+ "required special": "Debe contener al menos 1 carácter especial",
+ "previous count": "No se deben reutilizar {{count}} contraseñas anteriores"
+ },
+ "changed dialog title": "contraseña Cambiada",
+ "changed message": "tu contraseña ha sido cambiada exitosamente"
+ },
"about": {
"about": "Sobre",
"version": "Versión",
diff --git a/CSETWebNg/src/assets/i18n/uk.json b/CSETWebNg/src/assets/i18n/uk.json
index 1e1d57a555..6c4935c6a0 100644
--- a/CSETWebNg/src/assets/i18n/uk.json
+++ b/CSETWebNg/src/assets/i18n/uk.json
@@ -191,7 +191,8 @@
"questions mode": "Режим питань",
"requirements mode": "Режим вимог",
"add document": "Додайте документ",
- "copy text": "Копіювати текст"
+ "copy text": "Копіювати текст",
+ "change password": "Змінити пароль"
},
"contact": {
"contacts": "Контакти",
@@ -639,6 +640,29 @@
"not valid email": "Недійсна електронна адреса",
"emails do not match": "Електронні адреси не збігаються"
},
+ "change password": {
+ "dialog title": "Змінити пароль",
+ "current password": "Поточний пароль",
+ "show passwords": "Показати паролі",
+ "hide passwords": "Приховати паролі",
+ "new password": "Новий пароль",
+ "confirm new password": "Підтвердити новий пароль",
+ "passwords do not match": "Паролі не збігаються",
+ "new and confirmation required": "Потрібні новий пароль і підтвердження",
+ "change temp on logon": "Тимчасовий пароль необхідно змінити під час першого входу",
+ "current invalid": "Поточний пароль недійсний.
Виправте його або подайте запит на новий тимчасовий пароль.",
+ "rules not satisfied": "Новий пароль не відповідає всім вимогам політики паролів.",
+ "rules": {
+ "length between": "Довжина від {{lengthMin}} до {{lengthMax}} символів",
+ "required numbers": "Має містити принаймні 2 числа",
+ "required lowercase": "Має містити принаймні 1 малий регістр",
+ "required uppercase": "Має містити принаймні 1 символ у верхньому регістрі",
+ "required special": "Має містити принаймні 1 спеціальний символ",
+ "previous count": "Не можна повторно використовувати попередні {{count}} паролі"
+ },
+ "changed dialog title": "Пароль змінено",
+ "changed message": "Ваш пароль успішно змінено"
+ },
"about": {
"about": "Про програму",
"version": "Версія"