Skip to content

Commit b26ed4a

Browse files
authored
fix: use templateName where possible else nothing (#13836)
Signed-off-by: isubasinghe <[email protected]>
1 parent 283c3fd commit b26ed4a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ui/src/workflows/components/workflow-dag/workflow-dag.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,12 @@ export class WorkflowDag extends React.Component<WorkflowDagProps, WorkflowDagRe
9292
);
9393
}
9494

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

9999
if (this.state.showInvokingTemplateName) {
100-
label = `${parent?.templateRef?.name ?? parent?.templateName ?? n.templateName}:${label}`;
100+
label = n.templateName ? `${n.templateName}:${label}` : label;
101101
}
102102

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

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

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

0 commit comments

Comments
 (0)