From aaba2fb884cbf5e8877dc1932279cca01e0cd1ba Mon Sep 17 00:00:00 2001 From: Ravi Kumar Kempapura Srinivasa Date: Mon, 25 May 2020 12:07:55 +0200 Subject: [PATCH 1/3] Introduce state-balls for critical/down-handled nodes Earlier we did not have different state-balls for critical/down-handled nodes. They were assigned critical/down state-balls. Now, we are introducing new state-balls for these nodes. --- public/css/state-ball.less | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/public/css/state-ball.less b/public/css/state-ball.less index bc050595..98245778 100644 --- a/public/css/state-ball.less +++ b/public/css/state-ball.less @@ -30,6 +30,14 @@ background-color: @gray-light; } + &.state-critical-handled { + background-color: @color-critical-handled; + } + + &.state-down-handled { + background-color: @color-critical-handled; + } + &.size-xs { line-height: 0.75em; height: 0.75em; From b3686906a51ce56bbf5b20d1739c8260ed6dc96c Mon Sep 17 00:00:00 2001 From: Ravi Kumar Kempapura Srinivasa Date: Mon, 25 May 2020 12:12:29 +0200 Subject: [PATCH 2/3] Use the correct state-balls for critical/down-handled nodes in NodeTile::render() Use the state-balls that are added for critical/down-handled nodes in NodeTile::render(), in case the nodes are critical/down and handled. --- .../Businessprocess/Renderer/TileRenderer/NodeTile.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/library/Businessprocess/Renderer/TileRenderer/NodeTile.php b/library/Businessprocess/Renderer/TileRenderer/NodeTile.php index b3937240..8c16ed58 100644 --- a/library/Businessprocess/Renderer/TileRenderer/NodeTile.php +++ b/library/Businessprocess/Renderer/TileRenderer/NodeTile.php @@ -88,10 +88,14 @@ public function render() if (! $node instanceof ImportedNode || $node->getBpConfig()->hasNode($node->getName())) { $link = $this->getMainNodeLink(); if ($renderer->isBreadcrumb()) { - $link->prepend((new StateBall(strtolower($node->getStateName())))->addAttributes([ + $state = strtolower($node->getStateName()); + if ($node->isHandled()) { + $state = $state . '-handled'; + } + $link->prepend((new StateBall($state))->addAttributes([ 'title' => sprintf( '%s %s', - $node->getStateName(), + $state, DateFormatter::timeSince($node->getLastStateChange()) ) ])); From 49bc0dd363ee3bee3f95c5d905389620ddf9a929 Mon Sep 17 00:00:00 2001 From: Ravi Kumar Kempapura Srinivasa Date: Mon, 25 May 2020 12:18:59 +0200 Subject: [PATCH 3/3] Use the correct state-balls for critical/down-handled nodes in TreeRenderer::render() Use the state-balls that are added for critical/down-handled nodes in TreeRenderer::render(), in case the nodes are critical/down and handled. --- library/Businessprocess/Renderer/TreeRenderer.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/library/Businessprocess/Renderer/TreeRenderer.php b/library/Businessprocess/Renderer/TreeRenderer.php index 8cfed61a..9322c261 100644 --- a/library/Businessprocess/Renderer/TreeRenderer.php +++ b/library/Businessprocess/Renderer/TreeRenderer.php @@ -116,10 +116,14 @@ public function getNodeIcons(Node $node, array $path = null) } else { $icons[] = $node->getIcon(); } - $icons[] = (new StateBall(strtolower($node->getStateName())))->addAttributes([ + $state = strtolower($node->getStateName()); + if ($node->isHandled()) { + $state = $state . '-handled'; + } + $icons[] = (new StateBall($state))->addAttributes([ 'title' => sprintf( '%s %s', - $node->getStateName(), + $state, DateFormatter::timeSince($node->getLastStateChange()) ) ]);