Browse Source
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
pull/4190/head
Igor Kulikov
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
9 additions and
1 deletions
-
ui-ngx/src/app/core/api/widget-subscription.ts
|
|
|
@ -467,7 +467,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; |
|
|
|
|