UI: Added phone number to user profile

This commit is contained in:
Artem Dzhereleiko 2023-01-11 17:29:07 +02:00
parent b7f4ed1e4b
commit 57f88960f7
7 changed files with 22 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

@ -13,6 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
:host {
display: block;
margin-bottom: 8px;
}
:host ::ng-deep {
.flag-loader {

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;