Merge pull request #8269 from ChantsovaEkaterina/improvement/originator-label-in-alarm-widget-actions
Add originator label in alarm widget actions
This commit is contained in:
commit
97b16ea6fd
@ -582,12 +582,9 @@ export class WidgetSubscription implements IWidgetSubscription {
|
|||||||
const data = this.alarms.data[0];
|
const data = this.alarms.data[0];
|
||||||
entityId = data.originator;
|
entityId = data.originator;
|
||||||
entityName = data.originatorName;
|
entityName = data.originatorName;
|
||||||
|
entityLabel = data.originatorLabel;
|
||||||
if (data.latest && data.latest[EntityKeyType.ENTITY_FIELD]) {
|
if (data.latest && data.latest[EntityKeyType.ENTITY_FIELD]) {
|
||||||
const entityFields = 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;
|
const additionalInfoValue = entityFields.additionalInfo;
|
||||||
if (additionalInfoValue) {
|
if (additionalInfoValue) {
|
||||||
const additionalInfo = additionalInfoValue.value;
|
const additionalInfo = additionalInfoValue.value;
|
||||||
|
|||||||
@ -804,11 +804,13 @@ export class AlarmsTableWidgetComponent extends PageComponent implements OnInit,
|
|||||||
if (descriptors.length) {
|
if (descriptors.length) {
|
||||||
let entityId;
|
let entityId;
|
||||||
let entityName;
|
let entityName;
|
||||||
|
let entityLabel;
|
||||||
if (alarm && alarm.originator) {
|
if (alarm && alarm.originator) {
|
||||||
entityId = alarm.originator;
|
entityId = alarm.originator;
|
||||||
entityName = alarm.originatorName;
|
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 entityId;
|
||||||
let entityName;
|
let entityName;
|
||||||
|
let entityLabel;
|
||||||
if (alarm && alarm.originator) {
|
if (alarm && alarm.originator) {
|
||||||
entityId = alarm.originator;
|
entityId = alarm.originator;
|
||||||
entityName = alarm.originatorName;
|
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…
x
Reference in New Issue
Block a user