dont delete skeleton line scopes as it causes toggle to not work

This commit is contained in:
John Mitchell
2017-01-10 11:26:36 -05:00
parent d65e1a5d82
commit d98e4a6cc5

View File

@@ -418,12 +418,20 @@ function(jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTy
// grab non-header recap lines // grab non-header recap lines
toDestroy.push($scope.$watch('job_event_dataset', function(val) { toDestroy.push($scope.$watch('job_event_dataset', function(val) {
eventQueue.initialize(); eventQueue.initialize();
Object.keys($scope.events) Object.keys($scope.events)
.forEach(v => { .forEach(v => {
$scope.events[v].$destroy(); // dont destroy scope events for skeleton lines
$scope.events[v] = null; let name = $scope.events[v].event.name;
if (!(name === "playbook_on_play_start" ||
name === "playbook_on_task_start" ||
name === "playbook_on_stats")) {
$scope.events[v].$destroy();
$scope.events[v] = null;
delete $scope.events[v];
}
}); });
$scope.events = {};
// pause websocket events from coming in to the pane // pause websocket events from coming in to the pane
$scope.gotPreviouslyRanEvents = $q.defer(); $scope.gotPreviouslyRanEvents = $q.defer();
@@ -443,10 +451,9 @@ function(jobData, jobDataOptions, jobLabels, jobFinished, count, $scope, ParseTy
toDestroy.push($scope.$on(`ws-job_events-${$scope.job.id}`, function(e, data) { toDestroy.push($scope.$on(`ws-job_events-${$scope.job.id}`, function(e, data) {
$q.all([$scope.gotPreviouslyRanEvents.promise, $q.all([$scope.gotPreviouslyRanEvents.promise,
$scope.hasSkeleton.promise]).then(() => { $scope.hasSkeleton.promise]).then(() => {
// for header and recap lines, as well as if no filters // put the line in the
// were added by the user, just put the line in the
// standard out pane (and increment play and task // standard out pane (and increment play and task
// count) // count if applicable)
if (data.event_name === "playbook_on_play_start") { if (data.event_name === "playbook_on_play_start") {
$scope.playCount++; $scope.playCount++;
} else if (data.event_name === "playbook_on_task_start") { } else if (data.event_name === "playbook_on_task_start") {