mirror of
https://github.com/ansible/awx.git
synced 2026-03-06 19:21:06 -03:30
Fixes split job inside workflow details link bug
This commit is contained in:
@@ -764,7 +764,7 @@ export default ['$state','moment', '$timeout', '$window', '$filter', 'Rest', 'Ge
|
||||
});
|
||||
|
||||
baseSvg.selectAll(".WorkflowChart-detailsLink")
|
||||
.style("display", function(d){ return d.job && d.job.status && d.job.id ? null : "none"; })
|
||||
.style("display", function(d){ return d.job && d.job.status && d.job.id && d.job.type ? null : "none"; })
|
||||
.html(function (d) {
|
||||
let href = "";
|
||||
if (d.job) {
|
||||
@@ -1065,8 +1065,8 @@ export default ['$state','moment', '$timeout', '$window', '$filter', 'Rest', 'Ge
|
||||
.attr("y", nodeH - 15)
|
||||
.attr("dy", ".35em")
|
||||
.attr("class", "WorkflowChart-detailsLink")
|
||||
.style("display", function(d){ return d.job && d.job.status && d.job.id ? null : "none"; })
|
||||
.html(function () {
|
||||
.style("display", function(d){ return d.job && d.job.status && d.job.id && d.job.type ? null : "none"; })
|
||||
.html(function (d) {
|
||||
let href = "";
|
||||
if (d.job) {
|
||||
if(d.job.type === 'job') {
|
||||
|
||||
@@ -33,6 +33,7 @@ export default [function(){
|
||||
|
||||
if(node.summary_fields.job) {
|
||||
nodeObj.job = node.summary_fields.job;
|
||||
nodeRef[nodeIdCounter].jobType = node.summary_fields.job.type;
|
||||
}
|
||||
if(node.summary_fields.unified_job_template) {
|
||||
nodeRef[nodeIdCounter].unifiedJobTemplate = nodeObj.unifiedJobTemplate = node.summary_fields.unified_job_template;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
export default ['workflowData', 'workflowResultsService', 'workflowDataOptions',
|
||||
'jobLabels', 'workflowNodes', '$scope', 'ParseTypeChange',
|
||||
'ParseVariableString', 'count', '$state', 'i18n', 'WorkflowChartService', '$filter',
|
||||
'moment', function(workflowData, workflowResultsService,
|
||||
'moment', 'ProcessErrors', function(workflowData, workflowResultsService,
|
||||
workflowDataOptions, jobLabels, workflowNodes, $scope, ParseTypeChange,
|
||||
ParseVariableString, count, $state, i18n, WorkflowChartService, $filter,
|
||||
moment) {
|
||||
moment, ProcessErrors) {
|
||||
let nodeRef;
|
||||
var runTimeElapsedTimer = null;
|
||||
|
||||
@@ -279,15 +279,34 @@ export default ['workflowData', 'workflowResultsService', 'workflowDataOptions',
|
||||
|
||||
$scope.graphState.arrayOfNodesForChart.forEach((node) => {
|
||||
if (nodeRef[node.id] && nodeRef[node.id].originalNodeObject.id === data.workflow_node_id) {
|
||||
node.job = {
|
||||
id: data.unified_job_id,
|
||||
status: data.status,
|
||||
type: nodeRef[node.id].unifiedJobTemplate.unified_job_type
|
||||
};
|
||||
if (!nodeRef[node.id].jobType && nodeRef[node.id].unifiedJobTemplate.unified_job_type === "job") {
|
||||
workflowResultsService.getWorkflowNode(nodeRef[node.id].originalNodeObject.url)
|
||||
.then((nodeData) => {
|
||||
nodeRef[node.id].jobType = nodeData.data.summary_fields.job.type;
|
||||
|
||||
node.job = {
|
||||
id: data.unified_job_id,
|
||||
status: data.status,
|
||||
type: nodeRef[node.id].jobType
|
||||
};
|
||||
|
||||
$scope.$broadcast("refreshWorkflowChart");
|
||||
})
|
||||
.catch(({ data, status }) => {
|
||||
const params = { hdr: 'Error!', msg: `Call to get workflow node failed. Return status: ${status}` };
|
||||
ProcessErrors($scope, data, status, null, params);
|
||||
});
|
||||
} else {
|
||||
node.job = {
|
||||
id: data.unified_job_id,
|
||||
status: data.status,
|
||||
type: nodeRef[node.id].jobType || nodeRef[node.id].unifiedJobTemplate.unified_job_type
|
||||
};
|
||||
|
||||
$scope.$broadcast("refreshWorkflowChart");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$scope.$broadcast("refreshWorkflowChart");
|
||||
}
|
||||
getLabelsAndTooltips();
|
||||
});
|
||||
|
||||
@@ -133,6 +133,10 @@ export default ['$q', 'Prompt', '$filter', 'Wait', 'Rest', '$state', 'ProcessErr
|
||||
}
|
||||
return false;
|
||||
},
|
||||
getWorkflowNode: (nodeUrl) => {
|
||||
Rest.setUrl(nodeUrl);
|
||||
return Rest.get();
|
||||
}
|
||||
};
|
||||
return val;
|
||||
}];
|
||||
|
||||
Reference in New Issue
Block a user