From b1f7602dc8bb0130f12dd50d1b8df8ae1a8671f2 Mon Sep 17 00:00:00 2001 From: twwu Date: Wed, 28 Jan 2026 22:43:58 +0800 Subject: [PATCH] feat(humanInput): update email configuration defaults and remove validation tooltip --- .../delivery-method/email-configure-modal.tsx | 2 +- .../delivery-method/method-item.tsx | 21 ++----------------- .../delivery-method/method-selector.tsx | 9 -------- web/i18n/en-US/workflow.json | 1 - web/i18n/zh-Hans/workflow.json | 1 - 5 files changed, 3 insertions(+), 31 deletions(-) diff --git a/web/app/components/workflow/nodes/human-input/components/delivery-method/email-configure-modal.tsx b/web/app/components/workflow/nodes/human-input/components/delivery-method/email-configure-modal.tsx index 4259cf53fd..4ca1c28290 100644 --- a/web/app/components/workflow/nodes/human-input/components/delivery-method/email-configure-modal.tsx +++ b/web/app/components/workflow/nodes/human-input/components/delivery-method/email-configure-modal.tsx @@ -40,7 +40,7 @@ const EmailConfigureModal = ({ const email = useAppContextWithSelector(s => s.userProfile.email) const [recipients, setRecipients] = useState(config?.recipients || { whole_workspace: false, items: [] }) const [subject, setSubject] = useState(config?.subject || '') - const [body, setBody] = useState(config?.body || '') + const [body, setBody] = useState(config?.body || '{{#url#}}') const [debugMode, setDebugMode] = useState(config?.debug_mode || false) const checkValidConfig = useCallback(() => { diff --git a/web/app/components/workflow/nodes/human-input/components/delivery-method/method-item.tsx b/web/app/components/workflow/nodes/human-input/components/delivery-method/method-item.tsx index 8935176a55..bea2f8cb35 100644 --- a/web/app/components/workflow/nodes/human-input/components/delivery-method/method-item.tsx +++ b/web/app/components/workflow/nodes/human-input/components/delivery-method/method-item.tsx @@ -70,30 +70,15 @@ const DeliveryMethodItem: FC = ({ }) } - const isEmailConfigComplete = useMemo(() => { - if (method.type !== DeliveryMethodType.Email || !method.config) - return false - - const config = method.config as EmailConfig - const hasSubject = !!config.subject - const hasBody = !!config.body - const hasRecipients = config.recipients?.whole_workspace || (config.recipients?.items?.length > 0) - - return hasSubject && hasBody && hasRecipients - }, [method.type, method.config]) - const emailSenderTooltipContent = useMemo(() => { if (method.type !== DeliveryMethodType.Email) { return '' } - if (!isEmailConfigComplete) { - return t(`${i18nPrefix}.deliveryMethod.emailSender.configIncomplete`, { ns: 'workflow' }) - } if (method.config?.debug_mode) { return t(`${i18nPrefix}.deliveryMethod.emailSender.testSendTipInDebugMode`, { ns: 'workflow', email }) } return t(`${i18nPrefix}.deliveryMethod.emailSender.testSendTip`, { ns: 'workflow' }) - }, [method.type, method.config?.debug_mode, isEmailConfigComplete, t, email]) + }, [method.type, method.config?.debug_mode, t, email]) const jumpToEmailConfigModal = useCallback(() => { setShowTestEmailModal(false) @@ -135,10 +120,8 @@ const DeliveryMethodItem: FC = ({ needsDelay={false} > { - if (isEmailConfigComplete) - setShowTestEmailModal(true) + setShowTestEmailModal(true) }} > diff --git a/web/app/components/workflow/nodes/human-input/components/delivery-method/method-selector.tsx b/web/app/components/workflow/nodes/human-input/components/delivery-method/method-selector.tsx index 0f7b86bc49..3c3c0ddba2 100644 --- a/web/app/components/workflow/nodes/human-input/components/delivery-method/method-selector.tsx +++ b/web/app/components/workflow/nodes/human-input/components/delivery-method/method-selector.tsx @@ -132,15 +132,6 @@ const MethodSelector: FC = ({ id: uuid4(), type: DeliveryMethodType.Email, enabled: false, - config: { - body: '{{#url#}}', - recipients: { - whole_workspace: false, - items: [], - }, - subject: '', - debug_mode: false, - }, }) }} > diff --git a/web/i18n/en-US/workflow.json b/web/i18n/en-US/workflow.json index 2834e70267..4d9f5adbac 100644 --- a/web/i18n/en-US/workflow.json +++ b/web/i18n/en-US/workflow.json @@ -525,7 +525,6 @@ "nodes.humanInput.deliveryMethod.emailConfigure.subject": "Subject", "nodes.humanInput.deliveryMethod.emailConfigure.subjectPlaceholder": "Enter email subject", "nodes.humanInput.deliveryMethod.emailConfigure.title": "Email Configuration", - "nodes.humanInput.deliveryMethod.emailSender.configIncomplete": "Please complete email configuration first (subject, body, and recipients)", "nodes.humanInput.deliveryMethod.emailSender.debugDone": "A test email has been sent to {{email}}. Please check your inbox.", "nodes.humanInput.deliveryMethod.emailSender.debugModeTip": "Debug mode is enabled.", "nodes.humanInput.deliveryMethod.emailSender.debugModeTip2": "Email will be sent to {{email}}.", diff --git a/web/i18n/zh-Hans/workflow.json b/web/i18n/zh-Hans/workflow.json index 051886253a..acda7db2fc 100644 --- a/web/i18n/zh-Hans/workflow.json +++ b/web/i18n/zh-Hans/workflow.json @@ -525,7 +525,6 @@ "nodes.humanInput.deliveryMethod.emailConfigure.subject": "邮件主题", "nodes.humanInput.deliveryMethod.emailConfigure.subjectPlaceholder": "输入邮件主题", "nodes.humanInput.deliveryMethod.emailConfigure.title": "电子邮件配置", - "nodes.humanInput.deliveryMethod.emailSender.configIncomplete": "请先完成邮件配置(主题、正文和收件人)", "nodes.humanInput.deliveryMethod.emailSender.debugDone": "测试邮件已发送到 {{email}}。请检查您的收件箱。", "nodes.humanInput.deliveryMethod.emailSender.debugModeTip": "调试模式已启用。", "nodes.humanInput.deliveryMethod.emailSender.debugModeTip2": "邮件将发送到 {{email}}。",