Refactor Start node UI to User Input and optimize EntryNodeContainer (#24156)

This commit is contained in:
lyzno1
2025-08-19 14:40:24 +08:00
committed by GitHub
parent aacea166d7
commit acfb95f9c2
6 changed files with 77 additions and 53 deletions

View File

@ -43,7 +43,7 @@ import NodeControl from './components/node-control'
import ErrorHandleOnNode from './components/error-handle/error-handle-on-node'
import RetryOnNode from './components/retry/retry-on-node'
import AddVariablePopupWithPosition from './components/add-variable-popup-with-position'
import TriggerContainer from './components/trigger-container'
import EntryNodeContainer from './components/entry-node-container'
import cn from '@/utils/classnames'
import BlockIcon from '@/app/components/workflow/block-icon'
import Tooltip from '@/app/components/base/tooltip'
@ -138,8 +138,6 @@ const BaseNode: FC<BaseNodeProps> = ({
return null
}, [data._loopIndex, data._runningStatus, t])
const isTriggerNode = TRIGGER_NODE_TYPES.includes(data.type as any)
const nodeContent = (
<div
className={cn(
@ -337,10 +335,17 @@ const BaseNode: FC<BaseNodeProps> = ({
</div>
)
return isTriggerNode ? (
<TriggerContainer status="enabled">
const isEntryNode = TRIGGER_NODE_TYPES.includes(data.type as any) || data.type === BlockEnum.Start
const isStartNode = data.type === BlockEnum.Start
return isEntryNode ? (
<EntryNodeContainer
status="enabled"
showIndicator={!isStartNode}
nodeType={isStartNode ? 'start' : 'trigger'}
>
{nodeContent}
</TriggerContainer>
</EntryNodeContainer>
) : nodeContent
}