From 55ffe5eded9d8d36a9728f82f893870478d28df7 Mon Sep 17 00:00:00 2001 From: Alexander Zobnin Date: Thu, 8 Aug 2019 12:34:21 +0300 Subject: [PATCH] Problems: fix heart icons, fix #754 --- .../components/AlertList/AlertIcon.tsx | 8 ++------ src/panel-triggers/components/GFHeartIcon.tsx | 3 +-- src/panel-triggers/triggers_panel_ctrl.js | 12 ++++-------- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/src/panel-triggers/components/AlertList/AlertIcon.tsx b/src/panel-triggers/components/AlertList/AlertIcon.tsx index 0ecf6df..2b69d31 100644 --- a/src/panel-triggers/components/AlertList/AlertIcon.tsx +++ b/src/panel-triggers/components/AlertList/AlertIcon.tsx @@ -13,12 +13,8 @@ export default function AlertIcon(props: AlertIconProps) { const { problem, color, blink, highlightBackground } = props; const priority = Number(problem.priority); let iconClass = ''; - if (problem.value === '1') { - if (priority >= 3) { - iconClass = 'icon-gf-critical'; - } else { - iconClass = 'icon-gf-warning'; - } + if (problem.value === '1' && priority >= 2) { + iconClass = 'icon-gf-critical'; } else { iconClass = 'icon-gf-online'; } diff --git a/src/panel-triggers/components/GFHeartIcon.tsx b/src/panel-triggers/components/GFHeartIcon.tsx index 24bcc86..23c1826 100644 --- a/src/panel-triggers/components/GFHeartIcon.tsx +++ b/src/panel-triggers/components/GFHeartIcon.tsx @@ -9,8 +9,7 @@ interface GFHeartIconProps { export default function GFHeartIcon(props: GFHeartIconProps) { const status = props.status; const className = classNames("icon-gf", props.className, - { "icon-gf-critical": status === 'critical' || status === 'problem' }, - { "icon-gf-warning": status === 'warning' }, + { "icon-gf-critical": status === 'critical' || status === 'problem' || status === 'warning'}, { "icon-gf-online": status === 'online' || status === 'ok' }, ); return ( diff --git a/src/panel-triggers/triggers_panel_ctrl.js b/src/panel-triggers/triggers_panel_ctrl.js index d0d0ab8..d8d8247 100644 --- a/src/panel-triggers/triggers_panel_ctrl.js +++ b/src/panel-triggers/triggers_panel_ctrl.js @@ -557,12 +557,8 @@ export class TriggerPanelCtrl extends PanelCtrl { getAlertIconClass(trigger) { let iconClass = ''; - if (trigger.value === '1') { - if (trigger.priority >= 3) { - iconClass = 'icon-gf-critical'; - } else { - iconClass = 'icon-gf-warning'; - } + if (trigger.value === '1' && trigger.priority >= 2) { + iconClass = 'icon-gf-critical'; } else { iconClass = 'icon-gf-online'; } @@ -574,8 +570,8 @@ export class TriggerPanelCtrl extends PanelCtrl { } getAlertIconClassBySeverity(triggerSeverity) { - let iconClass = 'icon-gf-warning'; - if (triggerSeverity.priority >= 3) { + let iconClass = 'icon-gf-online'; + if (triggerSeverity.priority >= 2) { iconClass = 'icon-gf-critical'; } return iconClass;