Skip to content

Commit

Permalink
Merge pull request #915 from PintoGideon/master
Browse files Browse the repository at this point in the history
Formatting ids in the pipeline graph
  • Loading branch information
PintoGideon committed Apr 20, 2023
2 parents 4b938b6 + af7cd24 commit dbf28e3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions src/components/feed/Pipelines/NodeData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,16 @@ const NodeData = (props: NodeProps) => {
state,
handleSetPipelineEnvironments,
} = props;
const { computeEnvs, title, currentNode } = state;
const { computeEnvs, title, currentNode, pluginPipings } = state;

const root = pluginPipings && pluginPipings[0];

let currentId = NaN;
if (data.previous_id && root) {
currentId = data.id - root.data.id;
} else {
currentId = 0;
}

let currentComputeEnv = "";
if (computeEnvs && computeEnvs[data.id]) {
Expand Down Expand Up @@ -107,7 +116,7 @@ const NodeData = (props: NodeProps) => {
const textLabel = (
<g id={`text_${data.id}`} transform={`translate(-30,30)`}>
<text ref={textRef} className="label__title">
{titleName ? titleName : data.title}
{currentId}:{titleName ? titleName : data.title}
</text>
</g>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/feed/Pipelines/Tree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ const LinkData: React.FC<LinkProps> = ({ linkData }) => {
sourceY = source.y + sourcePadding * normY,
targetX = target.x - targetPadding * normX,
targetY = target.y - targetPadding * normY;
console.log("TS", ts, target);

if (ts) {
return linkVertical()({
source: [sourceX, sourceY],
Expand Down

0 comments on commit dbf28e3

Please sign in to comment.