diff --git a/awx/ui_next/src/components/Workflow/WorkflowNodeHelp.jsx b/awx/ui_next/src/components/Workflow/WorkflowNodeHelp.jsx
index 510190b780..1abf65c3a7 100644
--- a/awx/ui_next/src/components/Workflow/WorkflowNodeHelp.jsx
+++ b/awx/ui_next/src/components/Workflow/WorkflowNodeHelp.jsx
@@ -33,10 +33,11 @@ const StyledExclamationTriangleIcon = styled(ExclamationTriangleIcon)`
function WorkflowNodeHelp({ node, i18n }) {
let nodeType;
- if (node.unifiedJobTemplate || node.job) {
+ const job = node?.originalNodeObject?.summary_fields?.job;
+ if (node.unifiedJobTemplate || job) {
const type = node.unifiedJobTemplate
? node.unifiedJobTemplate.unified_job_type || node.unifiedJobTemplate.type
- : node.job.type;
+ : job.type;
switch (type) {
case 'job_template':
case 'job':
@@ -64,8 +65,8 @@ function WorkflowNodeHelp({ node, i18n }) {
}
let jobStatus;
- if (node.job) {
- switch (node.job.status) {
+ if (job) {
+ switch (job.status) {
case 'new':
jobStatus = i18n._(t`New`);
break;
@@ -112,23 +113,22 @@ function WorkflowNodeHelp({ node, i18n }) {
return (
<>
- {!node.unifiedJobTemplate &&
- (!node.job || node.job.type !== 'workflow_approval') && (
- <>
-
{i18n._(t`Click to view job details`)}
)} > diff --git a/awx/ui_next/src/components/Workflow/workflowReducer.js b/awx/ui_next/src/components/Workflow/workflowReducer.js index eddd7dce2a..36171811e4 100644 --- a/awx/ui_next/src/components/Workflow/workflowReducer.js +++ b/awx/ui_next/src/components/Workflow/workflowReducer.js @@ -365,9 +365,6 @@ function generateNodes(workflowNodes, i18n) { originalNodeObject: node, }; - if (node.summary_fields.job) { - nodeObj.job = node.summary_fields.job; - } if (node.summary_fields.unified_job_template) { nodeObj.unifiedJobTemplate = node.summary_fields.unified_job_template; } diff --git a/awx/ui_next/src/screens/Job/WorkflowOutput/WorkflowOutputNode.jsx b/awx/ui_next/src/screens/Job/WorkflowOutput/WorkflowOutputNode.jsx index 24f60de2a6..b875e9c768 100644 --- a/awx/ui_next/src/screens/Job/WorkflowOutput/WorkflowOutputNode.jsx +++ b/awx/ui_next/src/screens/Job/WorkflowOutput/WorkflowOutputNode.jsx @@ -64,24 +64,25 @@ Elapsed.displayName = 'Elapsed'; function WorkflowOutputNode({ i18n, mouseEnter, mouseLeave, node }) { const history = useHistory(); const { nodePositions } = useContext(WorkflowStateContext); + const job = node?.originalNodeObject?.summary_fields?.job; let borderColor = '#93969A'; - if (node.job) { + if (job) { if ( - node.job.status === 'failed' || - node.job.status === 'error' || - node.job.status === 'canceled' + job.status === 'failed' || + job.status === 'error' || + job.status === 'canceled' ) { borderColor = '#d9534f'; } - if (node.job.status === 'successful' || node.job.status === 'ok') { + if (job.status === 'successful' || job.status === 'ok') { borderColor = '#5cb85c'; } } const handleNodeClick = () => { - if (node.job && node.job.type !== 'workflow_aproval') { - history.push(`/jobs/${node.job.id}/details`); + if (job && job.type !== 'workflow_aproval') { + history.push(`/jobs/${job.id}/details`); } }; @@ -90,7 +91,7 @@ function WorkflowOutputNode({ i18n, mouseEnter, mouseLeave, node }) { id={`node-${node.id}`} transform={`translate(${nodePositions[node.id].x},${nodePositions[node.id] .y - nodePositions[1].y})`} - job={node.job} + job={job} onClick={handleNodeClick} onMouseEnter={mouseEnter} onMouseLeave={mouseLeave} @@ -106,14 +107,14 @@ function WorkflowOutputNode({ i18n, mouseEnter, mouseLeave, node }) { />{node.job.name || node.unifiedJobTemplate.name}
+ {job.status &&{job.name || node.unifiedJobTemplate.name}