You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2022/10/21 13:58:25 UTC
[brooklyn-ui] 16/24: minor fixes for workflow arrows and indicators
This is an automated email from the ASF dual-hosted git repository.
heneveld pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-ui.git
commit afd62cf2fc787af1267931e106aaae66aaf36aee
Author: Alex Heneveld <al...@cloudsoft.io>
AuthorDate: Mon Oct 10 11:57:14 2022 +0100
minor fixes for workflow arrows and indicators
---
.../components/workflow/workflow-step.directive.js | 8 +++++++
.../workflow/workflow-step.template.html | 26 ++++++++--------------
.../workflow/workflow-steps.directive.js | 6 ++++-
3 files changed, 22 insertions(+), 18 deletions(-)
diff --git a/ui-modules/app-inspector/app/components/workflow/workflow-step.directive.js b/ui-modules/app-inspector/app/components/workflow/workflow-step.directive.js
index 7d6bb40c..dadf25a7 100644
--- a/ui-modules/app-inspector/app/components/workflow/workflow-step.directive.js
+++ b/ui-modules/app-inspector/app/components/workflow/workflow-step.directive.js
@@ -114,6 +114,14 @@ export function workflowStepDirective() {
$scope.isFocusStep = $scope.workflow.tag && ($scope.workflow.tag.stepIndex === index);
$scope.isFocusTask = false;
+ $scope.stepCurrentError = (($scope.task || {}).currentStatus === 'Error') ? 'This step returned an error.'
+ : ($scope.isWorkflowError && $scope.isCurrentMaybeInactive) ? 'The workflow encountered an error around this step.'
+ : null;
+ const incomplete = $scope.osi.countStarted - $scope.osi.countCompleted > ($scope.isCurrentAndActive ? 1 : 0);
+ $scope.stepCurrentWarning = incomplete ? 'This step has previously been interrupted.' : null;
+ $scope.stepCurrentSuccess = (!$scope.isCurrentAndActive && !incomplete && $scope.osi.countCompleted > 0)
+ ? 'This step has completed without errors.' : null;
+
if ($scope.task) {
if (!vm.isNullish($scope.stepContext.taskId) && $scope.stepContext.taskId === $scope.task.id) {
$scope.isFocusTask = true;
diff --git a/ui-modules/app-inspector/app/components/workflow/workflow-step.template.html b/ui-modules/app-inspector/app/components/workflow/workflow-step.template.html
index 57cb6d71..5ec2a31c 100644
--- a/ui-modules/app-inspector/app/components/workflow/workflow-step.template.html
+++ b/ui-modules/app-inspector/app/components/workflow/workflow-step.template.html
@@ -19,25 +19,17 @@
<div class="workflow-step-outer">
<div class="workflow-step-status-indicators">
- <span ng-if="isCurrentAndActive">
- <span ng-if="isRunning" class="running-status">
- <brooklyn-status-icon value="STARTING"></brooklyn-status-icon>
- </span>
+ <span ng-if="isCurrentAndActive" class="running-status">
+ <brooklyn-status-icon value="STARTING"></brooklyn-status-icon>
</span>
-
- <span ng-if="osi.countCompleted && osi.countStarted === osi.countStarted">
- <span class="color-succeeded">
- <i class="fa fa-check-circle"></i>
- </span>
-<!-- <span ng-if="osi.countCompleted > 1">{{ osi.countCompleted }}</span>-->
+ <span ng-if="stepCurrentSuccess" class="color-succeeded" title="{{ stepCurrentSuccess }}">
+ <i class="fa fa-check-circle"></i>
+ </span>
+ <span ng-if="stepCurrentWarning" class="color-cancelled" title="{{ stepCurrentWarning }}">
+ <i class="fa fa-exclamation-circle"></i>
</span>
- <span ng-if="osi.countStarted && osi.countStarted != osi.countCompleted && !isCurrentAndActive">
- <span class="color-failed" ng-if="isWorkflowError">
- <i class="fa fa-times-circle"></i>
- </span>
- <span class="color-cancelled" ng-if="!isWorkflowError">
- <i class="fa fa-exclamation-circle"></i>
- </span>
+ <span ng-if="stepCurrentError" class="color-failed" title="{{ stepCurrentError }}">
+ <i class="fa fa-times-circle"></i>
</span>
</div>
diff --git a/ui-modules/app-inspector/app/components/workflow/workflow-steps.directive.js b/ui-modules/app-inspector/app/components/workflow/workflow-steps.directive.js
index 32ca366e..c808f1f8 100644
--- a/ui-modules/app-inspector/app/components/workflow/workflow-steps.directive.js
+++ b/ui-modules/app-inspector/app/components/workflow/workflow-steps.directive.js
@@ -222,7 +222,11 @@ function makeArrows(workflow, steps) {
if (to!=-1 && from!=-1 && to!=from) {
jumpSizes[Math.abs(from-to)] = true;
}
- arrowSpecs[[from,to]] = { from, to, ...(opts||{}) };
+ if (arrowSpecs[[from,to]]) {
+ // prefer earlier additions (real steps) over theoretical ones
+ } else {
+ arrowSpecs[[from, to]] = {from, to, ...(opts || {})};
+ }
}
for (var i = -1; i < steps.length - 1; i++) {