1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00

Merge pull request #4631 from wenottingham/stop-me-before-i-touch-javascript-again

Fix fetching of result traceback in job details.

Reviewed-by: Jake McDermott <yo@jakemcdermott.me>
             https://github.com/jakemcdermott
This commit is contained in:
softwarefactory-project-zuul[bot] 2019-08-30 22:01:38 +00:00 committed by GitHub
commit 09c105e125
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 3 deletions

View File

@ -442,8 +442,8 @@ function getJobExplanationDetails () {
return { label, less, more, showMore, hasMoreToShow };
}
function getResultTracebackDetails () {
const traceback = resource.model.get('result_traceback');
function getResultTracebackDetails (resultTraceback) {
const traceback = resultTraceback || resource.model.get('result_traceback');
if (!traceback) {
return null;
@ -871,7 +871,8 @@ function JobDetailsController (
instanceGroup,
environment,
artifacts,
executionNode
executionNode,
resultTraceback
}) => {
vm.started = getStartDetails(started);
vm.finished = getFinishDetails(finished);
@ -883,6 +884,7 @@ function JobDetailsController (
vm.artifacts = getArtifactsDetails(artifacts);
vm.executionNode = getExecutionNodeDetails(executionNode);
vm.inventoryScm = getInventoryScmDetails(inventoryScm.id, inventoryScm.status);
vm.resultTraceback = getResultTracebackDetails(resultTraceback);
vm.scmRevision = getSCMRevisionDetails(scmRevision);
vm.instanceGroup = getInstanceGroupDetails(instanceGroup);
vm.status = getStatusDetails(status);

View File

@ -303,6 +303,12 @@ function JobStatusService (moment, message) {
this.statsEvent = data;
};
this.setResultTraceback = traceback => {
if (!traceback) return;
this.state.resultTraceback = traceback;
};
this.setHostStatusCounts = counts => {
counts = counts || {};
@ -341,6 +347,7 @@ function JobStatusService (moment, message) {
this.setEnvironment(model.get('custom_virtualenv'));
this.setArtifacts(model.get('artifacts'));
this.setExecutionNode(model.get('execution_node'));
this.setResultTraceback(model.get('result_traceback'));
this.initHostStatusCounts({ model });
this.initPlaybookCounts({ model });