user profile editor > name required

This commit is contained in:
mchouliara 2024-09-26 17:44:52 +03:00
parent 60b84d7d6c
commit 469551a596
2 changed files with 3 additions and 1 deletions

View File

@ -41,6 +41,7 @@
<div class="col">
<div class="row">
<div class="col-auto mb-1 field-title">{{'USER-PROFILE.SETTINGS.NAME' | translate}}
&nbsp;*<small class="required-text">{{'GENERAL.VALIDATION.REQUIRED' | translate }}</small>
</div>
</div>
<div class="row">
@ -48,6 +49,7 @@
<mat-form-field>
<input matInput type="text" name="name" placeholder="{{'USER-PROFILE.SETTINGS.NAME' | translate}}" [formControl]="formGroup.get('name')">
<mat-error *ngIf="formGroup.get('name').hasError('backendError')">{{formGroup.get('name').getError('backendError').message}}</mat-error>
<mat-error *ngIf="formGroup.get('name').hasError('required')">{{'COMMONS.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field>
</div>

View File

@ -301,7 +301,7 @@ export class UserProfileComponent extends BaseComponent implements OnInit, OnDes
});
}
printErrors(rootform: UntypedFormGroup) { //TODO this is wrong
printErrors(rootform: UntypedFormGroup) {
if (!rootform.valid) {
Object.keys(rootform.controls).forEach(key => {
const errors = rootform.get(key).errors;