mirror of
https://github.com/langgenius/dify.git
synced 2026-04-25 05:06:15 +08:00
refactor:Change sub-graph output handling from skip to default
This commit is contained in:
@ -24,7 +24,7 @@ const ConfigPanel: FC<ConfigPanelProps> = ({
|
||||
activeTab,
|
||||
}) => {
|
||||
const { t } = useTranslation()
|
||||
const [whenOutputNone, setWhenOutputNone] = useState<WhenOutputNoneOption>('skip')
|
||||
const [whenOutputNone, setWhenOutputNone] = useState<WhenOutputNoneOption>('default')
|
||||
|
||||
const handleWhenOutputNoneChange = useCallback((e: React.ChangeEvent<HTMLSelectElement>) => {
|
||||
setWhenOutputNone(e.target.value as WhenOutputNoneOption)
|
||||
@ -72,15 +72,12 @@ const ConfigPanel: FC<ConfigPanelProps> = ({
|
||||
value={whenOutputNone}
|
||||
onChange={handleWhenOutputNoneChange}
|
||||
>
|
||||
<option value="skip">
|
||||
{t('subGraphModal.whenOutputNone.skip', { ns: 'workflow' })}
|
||||
<option value="default">
|
||||
{t('subGraphModal.whenOutputNone.default', { ns: 'workflow' })}
|
||||
</option>
|
||||
<option value="error">
|
||||
{t('subGraphModal.whenOutputNone.error', { ns: 'workflow' })}
|
||||
</option>
|
||||
<option value="default">
|
||||
{t('subGraphModal.whenOutputNone.default', { ns: 'workflow' })}
|
||||
</option>
|
||||
</select>
|
||||
</Field>
|
||||
</div>
|
||||
|
||||
@ -35,7 +35,7 @@ const SubGraphMain: FC<SubGraphMainProps> = ({
|
||||
enabled: true,
|
||||
startNodeId: updatedNodes[0]?.id || '',
|
||||
selectedOutputVar: [],
|
||||
whenOutputNone: 'skip',
|
||||
whenOutputNone: 'default',
|
||||
}
|
||||
|
||||
saveSubGraphData({
|
||||
|
||||
@ -107,7 +107,7 @@ export const useSubGraphPersistence = ({
|
||||
enabled: true,
|
||||
startNodeId: nodes[0]?.id || '',
|
||||
selectedOutputVar: [],
|
||||
whenOutputNone: 'skip',
|
||||
whenOutputNone: 'default',
|
||||
}
|
||||
|
||||
saveSubGraphData({
|
||||
|
||||
@ -10,7 +10,7 @@ const initialState: Omit<SubGraphSliceShape, 'setSubGraphContext' | 'setSubGraph
|
||||
subGraphEdges: [],
|
||||
|
||||
selectedOutputVar: [],
|
||||
whenOutputNone: 'skip',
|
||||
whenOutputNone: 'default',
|
||||
defaultValue: '',
|
||||
|
||||
showDebugPanel: false,
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import type { StateCreator } from 'zustand'
|
||||
import type { Edge, Node, NodeOutPutVar, ValueSelector, VarType } from '@/app/components/workflow/types'
|
||||
|
||||
export type WhenOutputNoneOption = 'skip' | 'error' | 'default'
|
||||
export type WhenOutputNoneOption = 'error' | 'default'
|
||||
|
||||
export type SubGraphConfig = {
|
||||
enabled: boolean
|
||||
|
||||
Reference in New Issue
Block a user