From fc9e4c167b401e876df3029316746b5645918fcf Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 21 Feb 2024 17:10:52 +0100 Subject: [PATCH] Fix that handled nodes are not handled --- library/Businessprocess/BpNode.php | 2 +- library/Businessprocess/Node.php | 2 +- library/Businessprocess/Web/Component/BpDashboardTile.php | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/library/Businessprocess/BpNode.php b/library/Businessprocess/BpNode.php index ab76e3e7..7dfbcf94 100644 --- a/library/Businessprocess/BpNode.php +++ b/library/Businessprocess/BpNode.php @@ -105,7 +105,7 @@ public function hasProblems() return true; } - $okStates = array('OK', 'UP', 'PENDING', 'MISSING'); + $okStates = ['OK', 'UP', 'PENDING', 'MISSING', 'CRITICAL-HANDLED', 'WARNING-HANDLED', 'UNKNOWN-HANDLED']; foreach ($this->getStateSummary() as $state => $cnt) { if ($cnt !== 0 && ! in_array($state, $okStates)) { diff --git a/library/Businessprocess/Node.php b/library/Businessprocess/Node.php index a0c07d26..3573d3f2 100644 --- a/library/Businessprocess/Node.php +++ b/library/Businessprocess/Node.php @@ -163,7 +163,7 @@ public function setMissing($missing = true) public function isProblem() { - return $this->getState() > 0; + return $this->getState() > 0 && ! $this->isHandled(); } public function hasBeenChanged() diff --git a/library/Businessprocess/Web/Component/BpDashboardTile.php b/library/Businessprocess/Web/Component/BpDashboardTile.php index 9a4a0f64..6a1e9884 100644 --- a/library/Businessprocess/Web/Component/BpDashboardTile.php +++ b/library/Businessprocess/Web/Component/BpDashboardTile.php @@ -30,6 +30,9 @@ public function __construct(BpConfig $bp, $title, $description, $icon, $url, $ur foreach ($bp->getChildren() as $node) { $state = strtolower($node->getStateName()); + if ($node->isHandled()) { + $state .= ' handled'; + } $tiles->add(Html::tag( 'a',