mirror of https://github.com/langgenius/dify.git
refactor(workflow): Remove Start node from isRequired mechanism
- Set Start node isRequired: false since entry node validation is handled by unified logic - Remove conditional skip logic in checklist since Start is no longer in isRequiredNodesType - Cleaner separation of concerns: unified entry node check vs individual required nodes - Eliminates architectural inconsistency where Start was both individually required and part of group validation
This commit is contained in:
parent
08e8f8676e
commit
b4801adfbd
|
|
@ -173,10 +173,6 @@ export const useChecklist = (nodes: Node[], edges: Edge[]) => {
|
|||
const isRequiredNodesType = Object.keys(nodesExtraData!).filter((key: any) => (nodesExtraData as any)[key].metaData.isRequired)
|
||||
|
||||
isRequiredNodesType.forEach((type: string) => {
|
||||
// Skip Start node requirement since we already check for any start/trigger nodes above
|
||||
if (type === BlockEnum.Start)
|
||||
return
|
||||
|
||||
if (!filteredNodes.find(node => node.data.type === type)) {
|
||||
list.push({
|
||||
id: `${type}-need-added`,
|
||||
|
|
@ -340,10 +336,6 @@ export const useChecklistBeforePublish = () => {
|
|||
for (let i = 0; i < isRequiredNodesType.length; i++) {
|
||||
const type = isRequiredNodesType[i]
|
||||
|
||||
// Skip Start node requirement since we already check for any start/trigger nodes above
|
||||
if (type === BlockEnum.Start)
|
||||
continue
|
||||
|
||||
if (!filteredNodes.find(node => node.data.type === type)) {
|
||||
notify({ type: 'error', message: t('workflow.common.needAdd', { node: t(`workflow.blocks.${type}`) }) })
|
||||
return false
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ const metaData = genNodeMetaData({
|
|||
sort: 0.1,
|
||||
type: BlockEnum.Start,
|
||||
isStart: true,
|
||||
isRequired: true,
|
||||
isRequired: false,
|
||||
isSingleton: true,
|
||||
isTypeFixed: true,
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue