From d2f12037da1506742d1de2be6a5989f105bc18a1 Mon Sep 17 00:00:00 2001 From: JzoNg Date: Tue, 12 Aug 2025 15:54:17 +0800 Subject: [PATCH] add description length check --- .../panel/chat-variable-panel/components/variable-modal.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web/app/components/workflow/panel/chat-variable-panel/components/variable-modal.tsx b/web/app/components/workflow/panel/chat-variable-panel/components/variable-modal.tsx index 5e476027e9..9e5c97bf34 100644 --- a/web/app/components/workflow/panel/chat-variable-panel/components/variable-modal.tsx +++ b/web/app/components/workflow/panel/chat-variable-panel/components/variable-modal.tsx @@ -235,11 +235,13 @@ const ChatVariableModal = ({ return if (!chatVar && varList.some(chatVar => chatVar.name === name)) return notify({ type: 'error', message: 'name is existed' }) - // if (type !== ChatVarType.Object && !value) - // return notify({ type: 'error', message: 'value can not be empty' }) + if (type === ChatVarType.Object && objectValue.some(item => !item.key && !!item.value)) return notify({ type: 'error', message: 'object key can not be empty' }) + if (description.length > 256) + return notify({ type: 'error', message: 'description can not be longer than 256 characters' }) + onSave({ id: chatVar ? chatVar.id : uuid4(), name,