mirror of
https://github.com/ansible/awx.git
synced 2026-05-06 17:07:36 -02:30
updated of stdout sections to include event
This commit is contained in:
@@ -96,6 +96,8 @@ export default ['jobData', 'jobDataOptions', 'jobLabels', 'jobFinished', 'count'
|
|||||||
$scope.followTooltip = "Currently following standard out as it comes in. Click to unfollow.";
|
$scope.followTooltip = "Currently following standard out as it comes in. Click to unfollow.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$scope.events = {};
|
||||||
|
|
||||||
// EVENT STUFF BELOW
|
// EVENT STUFF BELOW
|
||||||
|
|
||||||
// This is where the async updates to the UI actually happen.
|
// This is where the async updates to the UI actually happen.
|
||||||
@@ -145,10 +147,21 @@ export default ['jobData', 'jobDataOptions', 'jobLabels', 'jobFinished', 'count'
|
|||||||
|
|
||||||
if(change === 'stdout'){
|
if(change === 'stdout'){
|
||||||
// put stdout elements in stdout container
|
// put stdout elements in stdout container
|
||||||
|
|
||||||
|
// this scopes the event to that particular
|
||||||
|
// block of stdout.
|
||||||
|
// If you need to see the event a particular
|
||||||
|
// stdout block is from, you can:
|
||||||
|
// angular.element($0).scope().event
|
||||||
|
$scope.events[mungedEvent.counter] = $scope.$new();
|
||||||
|
$scope.events[mungedEvent.counter]
|
||||||
|
.event = mungedEvent;
|
||||||
|
|
||||||
angular
|
angular
|
||||||
.element(".JobResultsStdOut-stdoutContainer")
|
.element(".JobResultsStdOut-stdoutContainer")
|
||||||
.append($compile(mungedEvent
|
.append($compile(mungedEvent
|
||||||
.stdout)($scope));
|
.stdout)($scope.events[mungedEvent
|
||||||
|
.counter]));
|
||||||
|
|
||||||
// move the followAnchor to the bottom of the
|
// move the followAnchor to the bottom of the
|
||||||
// container
|
// container
|
||||||
@@ -158,6 +171,11 @@ export default ['jobData', 'jobDataOptions', 'jobLabels', 'jobFinished', 'count'
|
|||||||
// if follow is engaged,
|
// if follow is engaged,
|
||||||
// scroll down to the followAnchor
|
// scroll down to the followAnchor
|
||||||
if ($scope.followEngaged) {
|
if ($scope.followEngaged) {
|
||||||
|
if (!$scope.followScroll) {
|
||||||
|
$scope.followScroll = function() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
$scope.followScroll();
|
$scope.followScroll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ describe('Controller: jobResultsController', () => {
|
|||||||
'populate',
|
'populate',
|
||||||
'markProcessed'
|
'markProcessed'
|
||||||
]);
|
]);
|
||||||
$compile = jasmine.createSpy('$compile');
|
|
||||||
|
|
||||||
$provide.value('jobData', jobData);
|
$provide.value('jobData', jobData);
|
||||||
$provide.value('jobDataOptions', jobDataOptions);
|
$provide.value('jobDataOptions', jobDataOptions);
|
||||||
@@ -50,7 +49,6 @@ describe('Controller: jobResultsController', () => {
|
|||||||
$provide.value('ParseVariableString', ParseVariableString);
|
$provide.value('ParseVariableString', ParseVariableString);
|
||||||
$provide.value('jobResultsService', jobResultsService);
|
$provide.value('jobResultsService', jobResultsService);
|
||||||
$provide.value('eventQueue', eventQueue);
|
$provide.value('eventQueue', eventQueue);
|
||||||
$provide.value('$compile', $compile);
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -554,6 +552,25 @@ describe('Controller: jobResultsController', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO: stdout change tests
|
describe('populate - stdout', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
|
||||||
|
populateResolve = {
|
||||||
|
counter: 12,
|
||||||
|
stdout: "line",
|
||||||
|
changes: ['stdout']
|
||||||
|
};
|
||||||
|
|
||||||
|
bootstrapTest();
|
||||||
|
|
||||||
|
$scope.followEngaged = true;
|
||||||
|
|
||||||
|
$scope.$apply();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('creates new child scope for the event', () => {
|
||||||
|
expect($scope.events[12].event).toBe(populateResolve);
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user