Skip to content

Commit

Permalink
fix: use templateName where possible else nothing (#13836)
Browse files Browse the repository at this point in the history
Signed-off-by: isubasinghe <isitha@pipekit.io>
  • Loading branch information
isubasinghe authored Oct 31, 2024
1 parent 283c3fd commit b26ed4a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ui/src/workflows/components/workflow-dag/workflow-dag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ export class WorkflowDag extends React.Component<WorkflowDagProps, WorkflowDagRe
);
}

private nodeLabel(n: NodeStatus, parent?: NodeStatus) {
private nodeLabel(n: NodeStatus) {
const phase = n.type === 'Suspend' && n.phase === 'Running' ? 'Suspended' : n.phase;
let label = shortNodeName(n);

if (this.state.showInvokingTemplateName) {
label = `${parent?.templateRef?.name ?? parent?.templateName ?? n.templateName}:${label}`;
label = n.templateName ? `${n.templateName}:${label}` : label;
}

return {
Expand Down Expand Up @@ -228,7 +228,7 @@ export class WorkflowDag extends React.Component<WorkflowDagProps, WorkflowDagRe
}
const isExpanded: boolean = this.state.expandNodes.has('*') || this.state.expandNodes.has(item.nodeName);

nodes.set(item.nodeName, this.nodeLabel(child, allNodes[item.parent]));
nodes.set(item.nodeName, this.nodeLabel(child));
edges.set({v: item.parent, w: item.nodeName}, {});

// If we have already considered the children of this node, don't consider them again
Expand Down

0 comments on commit b26ed4a

Please sign in to comment.