+
+
+
@@ -122,12 +154,15 @@ export class LineageView extends React.Component
@@ -150,38 +188,51 @@ export class LineageView extends React.Component
(artifact.getTypeId()));
- return Object.keys(artifactsByTypeId).map((typeId) => {
- const artifactTypeName = getTypeName(Number(typeId), this.artifactTypes);
- const artifacts = artifactsByTypeId[typeId];
- return {
- title: artifactTypeName,
- elements: artifacts.map((artifact) => ({
- resource: artifact,
- resourceDetailsPageRoute:
- this.props.buildResourceDetailsPageRoute(artifact, artifactTypeName),
- prev: !isTarget || this.state.inputExecutions.length > 0,
- next: !isTarget || this.state.outputExecutions.length > 0,
- })
- )
- };
+ const orderedCardsByType: CardDetails[] = [];
+
+ let currentType: number;
+ let currentTypeName: string;
+ let currentCard: CardDetails;
+
+ artifacts.forEach((artifact) => {
+ if (!currentType || artifact.getTypeId() !== currentType) {
+ // Create a new card
+ currentType = artifact.getTypeId();
+ currentTypeName = getTypeName(Number(currentType), this.artifactTypes);
+ currentCard = {
+ title: currentTypeName,
+ elements: []
+ };
+ orderedCardsByType.push(currentCard);
+ }
+
+ currentCard.elements.push({
+ resource: artifact,
+ resourceDetailsPageRoute:
+ this.props.buildResourceDetailsPageRoute(artifact, currentTypeName),
+ prev: !isTarget || this.state.inputExecutions.length > 0,
+ next: !isTarget || this.state.outputExecutions.length > 0,
+ });
});
+
+ return orderedCardsByType;
}
private buildExecutionCards(executions: Execution[]): CardDetails[] {
- const executionsByTypeId = groupBy(executions, (execution) => (execution.getTypeId()));
+ const executionsByTypeId = groupBy(executions, (e) => (e.getTypeId()));
+
return Object.keys(executionsByTypeId).map((typeId) => {
const executionTypeName = getTypeName(Number(typeId), this.executionTypes);
- const executions = executionsByTypeId[typeId];
+ const executionsForType = executionsByTypeId[typeId];
return {
title: executionTypeName,
- elements: executions.map((execution) => ({
+ elements: executionsForType.map((execution) => ({
resource: execution,
- resourceDetailsPageRoute: this.props.buildResourceDetailsPageRoute(execution, executionTypeName),
+ resourceDetailsPageRoute:
+ this.props.buildResourceDetailsPageRoute(execution, executionTypeName),
prev: true,
next: true,
- })
- )
+ }))
};
});
}
@@ -231,13 +282,29 @@ export class LineageView extends React.Component = new Map();
+
const outputExecutionOutputArtifactIds: number[] = [];
+
outputExecutionEvents.forEach((event) => {
if (!isOutputEvent(event)) {
return;
}
- outputExecutionOutputArtifactIds.push(event.getArtifactId());
+ const executionId = event.getExecutionId();
+ if (!outputExecutionToOutputArtifactMap.get(executionId)) {
+ outputExecutionToOutputArtifactMap.set(executionId, []);
+ }
+
+ const artifactId = event.getArtifactId();
+ outputExecutionOutputArtifactIds.push(artifactId);
+
+ const artifacts = outputExecutionToOutputArtifactMap.get(executionId);
+ if (artifacts) {
+ artifacts.push(artifactId);
+ }
});
const [inputArtifacts, outputArtifacts] = await Promise.all([
@@ -246,7 +313,11 @@ export class LineageView extends React.Component {
@@ -303,4 +374,14 @@ export class LineageView extends React.Component