Restrict workflow selection modes to direct or explicit workflows, removing automatic mode support
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import React from 'react'
|
||||
|
||||
export default function WorkflowSelector({ disabled, onChange, selection, workflows }) {
|
||||
const value = selection.mode === 'explicit' ? `workflow:${selection.workflowId}` : selection.mode
|
||||
const value = selection.mode === 'explicit' ? `workflow:${selection.workflowId}` : 'direct'
|
||||
return (
|
||||
<label className="workflow-selector" title="Choose how this chat prompt is executed">
|
||||
<span>Flow</span>
|
||||
@@ -10,12 +10,11 @@ export default function WorkflowSelector({ disabled, onChange, selection, workfl
|
||||
disabled={disabled}
|
||||
onChange={(event) => {
|
||||
const next = event.target.value
|
||||
if (next === 'direct' || next === 'automatic') onChange({ mode: next, workflowId: null })
|
||||
if (next === 'direct') onChange({ mode: next, workflowId: null })
|
||||
else onChange({ mode: 'explicit', workflowId: next.replace(/^workflow:/, '') })
|
||||
}}
|
||||
>
|
||||
<option value="direct">Direct</option>
|
||||
<option value="automatic">Automatic</option>
|
||||
{workflows.filter(item => item.enabled && item.slug !== 'input-output').map(item => (
|
||||
<option key={item.id} value={`workflow:${item.id}`}>{item.name}</option>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user