diff --git a/web/app/components/base/chat/chat-with-history/__tests__/hooks.spec.tsx b/web/app/components/base/chat/chat-with-history/__tests__/hooks.spec.tsx index d567858b36..35478bae7b 100644 --- a/web/app/components/base/chat/chat-with-history/__tests__/hooks.spec.tsx +++ b/web/app/components/base/chat/chat-with-history/__tests__/hooks.spec.tsx @@ -1163,7 +1163,7 @@ describe('useChatWithHistory', () => { rendered_content: 'Submitted summary', action_id: 'submit', action_text: 'Submit', - form_data: { + submitted_data: { summary: 'approved', }, }, diff --git a/web/app/components/base/chat/chat/answer/__tests__/human-input-filled-form-list.spec.tsx b/web/app/components/base/chat/chat/answer/__tests__/human-input-filled-form-list.spec.tsx index 7f874f5e74..09cced154f 100644 --- a/web/app/components/base/chat/chat/answer/__tests__/human-input-filled-form-list.spec.tsx +++ b/web/app/components/base/chat/chat/answer/__tests__/human-input-filled-form-list.spec.tsx @@ -16,7 +16,7 @@ const createFormData = ( rendered_content: 'fallback content', action_id: 'approve', action_text: 'Approve', - form_data: { + submitted_data: { summary: 'Approved', }, diff --git a/web/app/components/base/chat/chat/answer/human-input-content/__tests__/submitted.spec.tsx b/web/app/components/base/chat/chat/answer/human-input-content/__tests__/submitted.spec.tsx index b4ee491150..2afceccb8e 100644 --- a/web/app/components/base/chat/chat/answer/human-input-content/__tests__/submitted.spec.tsx +++ b/web/app/components/base/chat/chat/answer/human-input-content/__tests__/submitted.spec.tsx @@ -41,7 +41,7 @@ describe('SubmittedHumanInputContent Integration', () => { output_variable_name: 'answer', default: { type: 'constant', value: '', selector: [] }, }], - form_data: { + submitted_data: { answer: 'approved', }, }} @@ -72,7 +72,7 @@ describe('SubmittedHumanInputContent Integration', () => { allowed_file_upload_methods: [], }, ], - form_data: { + submitted_data: { decision: 'approve', attachment: { related_id: 'file-1', @@ -100,7 +100,7 @@ describe('SubmittedHumanInputContent Integration', () => { render( , ) diff --git a/web/app/components/base/chat/chat/answer/human-input-content/submitted.tsx b/web/app/components/base/chat/chat/answer/human-input-content/submitted.tsx index 3cf3a735b3..64a14aa5ef 100644 --- a/web/app/components/base/chat/chat/answer/human-input-content/submitted.tsx +++ b/web/app/components/base/chat/chat/answer/human-input-content/submitted.tsx @@ -8,7 +8,7 @@ import SubmittedFormContent from './submitted-form-content' export const SubmittedHumanInputContent = ({ formData, }: SubmittedHumanInputContentProps) => { - const { rendered_content, action_id, action_text, form_content, form_data, inputs } = formData + const { rendered_content, action_id, action_text, form_content, submitted_data, inputs } = formData const executedAction = useMemo(() => { return { @@ -17,16 +17,16 @@ export const SubmittedHumanInputContent = ({ } }, [action_id, action_text]) - const content = form_content && inputs && form_data && Object.keys(form_data).length > 0 + const content = form_content && inputs && submitted_data && Object.keys(submitted_data).length > 0 ? ( ) - : form_data && Object.keys(form_data).length > 0 - ? + : submitted_data && Object.keys(submitted_data).length > 0 + ? : return ( diff --git a/web/app/components/workflow/panel/__tests__/human-input-filled-form-list.spec.tsx b/web/app/components/workflow/panel/__tests__/human-input-filled-form-list.spec.tsx index 53e7e87b74..4a77e71705 100644 --- a/web/app/components/workflow/panel/__tests__/human-input-filled-form-list.spec.tsx +++ b/web/app/components/workflow/panel/__tests__/human-input-filled-form-list.spec.tsx @@ -9,7 +9,7 @@ const createFilledForm = (overrides: Partial = {}): Hu rendered_content: 'Approved by Alice', action_id: 'approve', action_text: 'Approve', - form_data: { + submitted_data: { summary: 'Approved by Alice', }, ...overrides, diff --git a/web/app/components/workflow/panel/debug-and-preview/__tests__/hooks/handle-resume.spec.ts b/web/app/components/workflow/panel/debug-and-preview/__tests__/hooks/handle-resume.spec.ts index 5a608dcc5b..603db4df80 100644 --- a/web/app/components/workflow/panel/debug-and-preview/__tests__/hooks/handle-resume.spec.ts +++ b/web/app/components/workflow/panel/debug-and-preview/__tests__/hooks/handle-resume.spec.ts @@ -782,7 +782,7 @@ describe('useChat – handleResume', () => { act(() => { capturedResumeOptions.onHumanInputFormFilled({ - data: { node_id: 'rn-human', form_data: { a: 1 } }, + data: { node_id: 'rn-human', submitted_data: { a: 1 } }, }) }) @@ -796,7 +796,7 @@ describe('useChat – handleResume', () => { act(() => { capturedResumeOptions.onHumanInputFormFilled({ - data: { node_id: 'rn-human', form_data: { b: 2 } }, + data: { node_id: 'rn-human', submitted_data: { b: 2 } }, }) }) @@ -937,7 +937,7 @@ describe('useChat – handleResume with bare prevChatTree (no humanInputFormData act(() => { capturedResumeOptions.onHumanInputFormFilled({ - data: { node_id: 'hn-bare', form_data: { x: 1 } }, + data: { node_id: 'hn-bare', submitted_data: { x: 1 } }, }) }) diff --git a/web/app/components/workflow/panel/debug-and-preview/__tests__/hooks/sse-callbacks.spec.ts b/web/app/components/workflow/panel/debug-and-preview/__tests__/hooks/sse-callbacks.spec.ts index 109078db80..a67165fba6 100644 --- a/web/app/components/workflow/panel/debug-and-preview/__tests__/hooks/sse-callbacks.spec.ts +++ b/web/app/components/workflow/panel/debug-and-preview/__tests__/hooks/sse-callbacks.spec.ts @@ -868,7 +868,7 @@ describe('useChat – handleSend SSE callbacks', () => { act(() => { capturedCallbacks.onHumanInputFormFilled({ - data: { node_id: 'human-node', form_data: { answer: 'yes' } }, + data: { node_id: 'human-node', submitted_data: { answer: 'yes' } }, }) }) @@ -876,7 +876,7 @@ describe('useChat – handleSend SSE callbacks', () => { expect(answer!.humanInputFormDataList).toHaveLength(0) expect(answer!.humanInputFilledFormDataList).toHaveLength(1) expect(answer!.humanInputFilledFormDataList![0]!.node_id).toBe('human-node') - expect((answer!.humanInputFilledFormDataList![0] as any).form_data).toEqual({ answer: 'yes' }) + expect(answer!.humanInputFilledFormDataList![0]!.submitted_data).toEqual({ answer: 'yes' }) expect(answer!.humanInputFilledFormDataList![0]).toEqual(expect.objectContaining({ form_content: '{{#$output.answer#}}', inputs: [], diff --git a/web/types/workflow.ts b/web/types/workflow.ts index 4bcd9fec45..66297ba5c2 100644 --- a/web/types/workflow.ts +++ b/web/types/workflow.ts @@ -355,7 +355,7 @@ export type HumanInputFilledFormData = { action_text: string form_content?: string inputs?: FormInputItem[] - form_data?: Record + submitted_data?: Record } export type HumanInputFormFilledResponse = {