From 57f88960f7ed8674f0872e386cc958d1eccf0f3d Mon Sep 17 00:00:00 2001 From: Artem Dzhereleiko Date: Wed, 11 Jan 2023 17:29:07 +0200 Subject: [PATCH 1/2] UI: Added phone number to user profile --- ui-ngx/src/app/core/http/entity.service.ts | 1 + .../app/modules/home/pages/profile/profile.component.html | 5 +++++ .../src/app/modules/home/pages/profile/profile.component.ts | 2 ++ ui-ngx/src/app/modules/home/pages/user/user.component.html | 5 +++++ ui-ngx/src/app/modules/home/pages/user/user.component.ts | 4 +++- ui-ngx/src/app/shared/components/phone-input.component.scss | 5 +++++ ui-ngx/src/app/shared/models/user.model.ts | 1 + 7 files changed, 22 insertions(+), 1 deletion(-) diff --git a/ui-ngx/src/app/core/http/entity.service.ts b/ui-ngx/src/app/core/http/entity.service.ts index b66399de6c..d4cd4ad24f 100644 --- a/ui-ngx/src/app/core/http/entity.service.ts +++ b/ui-ngx/src/app/core/http/entity.service.ts @@ -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: diff --git a/ui-ngx/src/app/modules/home/pages/profile/profile.component.html b/ui-ngx/src/app/modules/home/pages/profile/profile.component.html index 3a15616055..bdcee70c67 100644 --- a/ui-ngx/src/app/modules/home/pages/profile/profile.component.html +++ b/ui-ngx/src/app/modules/home/pages/profile/profile.component.html @@ -56,6 +56,11 @@ user.last-name + + language.language diff --git a/ui-ngx/src/app/modules/home/pages/profile/profile.component.ts b/ui-ngx/src/app/modules/home/pages/profile/profile.component.ts index 9e43b369e6..e48471867b 100644 --- a/ui-ngx/src/app/modules/home/pages/profile/profile.component.ts +++ b/ui-ngx/src/app/modules/home/pages/profile/profile.component.ts @@ -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, diff --git a/ui-ngx/src/app/modules/home/pages/user/user.component.html b/ui-ngx/src/app/modules/home/pages/user/user.component.html index 563146d9c9..bd7bb56d99 100644 --- a/ui-ngx/src/app/modules/home/pages/user/user.component.html +++ b/ui-ngx/src/app/modules/home/pages/user/user.component.html @@ -92,6 +92,11 @@ user.last-name + +
user.description diff --git a/ui-ngx/src/app/modules/home/pages/user/user.component.ts b/ui-ngx/src/app/modules/home/pages/user/user.component.ts index 474467fbe7..5c40e66a66 100644 --- a/ui-ngx/src/app/modules/home/pages/user/user.component.ts +++ b/ui-ngx/src/app/modules/home/pages/user/user.component.ts @@ -73,6 +73,7 @@ export class UserComponent extends EntityComponent { 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 { 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 { verticalPosition: 'bottom', horizontalPosition: 'right' } - )) + )); } } diff --git a/ui-ngx/src/app/shared/components/phone-input.component.scss b/ui-ngx/src/app/shared/components/phone-input.component.scss index 432c9d21f2..6cff1c5bb8 100644 --- a/ui-ngx/src/app/shared/components/phone-input.component.scss +++ b/ui-ngx/src/app/shared/components/phone-input.component.scss @@ -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 { diff --git a/ui-ngx/src/app/shared/models/user.model.ts b/ui-ngx/src/app/shared/models/user.model.ts index 42e6407c12..87be63ef74 100644 --- a/ui-ngx/src/app/shared/models/user.model.ts +++ b/ui-ngx/src/app/shared/models/user.model.ts @@ -24,6 +24,7 @@ export interface User extends BaseData { tenantId: TenantId; customerId: CustomerId; email: string; + phone: string; authority: Authority; firstName: string; lastName: string; From 67a5725cf0f1251602e5721ea93c19564209b0c5 Mon Sep 17 00:00:00 2001 From: Artem Dzhereleiko Date: Wed, 11 Jan 2023 17:40:57 +0200 Subject: [PATCH 2/2] UI: Refactoring --- ui-ngx/src/app/shared/components/phone-input.component.scss | 5 ----- 1 file changed, 5 deletions(-) diff --git a/ui-ngx/src/app/shared/components/phone-input.component.scss b/ui-ngx/src/app/shared/components/phone-input.component.scss index 6cff1c5bb8..432c9d21f2 100644 --- a/ui-ngx/src/app/shared/components/phone-input.component.scss +++ b/ui-ngx/src/app/shared/components/phone-input.component.scss @@ -13,11 +13,6 @@ * 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 {