Fixes split job inside workflow details link bug

This commit is contained in:
mabashian
2018-12-14 18:04:39 -05:00
parent a8e1c8960f
commit 9f18f8dbdb
4 changed files with 36 additions and 12 deletions

View File

@@ -764,7 +764,7 @@ export default ['$state','moment', '$timeout', '$window', '$filter', 'Rest', 'Ge
}); });
baseSvg.selectAll(".WorkflowChart-detailsLink") 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) { .html(function (d) {
let href = ""; let href = "";
if (d.job) { if (d.job) {
@@ -1065,8 +1065,8 @@ export default ['$state','moment', '$timeout', '$window', '$filter', 'Rest', 'Ge
.attr("y", nodeH - 15) .attr("y", nodeH - 15)
.attr("dy", ".35em") .attr("dy", ".35em")
.attr("class", "WorkflowChart-detailsLink") .attr("class", "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 () { .html(function (d) {
let href = ""; let href = "";
if (d.job) { if (d.job) {
if(d.job.type === 'job') { if(d.job.type === 'job') {

View File

@@ -33,6 +33,7 @@ export default [function(){
if(node.summary_fields.job) { if(node.summary_fields.job) {
nodeObj.job = 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) { if(node.summary_fields.unified_job_template) {
nodeRef[nodeIdCounter].unifiedJobTemplate = nodeObj.unifiedJobTemplate = node.summary_fields.unified_job_template; nodeRef[nodeIdCounter].unifiedJobTemplate = nodeObj.unifiedJobTemplate = node.summary_fields.unified_job_template;

View File

@@ -1,10 +1,10 @@
export default ['workflowData', 'workflowResultsService', 'workflowDataOptions', export default ['workflowData', 'workflowResultsService', 'workflowDataOptions',
'jobLabels', 'workflowNodes', '$scope', 'ParseTypeChange', 'jobLabels', 'workflowNodes', '$scope', 'ParseTypeChange',
'ParseVariableString', 'count', '$state', 'i18n', 'WorkflowChartService', '$filter', 'ParseVariableString', 'count', '$state', 'i18n', 'WorkflowChartService', '$filter',
'moment', function(workflowData, workflowResultsService, 'moment', 'ProcessErrors', function(workflowData, workflowResultsService,
workflowDataOptions, jobLabels, workflowNodes, $scope, ParseTypeChange, workflowDataOptions, jobLabels, workflowNodes, $scope, ParseTypeChange,
ParseVariableString, count, $state, i18n, WorkflowChartService, $filter, ParseVariableString, count, $state, i18n, WorkflowChartService, $filter,
moment) { moment, ProcessErrors) {
let nodeRef; let nodeRef;
var runTimeElapsedTimer = null; var runTimeElapsedTimer = null;
@@ -279,15 +279,34 @@ export default ['workflowData', 'workflowResultsService', 'workflowDataOptions',
$scope.graphState.arrayOfNodesForChart.forEach((node) => { $scope.graphState.arrayOfNodesForChart.forEach((node) => {
if (nodeRef[node.id] && nodeRef[node.id].originalNodeObject.id === data.workflow_node_id) { if (nodeRef[node.id] && nodeRef[node.id].originalNodeObject.id === data.workflow_node_id) {
node.job = { if (!nodeRef[node.id].jobType && nodeRef[node.id].unifiedJobTemplate.unified_job_type === "job") {
id: data.unified_job_id, workflowResultsService.getWorkflowNode(nodeRef[node.id].originalNodeObject.url)
status: data.status, .then((nodeData) => {
type: nodeRef[node.id].unifiedJobTemplate.unified_job_type 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(); getLabelsAndTooltips();
}); });

View File

@@ -133,6 +133,10 @@ export default ['$q', 'Prompt', '$filter', 'Wait', 'Rest', '$state', 'ProcessErr
} }
return false; return false;
}, },
getWorkflowNode: (nodeUrl) => {
Rest.setUrl(nodeUrl);
return Rest.get();
}
}; };
return val; return val;
}]; }];