diff --git a/web/app/components/app/configuration/config-var/config-modal/index.tsx b/web/app/components/app/configuration/config-var/config-modal/index.tsx index 194ee12e2e..f8510a5cb8 100644 --- a/web/app/components/app/configuration/config-var/config-modal/index.tsx +++ b/web/app/components/app/configuration/config-var/config-modal/index.tsx @@ -153,12 +153,12 @@ const ConfigModal: FC = ({ } else if ([InputVarType.singleFile, InputVarType.multiFiles].includes(type)) { if (tempPayload.allowed_file_types?.length === 0) { - const errorMessages = t('workflow.errorMsg.fieldRequired', { field: t('appDebug.variableConig.file.supportFileTypes') }) + const errorMessages = t('workflow.errorMsg.fieldRequired', { field: t('appDebug.variableConfig.file.supportFileTypes') }) Toast.notify({ type: 'error', message: errorMessages }) return } if (tempPayload.allowed_file_types?.includes(SupportUploadFileTypes.custom) && !tempPayload.allowed_file_extensions?.length) { - const errorMessages = t('workflow.errorMsg.fieldRequired', { field: t('appDebug.variableConig.file.custom.name') }) + const errorMessages = t('workflow.errorMsg.fieldRequired', { field: t('appDebug.variableConfig.file.custom.name') }) Toast.notify({ type: 'error', message: errorMessages }) return } @@ -178,7 +178,7 @@ const ConfigModal: FC = ({
- +
@@ -191,7 +191,7 @@ const ConfigModal: FC = ({
- + handlePayloadChange('variable')(e.target.value)} @@ -199,7 +199,7 @@ const ConfigModal: FC = ({ placeholder={t('appDebug.variableConfig.inputPlaceholder')!} /> - + handlePayloadChange('label')(e.target.value)} @@ -229,7 +229,7 @@ const ConfigModal: FC = ({
handlePayloadChange('required')(!tempPayload.required)} /> - {t('appDebug.variableConig.required')} + {t('appDebug.variableConfig.required')}
diff --git a/web/app/components/app/configuration/config-var/select-type-item/index.tsx b/web/app/components/app/configuration/config-var/select-type-item/index.tsx index f96e80cb78..b71486b4eb 100644 --- a/web/app/components/app/configuration/config-var/select-type-item/index.tsx +++ b/web/app/components/app/configuration/config-var/select-type-item/index.tsx @@ -22,7 +22,7 @@ const SelectTypeItem: FC = ({ onClick, }) => { const { t } = useTranslation() - const typeName = t(`appDebug.variableConig.${i18nFileTypeMap[type] || type}`) + const typeName = t(`appDebug.variableConfig.${i18nFileTypeMap[type] || type}`) return (
(({ ref={ref} >
- + {visionConfig?.enabled && } { speechToTextConfig?.enabled && ( { setTempSuggestedQuestions([...tempSuggestedQuestions, '']) }} className='mt-1 flex items-center h-9 px-3 gap-2 rounded-lg cursor-pointer text-gray-400 bg-gray-100 hover:bg-gray-200'> -
{t('appDebug.variableConig.addOption')}
+
{t('appDebug.variableConfig.addOption')}
)}
diff --git a/web/app/components/workflow/hooks/use-nodes-sync-draft.ts b/web/app/components/workflow/hooks/use-nodes-sync-draft.ts index 203386f5a7..a25a4f1812 100644 --- a/web/app/components/workflow/hooks/use-nodes-sync-draft.ts +++ b/web/app/components/workflow/hooks/use-nodes-sync-draft.ts @@ -75,8 +75,8 @@ export const useNodesSyncDraft = () => { }, }, features: { - opening_statement: features.opening?.opening_statement || '', - suggested_questions: features.opening?.suggested_questions || [], + opening_statement: features.opening?.enabled ? (features.opening?.opening_statement || '') : '', + suggested_questions: features.opening?.enabled ? (features.opening?.suggested_questions || []) : [], suggested_questions_after_answer: features.suggested, text_to_speech: features.text2speech, speech_to_text: features.speech2text, diff --git a/web/app/components/workflow/nodes/_base/components/before-run-form/form-item.tsx b/web/app/components/workflow/nodes/_base/components/before-run-form/form-item.tsx index 6b66fe89cf..30b6a66171 100644 --- a/web/app/components/workflow/nodes/_base/components/before-run-form/form-item.tsx +++ b/web/app/components/workflow/nodes/_base/components/before-run-form/form-item.tsx @@ -15,6 +15,7 @@ import Select from '@/app/components/base/select' import Input from '@/app/components/base/input' import Textarea from '@/app/components/base/textarea' import TextGenerationImageUploader from '@/app/components/base/image-uploader/text-generation-image-uploader' +import { FileUploaderInAttachmentWrapper } from '@/app/components/base/file-uploader' import { Resolution } from '@/types/app' import { useFeatures } from '@/app/components/base/features/hooks' import { VarBlockIcon } from '@/app/components/workflow/block-icon' @@ -156,7 +157,10 @@ const FormItem: FC = ({ ) } - {/* #TODO# file type new form */} + {/* #TODO# file upload */} + {(type === InputVarType.singleFile || type === InputVarType.multiFiles) && ( + {}} /> + )} { type === InputVarType.files && ( = ({
-
{t(`appDebug.variableConig.file.${type}.name`)}
+
{t(`appDebug.variableConfig.file.${type}.name`)}
e.stopPropagation()}>
@@ -63,8 +63,8 @@ const FileTypeItem: FC = ({ {/* TODO: Wait File type icon */}
-
{t(`appDebug.variableConig.file.${type}.name`)}
-
{type !== SupportUploadFileTypes.custom ? FILE_EXTS[type].join(', ') : t('appDebug.variableConig.file.custom.description')}
+
{t(`appDebug.variableConfig.file.${type}.name`)}
+
{type !== SupportUploadFileTypes.custom ? FILE_EXTS[type].join(', ') : t('appDebug.variableConfig.file.custom.description')}
diff --git a/web/app/components/workflow/nodes/_base/components/file-upload-setting.tsx b/web/app/components/workflow/nodes/_base/components/file-upload-setting.tsx index d915f59036..21f33aad0a 100644 --- a/web/app/components/workflow/nodes/_base/components/file-upload-setting.tsx +++ b/web/app/components/workflow/nodes/_base/components/file-upload-setting.tsx @@ -87,7 +87,7 @@ const FileUploadSetting: FC = ({
{!inFeaturePanel && (
{ @@ -135,10 +135,10 @@ const FileUploadSetting: FC = ({ {isMultiple && (
-
{t('appDebug.variableConig.maxNumberTip')}
+
{t('appDebug.variableConfig.maxNumberTip')}
= ({ )} {inFeaturePanel && (
diff --git a/web/app/components/workflow/panel/debug-and-preview/chat-wrapper.tsx b/web/app/components/workflow/panel/debug-and-preview/chat-wrapper.tsx index 3b71fa284d..101125c290 100644 --- a/web/app/components/workflow/panel/debug-and-preview/chat-wrapper.tsx +++ b/web/app/components/workflow/panel/debug-and-preview/chat-wrapper.tsx @@ -42,8 +42,8 @@ const ChatWrapper = forwardRef(({ showConv const features = useFeatures(s => s.features) const config = useMemo(() => { return { - opening_statement: features.opening?.opening_statement || '', - suggested_questions: features.opening?.suggested_questions || [], + opening_statement: features.opening?.enabled ? (features.opening?.opening_statement || '') : '', + suggested_questions: features.opening?.enabled ? (features.opening?.suggested_questions || []) : [], suggested_questions_after_answer: features.suggested, text_to_speech: features.text2speech, speech_to_text: features.speech2text, @@ -51,7 +51,7 @@ const ChatWrapper = forwardRef(({ showConv sensitive_word_avoidance: features.moderation, file_upload: features.file, } - }, [features]) + }, [features.opening, features.suggested, features.text2speech, features.speech2text, features.citation, features.moderation, features.file]) const setShowFeaturesPanel = useStore(s => s.setShowFeaturesPanel) const { @@ -104,7 +104,8 @@ const ChatWrapper = forwardRef(({ showConv chatContainerClassName='px-3' chatContainerInnerClassName='pt-6 w-full max-w-full mx-auto' chatFooterClassName='px-4 rounded-bl-2xl' - chatFooterInnerClassName='pb-2' + chatFooterInnerClassName='pb-0' + showFileUpload showFeatureBar onFeatureBarClick={setShowFeaturesPanel} onSend={doSend} diff --git a/web/app/components/workflow/panel/debug-and-preview/index.tsx b/web/app/components/workflow/panel/debug-and-preview/index.tsx index c6647d79b8..08db7d8092 100644 --- a/web/app/components/workflow/panel/debug-and-preview/index.tsx +++ b/web/app/components/workflow/panel/debug-and-preview/index.tsx @@ -85,6 +85,7 @@ const DebugAndPreview = () => { + {expanded &&
}
)}