Browse Source

UI: Add originator label in alarm widget actions

pull/8269/head
Chantsova Ekaterina 3 years ago
parent
commit
09bae92b86
  1. 5
      ui-ngx/src/app/core/api/widget-subscription.ts
  2. 8
      ui-ngx/src/app/modules/home/components/widget/lib/alarms-table-widget.component.ts

5
ui-ngx/src/app/core/api/widget-subscription.ts

@ -582,12 +582,9 @@ export class WidgetSubscription implements IWidgetSubscription {
const data = this.alarms.data[0];
entityId = data.originator;
entityName = data.originatorName;
entityLabel = data.originatorLabel;
if (data.latest && data.latest[EntityKeyType.ENTITY_FIELD]) {
const entityFields = data.latest[EntityKeyType.ENTITY_FIELD];
const labelValue = entityFields.label;
if (labelValue) {
entityLabel = labelValue.value;
}
const additionalInfoValue = entityFields.additionalInfo;
if (additionalInfoValue) {
const additionalInfo = additionalInfoValue.value;

8
ui-ngx/src/app/modules/home/components/widget/lib/alarms-table-widget.component.ts

@ -804,11 +804,13 @@ export class AlarmsTableWidgetComponent extends PageComponent implements OnInit,
if (descriptors.length) {
let entityId;
let entityName;
let entityLabel;
if (alarm && alarm.originator) {
entityId = alarm.originator;
entityName = alarm.originatorName;
entityLabel = alarm.originatorLabel;
}
this.ctx.actionsApi.handleWidgetAction($event, descriptors[0], entityId, entityName, {alarm});
this.ctx.actionsApi.handleWidgetAction($event, descriptors[0], entityId, entityName, {alarm}, entityLabel);
}
}
@ -827,11 +829,13 @@ export class AlarmsTableWidgetComponent extends PageComponent implements OnInit,
}
let entityId;
let entityName;
let entityLabel;
if (alarm && alarm.originator) {
entityId = alarm.originator;
entityName = alarm.originatorName;
entityLabel = alarm.originatorLabel;
}
this.ctx.actionsApi.handleWidgetAction($event, actionDescriptor, entityId, entityName, {alarm});
this.ctx.actionsApi.handleWidgetAction($event, actionDescriptor, entityId, entityName, {alarm}, entityLabel);
}
}

Loading…
Cancel
Save