From 6e1b343f504ba91d7e98dd557fe2f135444e4177 Mon Sep 17 00:00:00 2001 From: Vladyslav_Prykhodko Date: Thu, 30 Jul 2020 11:38:38 +0300 Subject: [PATCH] Alarm widget fix show the incorrect value from alarm details --- .../components/widget/lib/alarms-table-widget.component.ts | 4 +++- .../modules/home/components/widget/lib/table-widget.models.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/alarms-table-widget.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/alarms-table-widget.component.ts index c88d23fa10..c79a115f4b 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/alarms-table-widget.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/alarms-table-widget.component.ts @@ -376,6 +376,8 @@ export class AlarmsTableWidgetComponent extends PageComponent implements OnInit, } this.stylesInfo[dataKey.def] = getCellStyleInfo(keySettings); this.contentsInfo[dataKey.def] = getCellContentInfo(keySettings, 'value, alarm, ctx'); + this.contentsInfo[dataKey.def].units = dataKey.units; + this.contentsInfo[dataKey.def].decimals = dataKey.decimals; this.columnWidth[dataKey.def] = getColumnWidth(keySettings); this.columns.push(dataKey); @@ -932,7 +934,7 @@ class AlarmsDatasource implements DataSource { } } } - alarm[dataKey.label] = value; + alarm[dataKey.name] = value; }); return alarm; } diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/table-widget.models.ts b/ui-ngx/src/app/modules/home/components/widget/lib/table-widget.models.ts index 1ab9ea6fc4..9e079bc247 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/table-widget.models.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/table-widget.models.ts @@ -189,7 +189,7 @@ export function getAlarmValue(alarm: AlarmDataInfo, key: EntityColumn) { if (alarmField) { return getDescendantProp(alarm, alarmField.value); } else { - return getDescendantProp(alarm, key.label); + return getDescendantProp(alarm, key.name); } }