Skip to content

Commit 6dcf008

Browse files
committed
feat(NodePropertiesPanel): add timeout input field for event-based switch
Add timeout configuration for event-based switch nodes to specify how long to wait for matching events. Also update help text to mention timeout period.
1 parent 4c7fc60 commit 6dcf008

File tree

1 file changed

+41
-1
lines changed

1 file changed

+41
-1
lines changed

src/lib/src/components/editors/NodePropertiesPanel.js

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,46 @@ export function NodePropertiesPanel({
464464
{node.type === 'switch' && (
465465
<div style={{ marginBottom: '16px' }}>
466466

467+
{/* Timeout for Event-based Switch */}
468+
{(formData.conditionType || 'data') === 'event' && (
469+
<div style={{ marginBottom: '16px' }}>
470+
<label style={{
471+
display: 'block',
472+
fontSize: '12px',
473+
fontWeight: '500',
474+
color: '#374151',
475+
marginBottom: '4px'
476+
}}>
477+
Timeout
478+
</label>
479+
<input
480+
type="text"
481+
value={formData.timeouts?.eventTimeout || ''}
482+
onChange={(e) => {
483+
const currentTimeouts = formData.timeouts || {};
484+
handleFieldChange('timeouts', { ...currentTimeouts, eventTimeout: e.target.value });
485+
}}
486+
placeholder="e.g., PT30S, PT5M, PT1H"
487+
style={{
488+
width: '100%',
489+
padding: '8px 12px',
490+
border: '1px solid #d1d5db',
491+
borderRadius: '6px',
492+
fontSize: '14px',
493+
outline: 'none',
494+
transition: 'border-color 0.2s',
495+
}}
496+
onFocus={(e) => {
497+
e.target.style.borderColor = '#3b82f6';
498+
e.target.style.boxShadow = '0 0 0 3px rgba(59, 130, 246, 0.1)';
499+
}}
500+
onBlur={(e) => {
501+
e.target.style.borderColor = '#d1d5db';
502+
e.target.style.boxShadow = 'none';
503+
}}
504+
/>
505+
</div>
506+
)}
467507

468508
{/* Data Conditions */}
469509
{(formData.conditionType || 'data') === 'data' && (
@@ -810,7 +850,7 @@ export function NodePropertiesPanel({
810850
color: '#0369a1',
811851
marginLeft: '24px'
812852
}}>
813-
Provides a fallback path when no {(formData.conditionType || 'data') === 'event' ? 'events' : 'data conditions'} match
853+
Provides a fallback path when no {(formData.conditionType || 'data') === 'event' ? 'events' : 'data conditions'} match {(formData.conditionType || 'data') === 'event' ? 'within the timeout period' : null}
814854
</div>
815855
</div>
816856
</div>

0 commit comments

Comments
 (0)