From fd8ee9f53eb98d877f7a1ebe0d78e3d1a41b9141 Mon Sep 17 00:00:00 2001 From: twwu Date: Sun, 27 Apr 2025 15:29:11 +0800 Subject: [PATCH] Refactor input field form components and schema --- .../field/input-type-select/index.tsx | 6 +- .../base/form/form-scenarios/base/field.tsx | 4 - .../base/form/form-scenarios/base/index.tsx | 2 +- .../base/form/form-scenarios/base/types.ts | 4 +- .../form/form-scenarios/input-field/field.tsx | 221 ++++++++++++ .../form-scenarios/input-field/hooks/index.ts | 103 ------ .../hooks/use-file-types-fields.tsx | 83 ----- .../hooks/use-max-number-of-uploads-filed.tsx | 75 ---- .../hooks/use-upload-method-field.tsx | 64 ---- .../form/form-scenarios/input-field/index.tsx | 328 ------------------ .../form/form-scenarios/input-field/types.ts | 136 ++------ .../form/form-scenarios/input-field/utils.ts | 65 ++++ web/app/components/base/form/index.tsx | 4 +- .../input-field/editor/form/hooks.ts | 303 ++++++++++++++++ .../input-field/editor/form/index.tsx | 129 +++++++ .../input-field/editor/form/schema.ts | 98 ++++++ .../editor/form}/show-all-settings.tsx | 0 .../input-field/editor/form/types.ts | 31 ++ .../{editor.tsx => editor/index.tsx} | 9 +- .../components/input-field/editor/utils.ts | 39 +++ web/utils/var.ts | 3 +- 21 files changed, 933 insertions(+), 774 deletions(-) create mode 100644 web/app/components/base/form/form-scenarios/input-field/field.tsx delete mode 100644 web/app/components/base/form/form-scenarios/input-field/hooks/index.ts delete mode 100644 web/app/components/base/form/form-scenarios/input-field/hooks/use-file-types-fields.tsx delete mode 100644 web/app/components/base/form/form-scenarios/input-field/hooks/use-max-number-of-uploads-filed.tsx delete mode 100644 web/app/components/base/form/form-scenarios/input-field/hooks/use-upload-method-field.tsx delete mode 100644 web/app/components/base/form/form-scenarios/input-field/index.tsx create mode 100644 web/app/components/base/form/form-scenarios/input-field/utils.ts create mode 100644 web/app/components/rag-pipeline/components/input-field/editor/form/hooks.ts create mode 100644 web/app/components/rag-pipeline/components/input-field/editor/form/index.tsx create mode 100644 web/app/components/rag-pipeline/components/input-field/editor/form/schema.ts rename web/app/components/{base/form/form-scenarios/input-field => rag-pipeline/components/input-field/editor/form}/show-all-settings.tsx (100%) create mode 100644 web/app/components/rag-pipeline/components/input-field/editor/form/types.ts rename web/app/components/rag-pipeline/components/input-field/{editor.tsx => editor/index.tsx} (84%) create mode 100644 web/app/components/rag-pipeline/components/input-field/editor/utils.ts diff --git a/web/app/components/base/form/components/field/input-type-select/index.tsx b/web/app/components/base/form/components/field/input-type-select/index.tsx index 983b7f1883..279c0ff43e 100644 --- a/web/app/components/base/form/components/field/input-type-select/index.tsx +++ b/web/app/components/base/form/components/field/input-type-select/index.tsx @@ -12,14 +12,14 @@ import Option from './option' type InputTypeSelectFieldProps = { label: string - labeOptions?: Omit + labelOptions?: Omit supportFile: boolean className?: string } & Omit, 'options' | 'value' | 'onChange' | 'CustomTrigger' | 'CustomOption'> const InputTypeSelectField = ({ label, - labeOptions, + labelOptions, supportFile, className, ...customSelectProps @@ -39,7 +39,7 @@ const InputTypeSelectField = ({