diff --git a/web/app/components/base/chat/chat/answer/human-input-form-list.tsx b/web/app/components/base/chat/chat/answer/human-input-form-list.tsx index 93e6975853..65b5f24c33 100644 --- a/web/app/components/base/chat/chat/answer/human-input-form-list.tsx +++ b/web/app/components/base/chat/chat/answer/human-input-form-list.tsx @@ -41,10 +41,14 @@ const HumanInputFormList = ({ }, {} as Record) }, [getHumanInputNodeData, humanInputFormDataList]) + const filteredHumanInputFormDataList = useMemo(() => { + return humanInputFormDataList.filter(formData => formData.display_in_ui) + }, [humanInputFormDataList]) + return (
{ - humanInputFormDataList.map(formData => ( + filteredHumanInputFormDataList.map(formData => ( > = (props) => {
Timeout
diff --git a/web/app/components/workflow/nodes/human-input/panel.tsx b/web/app/components/workflow/nodes/human-input/panel.tsx index b49845e457..7b02124094 100644 --- a/web/app/components/workflow/nodes/human-input/panel.tsx +++ b/web/app/components/workflow/nodes/human-input/panel.tsx @@ -205,6 +205,16 @@ const Panel: FC> = ({ /> )) } + + {isPreview && ( diff --git a/web/app/components/workflow/panel/human-input-form-list.tsx b/web/app/components/workflow/panel/human-input-form-list.tsx index d8557edc56..e032bfbb89 100644 --- a/web/app/components/workflow/panel/human-input-form-list.tsx +++ b/web/app/components/workflow/panel/human-input-form-list.tsx @@ -52,10 +52,14 @@ const HumanInputFormList = ({ }, {} as Record) }, [getHumanInputNodeData, humanInputFormDataList]) + const filteredHumanInputFormDataList = useMemo(() => { + return humanInputFormDataList.filter(formData => formData.display_in_ui) + }, [humanInputFormDataList]) + return (
{ - humanInputFormDataList.map(formData => ( + filteredHumanInputFormDataList.map(formData => ( { inputs: FormInputItem[] user_actions: UserAction[] expiration_time: number - }>(`/api/form/human_input/${token}`) + }>(`/form/human_input/${token}`) } export const submitHumanInputForm = (token: string, data: { inputs: Record action: string }) => { - return post(`/api/form/human_input/${token}`, { body: data }) + return post(`/form/human_input/${token}`, { body: data }) } diff --git a/web/types/workflow.ts b/web/types/workflow.ts index 0f68f84e24..bc34abafdc 100644 --- a/web/types/workflow.ts +++ b/web/types/workflow.ts @@ -321,7 +321,8 @@ export type HumanInputFormData = { inputs: FormInputItem[] actions: UserAction[] form_token: string - resolved_placeholder_values: Record // For human input placeholder when its type is variable + resolved_placeholder_values: Record + display_in_ui: boolean } export type HumanInputRequiredResponse = {