Skip to content

Commit 8fd72a5

Browse files
committed
fix(workflowConverter): improve edge label fallback logic
Use condition.condition and condition.eventRef as fallback values for edge labels when name is not available, providing more meaningful default labels
1 parent faea0e7 commit 8fd72a5

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/components/import-export/JsonImporter/utils/workflowConverter.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ export function convertWorkflowToReactFlow(workflowData, retryPolicyNameToId = {
166166
sourceHandle: `condition-${conditionIndex}`,
167167
type: 'default',
168168
className: 'edge-condition',
169-
label: condition.name || `condition${conditionIndex + 1}`,
169+
label: condition.name || condition.condition || `condition${conditionIndex + 1}`,
170170
style: { strokeWidth: 2 },
171171
data: { type: 'condition' },
172172
labelStyle: { fill: '#f59e0b', fontWeight: 500, fontSize: '12px' },
@@ -203,7 +203,7 @@ export function convertWorkflowToReactFlow(workflowData, retryPolicyNameToId = {
203203
sourceHandle: `condition-${conditionIndex}`,
204204
type: 'default',
205205
className: 'edge-condition',
206-
label: condition.name || `event${conditionIndex + 1}`,
206+
label: condition.name || condition.eventRef || `event${conditionIndex + 1}`,
207207
style: { strokeWidth: 2 },
208208
data: { type: 'condition' },
209209
labelStyle: { fill: '#8b5cf6', fontWeight: 500, fontSize: '12px' },
@@ -332,4 +332,4 @@ function getNodeType(stateType) {
332332
};
333333

334334
return typeMap[stateType] || 'operation';
335-
}
335+
}

src/lib/src/utils/workflowConverter.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ export function convertWorkflowToReactFlow(workflowData, retryPolicyNameToId = {
478478
sourceHandle: `condition-${conditionIndex}`,
479479
type: 'default',
480480
className: 'edge-condition',
481-
label: condition.name || `condition${conditionIndex + 1}`,
481+
label: condition.name || condition.condition || `condition${conditionIndex + 1}`,
482482
style: { strokeWidth: 2 },
483483
data: { type: 'condition' },
484484
labelStyle: { fill: '#f59e0b', fontWeight: 500, fontSize: '12px' },
@@ -515,7 +515,7 @@ export function convertWorkflowToReactFlow(workflowData, retryPolicyNameToId = {
515515
sourceHandle: `condition-${conditionIndex}`,
516516
type: 'default',
517517
className: 'edge-condition',
518-
label: condition.name || `event${conditionIndex + 1}`,
518+
label: condition.name || condition.eventRef || `event${conditionIndex + 1}`,
519519
style: { strokeWidth: 2 },
520520
data: { type: 'condition' },
521521
labelStyle: { fill: '#8b5cf6', fontWeight: 500, fontSize: '12px' },

0 commit comments

Comments
 (0)