fix event severity change (#872)

* fixed panel trigger severity if it is changed in event

* fixed panel trigger severity if it is changed in event

* fixed lastEvent check

* removed a comment

* fixed lastEvent check not empty
This commit is contained in:
memfiz
2020-01-24 15:39:15 +02:00
committed by Alexander Zobnin
parent 5b211d80a9
commit 94c5059fb1
4 changed files with 21 additions and 4 deletions

View File

@@ -179,7 +179,13 @@ export default class ProblemList extends PureComponent<ProblemListProps, Problem
function SeverityCell(props: RTCell<ZBXTrigger>, problemSeverityDesc: TriggerSeverity[], markAckEvents?: boolean, ackEventColor?: string) {
const problem = props.original;
let color: string;
const severityDesc = _.find(problemSeverityDesc, s => s.priority === Number(props.original.priority));
let severityDesc: TriggerSeverity;
severityDesc = _.find(problemSeverityDesc, s => s.priority === Number(props.original.priority));
if (problem.lastEvent && problem.lastEvent.severity) {
severityDesc = _.find(problemSeverityDesc, s => s.priority === Number(problem.lastEvent.severity));
}
color = severityDesc.color;
// Mark acknowledged triggers with different color