user profile editor > name required
This commit is contained in:
parent
60b84d7d6c
commit
469551a596
|
@ -41,6 +41,7 @@
|
|||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col-auto mb-1 field-title">{{'USER-PROFILE.SETTINGS.NAME' | translate}}
|
||||
*<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>
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue