Merge pull request #7925 from ArtemDzhereleiko/AD/notification-system/user-phone-number

Added phone number to user profile
This commit is contained in:
Vladyslav 2023-01-11 17:46:00 +02:00 committed by GitHub
commit 2bc5771472
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 17 additions and 1 deletions

View File

@ -718,6 +718,7 @@ export class EntityService {
entityFieldKeys.push(entityFields.email.keyName);
entityFieldKeys.push(entityFields.firstName.keyName);
entityFieldKeys.push(entityFields.lastName.keyName);
entityFieldKeys.push(entityFields.phone.keyName);
break;
case EntityType.TENANT:
case EntityType.CUSTOMER:

View File

@ -56,6 +56,11 @@
<mat-label translate>user.last-name</mat-label>
<input matInput formControlName="lastName"/>
</mat-form-field>
<tb-phone-input [required]="false"
[label]="'contact.phone'"
[enableFlagsSelect]="true"
formControlName="phone">
</tb-phone-input>
<mat-form-field class="mat-block">
<mat-label translate>language.language</mat-label>
<mat-select formControlName="language">

View File

@ -63,6 +63,7 @@ export class ProfileComponent extends PageComponent implements OnInit, HasConfir
email: ['', [Validators.required, Validators.email]],
firstName: [''],
lastName: [''],
phone: [''],
language: [''],
homeDashboardId: [null],
homeDashboardHideToolbar: [true]
@ -87,6 +88,7 @@ export class ProfileComponent extends PageComponent implements OnInit, HasConfir
tenantId: user.tenantId,
customerId: user.customerId,
email: user.email,
phone: user.phone,
firstName: user.firstName,
id: user.id,
lastName: user.lastName,

View File

@ -92,6 +92,11 @@
<mat-label translate>user.last-name</mat-label>
<input matInput formControlName="lastName">
</mat-form-field>
<tb-phone-input [required]="false"
[label]="'contact.phone'"
[enableFlagsSelect]="true"
formControlName="phone">
</tb-phone-input>
<div formGroupName="additionalInfo" fxLayout="column">
<mat-form-field class="mat-block">
<mat-label translate>user.description</mat-label>

View File

@ -73,6 +73,7 @@ export class UserComponent extends EntityComponent<User> {
email: [entity ? entity.email : '', [Validators.required, Validators.email]],
firstName: [entity ? entity.firstName : ''],
lastName: [entity ? entity.lastName : ''],
phone: [entity ? entity.phone : ''],
additionalInfo: this.fb.group(
{
description: [entity && entity.additionalInfo ? entity.additionalInfo.description : ''],
@ -91,6 +92,7 @@ export class UserComponent extends EntityComponent<User> {
this.entityForm.patchValue({email: entity.email});
this.entityForm.patchValue({firstName: entity.firstName});
this.entityForm.patchValue({lastName: entity.lastName});
this.entityForm.patchValue({phone: entity.phone});
this.entityForm.patchValue({additionalInfo: {description: entity.additionalInfo ? entity.additionalInfo.description : ''}});
this.entityForm.patchValue({additionalInfo:
{defaultDashboardId: entity.additionalInfo ? entity.additionalInfo.defaultDashboardId : null}});
@ -112,7 +114,7 @@ export class UserComponent extends EntityComponent<User> {
verticalPosition: 'bottom',
horizontalPosition: 'right'
}
))
));
}
}

View File

@ -24,6 +24,7 @@ export interface User extends BaseData<UserId> {
tenantId: TenantId;
customerId: CustomerId;
email: string;
phone: string;
authority: Authority;
firstName: string;
lastName: string;