From 1d9aa5b98c5a8841c4c66e6941f71e14268f7a32 Mon Sep 17 00:00:00 2001 From: dongfubao Date: Thu, 29 May 2025 09:15:08 +0800 Subject: [PATCH] Add the function of being controlled by beta before submission --- web/app/components/workflow/hooks/use-checklist.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web/app/components/workflow/hooks/use-checklist.ts b/web/app/components/workflow/hooks/use-checklist.ts index 13a6c53250..0d173018bd 100644 --- a/web/app/components/workflow/hooks/use-checklist.ts +++ b/web/app/components/workflow/hooks/use-checklist.ts @@ -46,9 +46,7 @@ export const useChecklist = (nodes: Node[], edges: Edge[]) => { const workflowTools = useStore(s => s.workflowTools) const { data: strategyProviders } = useStrategyProviders() const datasetsDetail = useDatasetsDetailStore(s => s.datasetsDetail) - const { - currentWorkspace, - } = useAppContext() + const { currentWorkspace } = useAppContext() const chatVarList = useStore(s => s.conversationVariables) const environmentVariables = useStore(s => s.environmentVariables) @@ -182,6 +180,7 @@ export const useChecklist = (nodes: Node[], edges: Edge[]) => { export const useChecklistBeforePublish = () => { const { t } = useTranslation() const language = useGetLanguage() + const { currentWorkspace } = useAppContext() const buildInTools = useStore(s => s.buildInTools) const customTools = useStore(s => s.customTools) const workflowTools = useStore(s => s.workflowTools) @@ -234,6 +233,7 @@ export const useChecklistBeforePublish = () => { } const allVariablesMap = transformStartNodeVariables(chatVarList, environmentVariables) + const workflowVarCheck = currentWorkspace.beta_config?.workflow_var_check // Before publish, we need to fetch datasets detail, in case of the settings of datasets have been changed const knowledgeRetrievalNodes = nodes.filter(node => node.data.type === BlockEnum.KnowledgeRetrieval) @@ -286,7 +286,7 @@ export const useChecklistBeforePublish = () => { return false } - if (nodesExtraData[node.data.type as BlockEnum].checkVarValid) { + if (workflowVarCheck && nodesExtraData[node.data.type as BlockEnum].checkVarValid) { const { errorMessage: varErrorMessage } = nodesExtraData[node.data.type as BlockEnum].checkVarValid(node.data, { ...allVariablesMap, ...node._parentOutputVarMap }, t) if (varErrorMessage?.length) { notify({ type: 'error', message: `[${node.data.title}] ${varErrorMessage[0]}` })