Skip to content

Commit

Permalink
fix: Consder templateRef when filtering by tag (#5190)
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Behar <simbeh7@gmail.com>
  • Loading branch information
simster7 committed Feb 24, 2021
1 parent 23415b2 commit 2abf08e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ui/src/app/workflows/components/workflow-dag/workflow-dag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ function progress(n: NodeStatus) {
return (new Date().getTime() - new Date(n.startedAt).getTime()) / 1000 / n.estimatedDuration;
}

function getNodeLabelTemplateName(n: NodeStatus): string {
return n.templateName || (n.templateRef && n.templateRef.template + '/' + n.templateRef.name) || 'no template';
}

function nodeLabel(n: NodeStatus) {
const phase = n.type === 'Suspend' && n.phase === 'Running' ? 'Suspended' : n.phase;
return {
Expand All @@ -37,7 +41,7 @@ function nodeLabel(n: NodeStatus) {
icon: icons[phase] || icons.Pending,
progress: phase === 'Running' && progress(n),
classNames: phase,
tags: new Set([n.templateName])
tags: new Set([getNodeLabelTemplateName(n)])
};
}

Expand All @@ -64,7 +68,7 @@ export class WorkflowDag extends React.Component<WorkflowDagProps, WorkflowDagRe
this.prepareGraph();

const tags: {[key: string]: boolean} = {};
Object.values(this.props.nodes || {}).forEach(n => (tags[n.templateName] = true));
Object.values(this.props.nodes || {}).forEach(n => (tags[getNodeLabelTemplateName(n)] = true));

return (
<GraphPanel
Expand Down

0 comments on commit 2abf08e

Please sign in to comment.