Skip to content

Commit 0d1676e

Browse files
committed
fix: reverse edge list rendering order in Workflow component
1 parent e12cdca commit 0d1676e

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

src/components/app/details/triggerView/workflow/Workflow.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,10 @@ export class Workflow extends Component<WorkflowProps> {
329329

330330
renderEdgeList() {
331331
const edges = this.getEdges()
332-
return edges.map((edgeNode) => {
332+
// In the SVG, the bottom elements are rendered on top.
333+
// By reversing, this prevents the path elements (workflow arrows) from overlapping and covering other elements
334+
// like the ApprovalNode button or add node button, which are rendered earlier.
335+
return edges.reverse().map((edgeNode) => {
333336
if (ApprovalNodeEdge) {
334337
return (
335338
<ApprovalNodeEdge

src/components/workflowEditor/Workflow.tsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ import {
4646
ChangeCIPayloadType,
4747
CIPipelineNodeType,
4848
URLS as CommonURLS,
49-
AppConfigProps
49+
AppConfigProps,
5050
} from '@devtron-labs/devtron-fe-common-lib'
5151
import { ReactComponent as ICInput } from '../../assets/icons/ic-input.svg'
5252
import { ReactComponent as ICMoreOption } from '../../assets/icons/ic-more-option.svg'
@@ -64,7 +64,8 @@ const getParsedPluginPolicyConsequenceData = importComponentFromFELibrary(
6464
)
6565

6666
export interface WorkflowProps
67-
extends RouteComponentProps<{ appId: string; workflowId?: string; ciPipelineId?: string; cdPipelineId?: string }>, Required<Pick<AppConfigProps, 'isTemplateView'>> {
67+
extends RouteComponentProps<{ appId: string; workflowId?: string; ciPipelineId?: string; cdPipelineId?: string }>,
68+
Required<Pick<AppConfigProps, 'isTemplateView'>> {
6869
nodes: CommonNodeAttr[]
6970
id: number
7071
name: string
@@ -535,7 +536,6 @@ export class Workflow extends Component<WorkflowProps, WorkflowState> {
535536
)
536537
}
537538

538-
539539
getEdges({ nodesWithBufferHeight }: { nodesWithBufferHeight: CommonNodeAttr[] }) {
540540
return nodesWithBufferHeight.reduce((edgeList, node) => {
541541
node.downstreams.forEach((downStreamNodeId) => {
@@ -683,7 +683,11 @@ export class Workflow extends Component<WorkflowProps, WorkflowState> {
683683
)
684684
}
685685
}
686-
return edgeList
686+
687+
// In the SVG, the bottom elements are rendered on top.
688+
// By reversing, this prevents the path elements (workflow arrows) from overlapping and covering other elements
689+
// like the ApprovalNode button or add node button, which are rendered earlier.
690+
return edgeList.reverse()
687691
}
688692

689693
toggleShowDeleteDialog = () => {
@@ -787,7 +791,9 @@ export class Workflow extends Component<WorkflowProps, WorkflowState> {
787791

788792
return (
789793
<ConditionalWrap
790-
condition={!this.props.isOffendingPipelineView && !this.props.isTemplateView && this.props.showWebhookTippy}
794+
condition={
795+
!this.props.isOffendingPipelineView && !this.props.isTemplateView && this.props.showWebhookTippy
796+
}
791797
wrap={(children) => (
792798
<Tippy
793799
placement="top-start"

0 commit comments

Comments
 (0)