Skip to content

Commit

Permalink
GP-44570 Fix taskRunner UI styling for task errors
Browse files Browse the repository at this point in the history
  • Loading branch information
pfigel committed Sep 4, 2024
1 parent 8238def commit cca13e1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion ang/taskRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,13 @@
"Task execution",
"error"
);
$scope.errors.push(new Error("Task execution encountered errors. See execution logs for more details"));
$scope.state = "error";
} else {
CRM.alert("Task execution completed", "Task execution", "success");
$scope.state = "done";
}

$scope.state = "done";
$scope.logs = taskExecResult.values.logs;
$scope.runButtonLabel = "Run again";
$scope.$apply();
Expand Down Expand Up @@ -154,6 +156,9 @@

if ($scope.state === "done") {
if (execution.error_count > 0) {
$scope.state = "error";
$scope.errors.push(new Error("Task execution encountered errors. See execution logs for more details"));
$scope.$apply();
CRM.alert(
"Task execution encountered errors. See execution logs for more details",
"Task execution",
Expand Down
3 changes: 2 additions & 1 deletion ang/taskRunner/taskRunner.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ <h1 crm-page-title>{{ts('Run SQL task:')}} {{task.name}}</h1>
</div>

<div class="str__errors crm-error" ng-if="state === 'error'">
<ul>
<span ng-if="errors.length == 1">{{errors[0].message}}</span>
<ul ng-if="errors.length > 1">
<li ng-repeat="error in errors">{{error.message}}</li>
</ul>
</div>
Expand Down

0 comments on commit cca13e1

Please sign in to comment.