Skip to content

Commit cca13e1

Browse files
committed
GP-44570 Fix taskRunner UI styling for task errors
1 parent 8238def commit cca13e1

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

ang/taskRunner.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,13 @@
113113
"Task execution",
114114
"error"
115115
);
116+
$scope.errors.push(new Error("Task execution encountered errors. See execution logs for more details"));
117+
$scope.state = "error";
116118
} else {
117119
CRM.alert("Task execution completed", "Task execution", "success");
120+
$scope.state = "done";
118121
}
119122

120-
$scope.state = "done";
121123
$scope.logs = taskExecResult.values.logs;
122124
$scope.runButtonLabel = "Run again";
123125
$scope.$apply();
@@ -154,6 +156,9 @@
154156

155157
if ($scope.state === "done") {
156158
if (execution.error_count > 0) {
159+
$scope.state = "error";
160+
$scope.errors.push(new Error("Task execution encountered errors. See execution logs for more details"));
161+
$scope.$apply();
157162
CRM.alert(
158163
"Task execution encountered errors. See execution logs for more details",
159164
"Task execution",

ang/taskRunner/taskRunner.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ <h1 crm-page-title>{{ts('Run SQL task:')}} {{task.name}}</h1>
2525
</div>
2626

2727
<div class="str__errors crm-error" ng-if="state === 'error'">
28-
<ul>
28+
<span ng-if="errors.length == 1">{{errors[0].message}}</span>
29+
<ul ng-if="errors.length > 1">
2930
<li ng-repeat="error in errors">{{error.message}}</li>
3031
</ul>
3132
</div>

0 commit comments

Comments
 (0)