From b671c7671b0702223bd94f71fc30f42bafeabc42 Mon Sep 17 00:00:00 2001 From: Artem Dzhereleiko Date: Mon, 22 May 2023 12:40:41 +0300 Subject: [PATCH 1/3] UI: Fixed tenant profile form --- .../components/entity/add-entity-dialog.component.html | 2 +- .../home/components/profile/tenant-profile.component.scss | 8 +++++++- .../home/components/queue/queue-form.component.html | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/entity/add-entity-dialog.component.html b/ui-ngx/src/app/modules/home/components/entity/add-entity-dialog.component.html index 4abf910c1a..66dbbba2e3 100644 --- a/ui-ngx/src/app/modules/home/components/entity/add-entity-dialog.component.html +++ b/ui-ngx/src/app/modules/home/components/entity/add-entity-dialog.component.html @@ -15,7 +15,7 @@ limitations under the License. --> -
+

{{ translations.add }}

diff --git a/ui-ngx/src/app/modules/home/components/profile/tenant-profile.component.scss b/ui-ngx/src/app/modules/home/components/profile/tenant-profile.component.scss index bd5dfa99ae..d052c97385 100644 --- a/ui-ngx/src/app/modules/home/components/profile/tenant-profile.component.scss +++ b/ui-ngx/src/app/modules/home/components/profile/tenant-profile.component.scss @@ -14,10 +14,16 @@ * limitations under the License. */ :host ::ng-deep { - .mat-mdc-form-field-infix { + .mat-mdc-floating-label { width: 100% !important; } + .mat-mdc-form-field-error { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + .mat-mdc-checkbox{ &.hinted-checkbox { .mdc-checkbox { diff --git a/ui-ngx/src/app/modules/home/components/queue/queue-form.component.html b/ui-ngx/src/app/modules/home/components/queue/queue-form.component.html index 8f8f509e94..9fee72fef4 100644 --- a/ui-ngx/src/app/modules/home/components/queue/queue-form.component.html +++ b/ui-ngx/src/app/modules/home/components/queue/queue-form.component.html @@ -40,7 +40,7 @@
- + {{ queueSubmitStrategyTypesMap.get(queueSubmitStrategyTypes[strategy]).label | translate }}
- + {{ queueProcessingStrategyTypesMap.get(queueProcessingStrategyTypes[strategy]).label | translate }} Date: Tue, 23 May 2023 18:31:02 +0300 Subject: [PATCH 2/3] UI: Refactoring tenant profile --- .../profile/tenant-profile.component.scss | 8 +-- ...enant-profile-configuration.component.html | 60 ++++++++++++------- .../assets/locale/locale.constant-en_US.json | 4 +- 3 files changed, 43 insertions(+), 29 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/profile/tenant-profile.component.scss b/ui-ngx/src/app/modules/home/components/profile/tenant-profile.component.scss index d052c97385..bd5dfa99ae 100644 --- a/ui-ngx/src/app/modules/home/components/profile/tenant-profile.component.scss +++ b/ui-ngx/src/app/modules/home/components/profile/tenant-profile.component.scss @@ -14,16 +14,10 @@ * limitations under the License. */ :host ::ng-deep { - .mat-mdc-floating-label { + .mat-mdc-form-field-infix { width: 100% !important; } - .mat-mdc-form-field-error { - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - } - .mat-mdc-checkbox{ &.hinted-checkbox { .mdc-checkbox { diff --git a/ui-ngx/src/app/modules/home/components/profile/tenant/default-tenant-profile-configuration.component.html b/ui-ngx/src/app/modules/home/components/profile/tenant/default-tenant-profile-configuration.component.html index 0bbb6a5926..4e287a888c 100644 --- a/ui-ngx/src/app/modules/home/components/profile/tenant/default-tenant-profile-configuration.component.html +++ b/ui-ngx/src/app/modules/home/components/profile/tenant/default-tenant-profile-configuration.component.html @@ -21,7 +21,7 @@ {{ 'tenant-profile.entities' | translate }} tenant-profile.unlimited
- + tenant-profile.maximum-devices {{ 'tenant-profile.maximum-devices-range' | translate}} + - + tenant-profile.maximum-dashboards {{ 'tenant-profile.maximum-dashboards-range' | translate}} +
- + tenant-profile.maximum-assets {{ 'tenant-profile.maximum-assets-range' | translate}} + - + tenant-profile.maximum-users {{ 'tenant-profile.maximum-users-range' | translate}} +
@@ -80,7 +84,7 @@
- + tenant-profile.maximum-customers {{ 'tenant-profile.maximum-customers-range' | translate}} + - + tenant-profile.maximum-rule-chains {{ 'tenant-profile.maximum-rule-chains-range' | translate}} +
@@ -114,7 +120,7 @@ {{ 'tenant-profile.rule-engine' | translate }} tenant-profile.unlimited
- + tenant-profile.max-r-e-executions {{ 'tenant-profile.max-r-e-executions-range' | translate}} + - + tenant-profile.max-transport-messages {{ 'tenant-profile.max-transport-messages-required' | translate}} +
@@ -147,7 +155,7 @@
- + tenant-profile.max-j-s-executions {{ 'tenant-profile.max-j-s-executions-range' | translate}} + - + tenant-profile.max-transport-data-points {{ 'tenant-profile.max-transport-data-points-range' | translate}} +
- + tenant-profile.max-rule-node-executions-per-message {{ 'tenant-profile.max-rule-node-executions-per-message-range' | translate}} +
@@ -196,7 +207,7 @@ {{ 'tenant-profile.time-to-live' | translate }} tenant-profile.unlimited
- + tenant-profile.max-d-p-storage-days {{ 'tenant-profile.max-d-p-storage-days-range' | translate}} + - + tenant-profile.alarms-ttl-days {{ 'tenant-profile.alarms-ttl-days-days-range' | translate}} +
- + tenant-profile.default-storage-ttl-days {{ 'tenant-profile.default-storage-ttl-days-range' | translate}} + - + tenant-profile.rpc-ttl-days {{ 'tenant-profile.rpc-ttl-days-days-range' | translate}} +
@@ -254,7 +269,7 @@ {{ 'tenant-profile.alarms-and-notifications' | translate }} tenant-profile.unlimited
- + tenant-profile.max-emails {{ 'tenant-profile.max-emails-range' | translate}} + - + tenant-profile.max-created-alarms {{ 'tenant-profile.max-created-alarms-range' | translate}} +
- + tenant-profile.max-sms {{ 'tenant-profile.max-sms-range' | translate}} +
@@ -301,7 +319,7 @@ {{ 'tenant-profile.ota-files-in-bytes' | translate }} tenant-profile.unlimited
- + tenant-profile.maximum-resources-sum-data-size {{ 'tenant-profile.maximum-resources-sum-data-size-range' | translate}} + - + tenant-profile.maximum-ota-packages-sum-data-size {{ 'tenant-profile.maximum-ota-packages-sum-data-size-range' | translate}} +
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 bcaa4a183f..933462b06b 100644 --- a/ui-ngx/src/assets/locale/locale.constant-en_US.json +++ b/ui-ngx/src/assets/locale/locale.constant-en_US.json @@ -3600,8 +3600,8 @@ "maximum-resources-sum-data-size-required": "Resource files sum size is required.", "maximum-resources-sum-data-size-range": "Resource files sum size can`t be negative", "maximum-ota-packages-sum-data-size": "OTA package files sum size", - "maximum-ota-package-sum-data-size-required": "OTA package files sum size is required.", - "maximum-ota-package-sum-data-size-range": "OTA package files sum size can`t be negative", + "maximum-ota-packages-sum-data-size-required": "OTA package files sum size is required.", + "maximum-ota-packages-sum-data-size-range": "OTA package files sum size can`t be negative", "rest-requests-for-tenant": "REST requests for tenant", "transport-tenant-telemetry-msg-rate-limit": "Transport tenant telemetry messages", "transport-tenant-telemetry-data-points-rate-limit": "Transport tenant telemetry data points", From 41a3e6c22ebddaaa83161219c64a6f1eff93f5f0 Mon Sep 17 00:00:00 2001 From: Artem Dzhereleiko Date: Fri, 26 May 2023 12:21:32 +0300 Subject: [PATCH 3/3] UI: Refactoring --- .../profile/queue/tenant-profile-queues.component.ts | 6 +++--- .../default-tenant-profile-configuration.component.html | 4 ++-- .../modules/home/components/queue/queue-form.component.html | 4 ++-- ui-ngx/src/assets/locale/locale.constant-en_US.json | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/profile/queue/tenant-profile-queues.component.ts b/ui-ngx/src/app/modules/home/components/profile/queue/tenant-profile-queues.component.ts index c3ff3ccc4c..8f510cfbda 100644 --- a/ui-ngx/src/app/modules/home/components/profile/queue/tenant-profile-queues.component.ts +++ b/ui-ngx/src/app/modules/home/components/profile/queue/tenant-profile-queues.component.ts @@ -14,7 +14,7 @@ /// limitations under the License. /// -import { Component, forwardRef, Input, OnDestroy } from '@angular/core'; +import { Component, forwardRef, Input, OnDestroy, OnInit } from '@angular/core'; import { AbstractControl, ControlValueAccessor, @@ -53,7 +53,7 @@ import { takeUntil } from 'rxjs/operators'; } ] }) -export class TenantProfileQueuesComponent implements ControlValueAccessor, Validator, OnDestroy { +export class TenantProfileQueuesComponent implements ControlValueAccessor, Validator, OnInit, OnDestroy { tenantProfileQueuesFormGroup: UntypedFormGroup; newQueue = false; @@ -115,7 +115,7 @@ export class TenantProfileQueuesComponent implements ControlValueAccessor, Valid } writeValue(queues: Array | null): void { - if (queues.length === this.queuesFormArray.length) { + if (queues?.length === this.queuesFormArray.length) { this.queuesFormArray.patchValue(queues, {emitEvent: false}); } else { const queuesControls: Array = []; diff --git a/ui-ngx/src/app/modules/home/components/profile/tenant/default-tenant-profile-configuration.component.html b/ui-ngx/src/app/modules/home/components/profile/tenant/default-tenant-profile-configuration.component.html index 4e287a888c..0edb1b4b47 100644 --- a/ui-ngx/src/app/modules/home/components/profile/tenant/default-tenant-profile-configuration.component.html +++ b/ui-ngx/src/app/modules/home/components/profile/tenant/default-tenant-profile-configuration.component.html @@ -338,10 +338,10 @@ formControlName="maxOtaPackagesInBytes" type="number"> - {{ 'tenant-profile.maximum-ota-packages-sum-data-size-required' | translate}} + {{ 'tenant-profile.maximum-ota-package-sum-data-size-required' | translate}} - {{ 'tenant-profile.maximum-ota-packages-sum-data-size-range' | translate}} + {{ 'tenant-profile.maximum-ota-package-sum-data-size-range' | translate}} diff --git a/ui-ngx/src/app/modules/home/components/queue/queue-form.component.html b/ui-ngx/src/app/modules/home/components/queue/queue-form.component.html index 9fee72fef4..56b20d8aa8 100644 --- a/ui-ngx/src/app/modules/home/components/queue/queue-form.component.html +++ b/ui-ngx/src/app/modules/home/components/queue/queue-form.component.html @@ -37,7 +37,7 @@ -
+
@@ -75,7 +75,7 @@ -
+
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 933462b06b..bcaa4a183f 100644 --- a/ui-ngx/src/assets/locale/locale.constant-en_US.json +++ b/ui-ngx/src/assets/locale/locale.constant-en_US.json @@ -3600,8 +3600,8 @@ "maximum-resources-sum-data-size-required": "Resource files sum size is required.", "maximum-resources-sum-data-size-range": "Resource files sum size can`t be negative", "maximum-ota-packages-sum-data-size": "OTA package files sum size", - "maximum-ota-packages-sum-data-size-required": "OTA package files sum size is required.", - "maximum-ota-packages-sum-data-size-range": "OTA package files sum size can`t be negative", + "maximum-ota-package-sum-data-size-required": "OTA package files sum size is required.", + "maximum-ota-package-sum-data-size-range": "OTA package files sum size can`t be negative", "rest-requests-for-tenant": "REST requests for tenant", "transport-tenant-telemetry-msg-rate-limit": "Transport tenant telemetry messages", "transport-tenant-telemetry-data-points-rate-limit": "Transport tenant telemetry data points",