Commit 588253daa4375ffce2ea9d62bb9c37c603fc507e

Authored by Igor Kulikov
Committed by GitHub
2 parents 961455b4 b6488d8b

Merge pull request #4113 from ChantsovaEkaterina/improvement/get-alarm-first-entity-info

Get first entity info: add alarm entity info for single-entity aliases even if no alarms to display
... ... @@ -467,7 +467,15 @@ export class WidgetSubscription implements IWidgetSubscription {
467 467 entityName = this.targetDeviceName;
468 468 }
469 469 } else if (this.type === widgetType.alarm) {
470   - if (this.alarms && this.alarms.data.length) {
  470 + if (this.alarmSource && this.alarmSource.entityType && this.alarmSource.entityId) {
  471 + entityId = {
  472 + entityType: this.alarmSource.entityType,
  473 + id: this.alarmSource.entityId
  474 + };
  475 + entityName = this.alarmSource.entityName;
  476 + entityLabel = this.alarmSource.entityLabel;
  477 + entityDescription = this.alarmSource.entityDescription;
  478 + } else if (this.alarms && this.alarms.data.length) {
471 479 const data = this.alarms.data[0];
472 480 entityId = data.originator;
473 481 entityName = data.originatorName;
... ...