From 8bcecce627a6b2b2caf281e7c3bc9b51f387df7d Mon Sep 17 00:00:00 2001 From: zhsama Date: Wed, 29 Oct 2025 01:40:27 +0800 Subject: [PATCH] feat(workflow): add toast notifications for warning nodes during execution --- .../nodes/_base/components/node-control.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/web/app/components/workflow/nodes/_base/components/node-control.tsx b/web/app/components/workflow/nodes/_base/components/node-control.tsx index 57f252bc01..107445341a 100644 --- a/web/app/components/workflow/nodes/_base/components/node-control.tsx +++ b/web/app/components/workflow/nodes/_base/components/node-control.tsx @@ -19,6 +19,8 @@ import { } from '@/app/components/base/icons/src/vender/line/mediaAndDevices' import Tooltip from '@/app/components/base/tooltip' import { useWorkflowStore } from '@/app/components/workflow/store' +import { useWorkflowRunValidation } from '@/app/components/workflow/hooks/use-checklist' +import Toast from '@/app/components/base/toast' type NodeControlProps = Pick const NodeControl: FC = ({ @@ -30,6 +32,8 @@ const NodeControl: FC = ({ const { handleNodeSelect } = useNodesInteractions() const workflowStore = useWorkflowStore() const isSingleRunning = data._singleRunningStatus === NodeRunningStatus.Running + const { warningNodes } = useWorkflowRunValidation() + const warningForNode = warningNodes.find(item => item.id === id) const handleOpenChange = useCallback((newOpen: boolean) => { setOpen(newOpen) }, []) @@ -50,9 +54,15 @@ const NodeControl: FC = ({ { canRunBySingle(data.type, isChildNode) && (
{ const action = isSingleRunning ? 'stop' : 'run' + if (!isSingleRunning && warningForNode) { + const message = warningForNode.errorMessage || t('workflow.panel.checklistTip') + Toast.notify({ type: 'error', message }) + return + } + const store = workflowStore.getState() store.setInitShowLastRunTab(true) store.setPendingSingleRun({ @@ -67,7 +77,7 @@ const NodeControl: FC = ({ ? : (