use the same type for both ids

This commit is contained in:
Michael Pilosov 2024-07-01 18:42:34 -06:00
parent 0d6558bd95
commit 4daa53bf79

View File

@ -65,9 +65,9 @@ export interface Arrow {
path2?: string; path2?: string;
headTransform: string; headTransform: string;
selected: boolean; selected: boolean;
targetId: string; targetId: number;
sourceId: number;
outgoing?: boolean; outgoing?: boolean;
sourceId?: number;
} }
export enum StatusOption { export enum StatusOption {
@ -319,7 +319,7 @@ export class PipelineControllerInfoComponent implements OnInit, AfterViewInit, O
selected: false, selected: false,
outgoing: false, outgoing: false,
sourceId: parentId, sourceId: parentId,
targetId: pipeLineItem.id targetId: pipeLineItem.stepId,
}); });
} }
} }
@ -422,7 +422,7 @@ export class PipelineControllerInfoComponent implements OnInit, AfterViewInit, O
protected highlightArrows() { protected highlightArrows() {
this.arrows = this.arrows?.map(arrow => { this.arrows = this.arrows?.map(arrow => {
const isTarget = arrow.targetId === this.selectedEntity?.id; const isTarget = arrow.targetId === this.selectedEntity?.stepId;
const isSource = arrow.sourceId === this.selectedEntity?.stepId; const isSource = arrow.sourceId === this.selectedEntity?.stepId;
return {...arrow, selected: isTarget || isSource, outgoing: isSource}; return {...arrow, selected: isTarget || isSource, outgoing: isSource};
}).sort((a, b) => (a.selected === b.selected) ? 0 : a.selected ? 1 : -1); }).sort((a, b) => (a.selected === b.selected) ? 0 : a.selected ? 1 : -1);