From efaaf9e7915b8b6a56d152da849924fa328840f4 Mon Sep 17 00:00:00 2001 From: Artem Dzhereleiko Date: Thu, 13 Jul 2023 12:56:51 +0300 Subject: [PATCH 1/4] UI: Improvement Add asset dialog --- .../asset-profile-autocomplete.component.html | 5 +++++ .../asset-profile-autocomplete.component.ts | 10 +++------ ...device-profile-autocomplete.component.html | 2 +- .../device-profile-autocomplete.component.ts | 4 ---- .../device-wizard-dialog.component.html | 2 +- .../wizard/device-wizard-dialog.component.ts | 5 +---- .../home/pages/asset/asset.component.html | 21 ++++++++++++------- .../home/pages/asset/asset.component.ts | 2 ++ .../assets/locale/locale.constant-en_US.json | 3 ++- 9 files changed, 29 insertions(+), 25 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/profile/asset-profile-autocomplete.component.html b/ui-ngx/src/app/modules/home/components/profile/asset-profile-autocomplete.component.html index 87ee2a7fa1..ec41d7db09 100644 --- a/ui-ngx/src/app/modules/home/components/profile/asset-profile-autocomplete.component.html +++ b/ui-ngx/src/app/modules/home/components/profile/asset-profile-autocomplete.component.html @@ -43,6 +43,11 @@ (click)="editAssetProfile($event)"> edit + @@ -76,6 +75,7 @@ diff --git a/ui-ngx/src/app/modules/home/components/wizard/device-wizard-dialog.component.ts b/ui-ngx/src/app/modules/home/components/wizard/device-wizard-dialog.component.ts index 65e7df1e90..69c18b42c5 100644 --- a/ui-ngx/src/app/modules/home/components/wizard/device-wizard-dialog.component.ts +++ b/ui-ngx/src/app/modules/home/components/wizard/device-wizard-dialog.component.ts @@ -147,11 +147,8 @@ export class DeviceWizardDialogComponent extends DialogComponent 0) { return this.deviceService.saveDeviceWithCredentials(deepTrim(device), deepTrim(this.credentialsFormGroup.value.credential)).pipe( catchError((e: HttpErrorResponse) => { diff --git a/ui-ngx/src/app/modules/home/pages/asset/asset.component.html b/ui-ngx/src/app/modules/home/pages/asset/asset.component.html index 16229a7af6..62b45b7542 100644 --- a/ui-ngx/src/app/modules/home/pages/asset/asset.component.html +++ b/ui-ngx/src/app/modules/home/pages/asset/asset.component.html @@ -86,13 +86,6 @@ {{ 'asset.name-max-length' | translate }} - - asset.label @@ -100,6 +93,20 @@ {{ 'asset.label-max-length' | translate }} + + + +
asset.description diff --git a/ui-ngx/src/app/modules/home/pages/asset/asset.component.ts b/ui-ngx/src/app/modules/home/pages/asset/asset.component.ts index 8c53cbba38..a96b65e249 100644 --- a/ui-ngx/src/app/modules/home/pages/asset/asset.component.ts +++ b/ui-ngx/src/app/modules/home/pages/asset/asset.component.ts @@ -69,6 +69,7 @@ export class AssetComponent extends EntityComponent { name: [entity ? entity.name : '', [Validators.required, Validators.maxLength(255)]], assetProfileId: [entity ? entity.assetProfileId : null, [Validators.required]], label: [entity ? entity.label : '', Validators.maxLength(255)], + customerId: [entity ? entity.customerId : ''], additionalInfo: this.fb.group( { description: [entity && entity.additionalInfo ? entity.additionalInfo.description : ''], @@ -82,6 +83,7 @@ export class AssetComponent extends EntityComponent { this.entityForm.patchValue({name: entity.name}); this.entityForm.patchValue({assetProfileId: entity.assetProfileId}); this.entityForm.patchValue({label: entity.label}); + this.entityForm.patchValue({customerId: entity.customerId}); this.entityForm.patchValue({additionalInfo: {description: entity.additionalInfo ? entity.additionalInfo.description : ''}}); } diff --git a/ui-ngx/src/assets/locale/locale.constant-en_US.json b/ui-ngx/src/assets/locale/locale.constant-en_US.json index c5ec1fca40..7257ebb730 100644 --- a/ui-ngx/src/assets/locale/locale.constant-en_US.json +++ b/ui-ngx/src/assets/locale/locale.constant-en_US.json @@ -685,7 +685,8 @@ "unassign-asset-from-edge-text": "After the confirmation the asset will be unassigned and won't be accessible by the edge.", "unassign-assets-from-edge-title": "Are you sure you want to unassign { count, plural, =1 {1 asset} other {# assets} }?", "unassign-assets-from-edge-text": "After the confirmation all selected assets will be unassigned and won't be accessible by the edge.", - "selected-assets": "{ count, plural, =1 {1 asset} other {# assets} } selected" + "selected-assets": "{ count, plural, =1 {1 asset} other {# assets} } selected", + "customer-to-assign-asset": "Customer to assign the asset" }, "attribute": { "attributes": "Attributes", From a5aa605b8548459e48889e99477069562a363f1d Mon Sep 17 00:00:00 2001 From: Artem Dzhereleiko Date: Thu, 20 Jul 2023 16:31:42 +0300 Subject: [PATCH 2/4] UI: Change label to assign customer --- ui-ngx/src/app/modules/home/pages/asset/asset.component.html | 2 +- ui-ngx/src/assets/locale/locale.constant-en_US.json | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ui-ngx/src/app/modules/home/pages/asset/asset.component.html b/ui-ngx/src/app/modules/home/pages/asset/asset.component.html index 62b45b7542..fbef65a4d6 100644 --- a/ui-ngx/src/app/modules/home/pages/asset/asset.component.html +++ b/ui-ngx/src/app/modules/home/pages/asset/asset.component.html @@ -104,7 +104,7 @@ *ngIf="isAdd" useFullEntityId formControlName="customerId" - labelText="asset.customer-to-assign-asset" + labelText="customer.assign-customer" [entityType]="entityType.CUSTOMER">
diff --git a/ui-ngx/src/assets/locale/locale.constant-en_US.json b/ui-ngx/src/assets/locale/locale.constant-en_US.json index 33067d403d..cd379fa4dc 100644 --- a/ui-ngx/src/assets/locale/locale.constant-en_US.json +++ b/ui-ngx/src/assets/locale/locale.constant-en_US.json @@ -686,8 +686,7 @@ "unassign-asset-from-edge-text": "After the confirmation the asset will be unassigned and won't be accessible by the edge.", "unassign-assets-from-edge-title": "Are you sure you want to unassign { count, plural, =1 {1 asset} other {# assets} }?", "unassign-assets-from-edge-text": "After the confirmation all selected assets will be unassigned and won't be accessible by the edge.", - "selected-assets": "{ count, plural, =1 {1 asset} other {# assets} } selected", - "customer-to-assign-asset": "Customer to assign the asset" + "selected-assets": "{ count, plural, =1 {1 asset} other {# assets} } selected" }, "attribute": { "attributes": "Attributes", From 4f8b1e42fc0a82c767b0006c851cbfb174868b51 Mon Sep 17 00:00:00 2001 From: Artem Dzhereleiko Date: Fri, 28 Jul 2023 12:11:07 +0300 Subject: [PATCH 3/4] UI: Refactoring --- ui-ngx/src/app/modules/home/pages/asset/asset.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui-ngx/src/app/modules/home/pages/asset/asset.component.html b/ui-ngx/src/app/modules/home/pages/asset/asset.component.html index fbef65a4d6..b2c4b5a10a 100644 --- a/ui-ngx/src/app/modules/home/pages/asset/asset.component.html +++ b/ui-ngx/src/app/modules/home/pages/asset/asset.component.html @@ -104,7 +104,7 @@ *ngIf="isAdd" useFullEntityId formControlName="customerId" - labelText="customer.assign-customer" + labelText="asset.assign-to-customer" [entityType]="entityType.CUSTOMER">
From a88730207f62506cd4962f534831c5140381ebff Mon Sep 17 00:00:00 2001 From: Artem Dzhereleiko Date: Mon, 7 Aug 2023 14:48:23 +0300 Subject: [PATCH 4/4] UI: Fixed buttons for mobile --- .../profile/asset-profile-autocomplete.component.scss | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ui-ngx/src/app/modules/home/components/profile/asset-profile-autocomplete.component.scss b/ui-ngx/src/app/modules/home/components/profile/asset-profile-autocomplete.component.scss index d9ffef2925..892c3648bb 100644 --- a/ui-ngx/src/app/modules/home/components/profile/asset-profile-autocomplete.component.scss +++ b/ui-ngx/src/app/modules/home/components/profile/asset-profile-autocomplete.component.scss @@ -19,3 +19,9 @@ color: inherit; } } + +:host ::ng-deep { + .mat-mdc-form-field-icon-suffix { + display: flex; + } +}