Skip to content

Commit d2bbc76

Browse files
committed
fix: use output over input names
1 parent de4d26b commit d2bbc76

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

src/components/dag-visualizer/layout/helper.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,18 @@ export function mergeRealAndPlacehodlerData({
6868
const duplicateRealArtifacts = finalNodes.filter((node) => node.id === realArtifact.id);
6969
if (duplicateRealArtifacts.length === 0) {
7070
finalNodes.push(realArtifact);
71+
} else {
72+
if (realArtifact.data.artifactType === "output") {
73+
for (const node of duplicateRealArtifacts) {
74+
// remove node from finalNodes based on id
75+
const index = finalNodes.findIndex((finalNode) => finalNode.id === node.id);
76+
if (index !== -1) {
77+
finalNodes.splice(index, 1);
78+
}
79+
}
80+
81+
finalNodes.push(realArtifact);
82+
}
7183
}
7284
});
7385

src/components/dag-visualizer/layout/real-data.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function extractNodes(stepConfig: StepDict, substitutions: Record<string, Record
3636
placeholderId,
3737
type: "artifact",
3838
substitutions: substitutions[stepName] || {},
39-
data: { ...version, name: outputName }
39+
data: { ...version, name: outputName, artifactType: "output" }
4040
});
4141
});
4242
});
@@ -49,7 +49,7 @@ function extractNodes(stepConfig: StepDict, substitutions: Record<string, Record
4949
id: artifactVersion.id,
5050
placeholderId,
5151
type: "artifact",
52-
data: { ...artifactVersion, name: inputName }
52+
data: { ...artifactVersion, name: inputName, artifactType: "input" }
5353
});
5454
});
5555
});

src/types/pipeline-runs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export type PipelineRunOvervieweParams = NonNullable<
1111
>;
1212
export type PipelineRunPage = components["schemas"]["Page_PipelineRunResponse_"];
1313

14-
type ArtifactNodeDetails = ArtifactVersion & { name: string };
14+
type ArtifactNodeDetails = ArtifactVersion & { name: string; artifactType: "input" | "output" };
1515
export type ArtifactNode = {
1616
id: string;
1717
placeholderId: string;

0 commit comments

Comments
 (0)