Skip to content

Commit

Permalink
feat(core): allow users to override pipeline graph positions (#7141)
Browse files Browse the repository at this point in the history
  • Loading branch information
anotherchrisberry committed Jun 26, 2019
1 parent fb58d70 commit 342087c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/scripts/modules/core/src/domain/IExecutionStage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export interface IExecutionStageSummary extends IOrchestratedItem {
endTime: number;
extraLabelLines?: (stage: IExecutionStageSummary) => number;
firstActiveStage?: number;
graphRowOverride?: number;
group?: string;
groupStages?: IExecutionStageSummary[];
id: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ export class PipelineGraph extends React.Component<IPipelineGraphProps, IPipelin
}
return 0;
},
(node: IPipelineGraphNode) => (node.graphRowOverride ? node.graphRowOverride : 1000),
// same highest parent, prefer farthest last node
(node: IPipelineGraphNode) => 1 - node.lastPhase,
// same highest parent, prefer fewer terminal children if any
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export interface IPipelineGraphNode {
parents: IPipelineGraphNode[];
placeholder?: boolean;
root?: boolean;
graphRowOverride?: number;
row?: number; // Added after the fact in PipelineGraphDirective
x?: number; // Added after the fact in PipelineGraphDirective
y?: number; // Added after the fact in PipelineGraphDirective
Expand Down Expand Up @@ -70,6 +71,7 @@ export class PipelineGraphService {
executionId: execution.id,
executionStage: true,
extraLabelLines: stage.extraLabelLines ? stage.extraLabelLines(stage) : 0,
graphRowOverride: stage.graphRowOverride || 0,
hasNotStarted: stage.hasNotStarted,
id: stage.refId,
index: idx,
Expand Down Expand Up @@ -120,6 +122,7 @@ export class PipelineGraphService {
const node: IPipelineGraphNode = {
childLinks: [],
children: [],
graphRowOverride: stage.graphRowOverride || 0,
hasWarnings: !!warnings,
id: stage.refId,
index: idx,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ export class ExecutionsTransformer {
group: context.group,
id: stage.id,
index: undefined,
graphRowOverride: context.graphRowOverride || 0,
masterStage: stage,
name: stage.name,
refId: stage.refId,
Expand Down

0 comments on commit 342087c

Please sign in to comment.