From b206061e602f8cbb699bb4835588bf4604350112 Mon Sep 17 00:00:00 2001 From: Dmitriymush Date: Tue, 31 Oct 2023 13:35:56 +0200 Subject: [PATCH] UI: bug-fix to tables basic settings columns error appearence --- .../basic/alarm/alarms-table-basic-config.component.html | 1 + ui-ngx/src/app/shared/components/tb-error.component.ts | 6 +++++- ui-ngx/src/assets/locale/locale.constant-en_US.json | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ui-ngx/src/app/modules/home/components/widget/config/basic/alarm/alarms-table-basic-config.component.html b/ui-ngx/src/app/modules/home/components/widget/config/basic/alarm/alarms-table-basic-config.component.html index 860072fbbd..c2e8de37c4 100644 --- a/ui-ngx/src/app/modules/home/components/widget/config/basic/alarm/alarms-table-basic-config.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/config/basic/alarm/alarms-table-basic-config.component.html @@ -40,6 +40,7 @@ keySettingsTitle="{{ 'widgets.table.column-settings' | translate }}" removeKeyTitle="{{ 'widgets.table.remove-column' | translate }}" noKeysText="{{ 'widgets.table.no-columns' | translate }}" + requiredKeysText="{{ 'widgets.table.alarm-column-error' | translate }}" hideDataKeyColor hideUnits hideDecimals diff --git a/ui-ngx/src/app/shared/components/tb-error.component.ts b/ui-ngx/src/app/shared/components/tb-error.component.ts index 5ddd2d7896..3cd842ee6a 100644 --- a/ui-ngx/src/app/shared/components/tb-error.component.ts +++ b/ui-ngx/src/app/shared/components/tb-error.component.ts @@ -14,7 +14,7 @@ /// limitations under the License. /// -import { Component, Input } from '@angular/core'; +import { ChangeDetectorRef, Component, Input } from '@angular/core'; import { animate, state, style, transition, trigger } from '@angular/animations'; import { coerceBoolean } from '@shared/decorators/coercion'; @@ -61,12 +61,16 @@ export class TbErrorComponent { if (value && !this.message) { this.message = value; this.state = 'hide'; + setTimeout(() => { this.state = 'show'; + this.cd.markForCheck(); }); } else { this.errorValue = value; this.state = value ? 'show' : 'hide'; } } + + constructor(private cd: ChangeDetectorRef) {} } 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 f5c09ce75f..efb94c7782 100644 --- a/ui-ngx/src/assets/locale/locale.constant-en_US.json +++ b/ui-ngx/src/assets/locale/locale.constant-en_US.json @@ -6193,6 +6193,7 @@ "pagination": "Pagination", "rows": "Rows", "timeseries-column-error": "At least one timeseries column should be specified", + "alarm-column-error": "At least one alarm column should be specified", "table-tabs": "Table tabs", "show-cell-actions-menu-mobile": "Show cell actions dropdown menu in mobile mode" },