-
Notifications
You must be signed in to change notification settings - Fork 462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix event severity change #872
fix event severity change #872
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contribution! Looks good, just little fix required.
|
||
let severityDesc: TriggerSeverity; | ||
severityDesc = _.find(panelOptions.triggerSeverity, s => s.priority === Number(problem.priority)); | ||
if (problem.lastEvent.severity) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to check if lastEvent
not empty also:
if (problem.lastEvent.severity) { | |
if (problem.lastEvent && problem.lastEvent.severity) { |
|
||
let severityDesc: TriggerSeverity; | ||
severityDesc = _.find(problemSeverityDesc, s => s.priority === Number(props.original.priority)); | ||
if (problem.lastEvent.severity) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same as above.
@@ -398,7 +398,12 @@ export class TriggerPanelCtrl extends PanelCtrl { | |||
|
|||
// Filter triggers by severity | |||
triggerList = _.filter(triggerList, trigger => { | |||
return this.panel.triggerSeverity[trigger.priority].show; | |||
//return this.panel.triggerSeverity[trigger.priority].show; | |||
if (trigger.lastEvent.severity) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same
if (trigger.lastEvent.severity) { | |
if (trigger.lastEvent && trigger.lastEvent.severity) { |
@@ -398,7 +398,12 @@ export class TriggerPanelCtrl extends PanelCtrl { | |||
|
|||
// Filter triggers by severity | |||
triggerList = _.filter(triggerList, trigger => { | |||
return this.panel.triggerSeverity[trigger.priority].show; | |||
//return this.panel.triggerSeverity[trigger.priority].show; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be removed
//return this.panel.triggerSeverity[trigger.priority].show; |
@memfiz could you fix comments above? |
Fixed. |
@memfiz I mean |
Yes, my fault. Another try... |
This PR closes #870.
Not sure about the code style. It works in my production, but I'm not an expert in typescript/javascript.