From b6488d8b2d4a6cb5a472fb796e534ad023d12448 Mon Sep 17 00:00:00 2001 From: Chantsova Ekaterina Date: Tue, 16 Feb 2021 17:42:16 +0200 Subject: [PATCH] Add entity info for single-entity aliases even if no alarms to display --- ui-ngx/src/app/core/api/widget-subscription.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ui-ngx/src/app/core/api/widget-subscription.ts b/ui-ngx/src/app/core/api/widget-subscription.ts index 3e3537941b..c1bf3da44c 100644 --- a/ui-ngx/src/app/core/api/widget-subscription.ts +++ b/ui-ngx/src/app/core/api/widget-subscription.ts @@ -465,7 +465,15 @@ export class WidgetSubscription implements IWidgetSubscription { entityName = this.targetDeviceName; } } else if (this.type === widgetType.alarm) { - if (this.alarms && this.alarms.data.length) { + if (this.alarmSource && this.alarmSource.entityType && this.alarmSource.entityId) { + entityId = { + entityType: this.alarmSource.entityType, + id: this.alarmSource.entityId + }; + entityName = this.alarmSource.entityName; + entityLabel = this.alarmSource.entityLabel; + entityDescription = this.alarmSource.entityDescription; + } else if (this.alarms && this.alarms.data.length) { const data = this.alarms.data[0]; entityId = data.originator; entityName = data.originatorName;