diff --git a/web/app/components/rag-pipeline/components/input-field/dialog-wrapper.tsx b/web/app/components/rag-pipeline/components/input-field/dialog-wrapper.tsx index 552be5cd6c..42fdf46567 100644 --- a/web/app/components/rag-pipeline/components/input-field/dialog-wrapper.tsx +++ b/web/app/components/rag-pipeline/components/input-field/dialog-wrapper.tsx @@ -1,47 +1,58 @@ -import { Fragment, useCallback } from 'react' +import { useCallback } from 'react' import type { ReactNode } from 'react' import { Dialog, DialogPanel, Transition, TransitionChild } from '@headlessui/react' import cn from '@/utils/classnames' type DialogWrapperProps = { + dialogClassName?: string className?: string panelWrapperClassName?: string + outerWrapperClassName?: string children: ReactNode show: boolean onClose?: () => void } const DialogWrapper = ({ + dialogClassName, className, panelWrapperClassName, + outerWrapperClassName, children, show, onClose, }: DialogWrapperProps) => { const close = useCallback(() => onClose?.(), [onClose]) return ( - - + + -
+
-
+
- + {children} diff --git a/web/app/components/rag-pipeline/components/input-field/editor/dialog-wrapper.tsx b/web/app/components/rag-pipeline/components/input-field/editor/dialog-wrapper.tsx deleted file mode 100644 index 1cfaebb69d..0000000000 --- a/web/app/components/rag-pipeline/components/input-field/editor/dialog-wrapper.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import { Fragment, useCallback } from 'react' -import type { ReactNode } from 'react' -import { Dialog, DialogPanel, Transition, TransitionChild } from '@headlessui/react' -import cn from '@/utils/classnames' - -type DialogWrapperProps = { - className?: string - panelWrapperClassName?: string - children: ReactNode - show: boolean - onClose?: () => void -} - -const DialogWrapper = ({ - className, - panelWrapperClassName, - children, - show, - onClose, -}: DialogWrapperProps) => { - const close = useCallback(() => onClose?.(), [onClose]) - return ( - - - -
- - -
-
- - - {children} - - -
-
-
-
- ) -} - -export default DialogWrapper diff --git a/web/app/components/rag-pipeline/components/input-field/editor/index.tsx b/web/app/components/rag-pipeline/components/input-field/editor/index.tsx index 6aef4e4186..494846a627 100644 --- a/web/app/components/rag-pipeline/components/input-field/editor/index.tsx +++ b/web/app/components/rag-pipeline/components/input-field/editor/index.tsx @@ -1,5 +1,5 @@ import { RiCloseLine } from '@remixicon/react' -import DialogWrapper from './dialog-wrapper' +import DialogWrapper from '../dialog-wrapper' import InputFieldForm from './form' import { convertFormDataToINputField, convertToInputFieldFormData } from './utils' import { useCallback } from 'react' @@ -33,7 +33,9 @@ const InputFieldEditor = ({
{initialData ? t('datasetPipeline.inputFieldPanel.editInputField') : t('datasetPipeline.inputFieldPanel.addInputField')} diff --git a/web/app/components/rag-pipeline/components/input-field/index.tsx b/web/app/components/rag-pipeline/components/input-field/index.tsx index 81eb4c7809..401001d418 100644 --- a/web/app/components/rag-pipeline/components/input-field/index.tsx +++ b/web/app/components/rag-pipeline/components/input-field/index.tsx @@ -94,6 +94,7 @@ const InputFieldDialog = ({
diff --git a/web/app/components/rag-pipeline/components/input-field/preview/dialog-wrapper.tsx b/web/app/components/rag-pipeline/components/input-field/preview/dialog-wrapper.tsx deleted file mode 100644 index 087ad42089..0000000000 --- a/web/app/components/rag-pipeline/components/input-field/preview/dialog-wrapper.tsx +++ /dev/null @@ -1,54 +0,0 @@ -import { Fragment, useCallback } from 'react' -import type { ReactNode } from 'react' -import { Dialog, DialogPanel, Transition, TransitionChild } from '@headlessui/react' -import cn from '@/utils/classnames' - -type DialogWrapperProps = { - className?: string - panelWrapperClassName?: string - children: ReactNode - show: boolean - onClose?: () => void -} - -const DialogWrapper = ({ - className, - panelWrapperClassName, - children, - show, - onClose, -}: DialogWrapperProps) => { - const close = useCallback(() => onClose?.(), [onClose]) - return ( - - - -
- - -
-
- - - {children} - - -
-
-
-
- ) -} - -export default DialogWrapper diff --git a/web/app/components/rag-pipeline/components/input-field/preview/index.tsx b/web/app/components/rag-pipeline/components/input-field/preview/index.tsx index d3ca95cb56..6693444356 100644 --- a/web/app/components/rag-pipeline/components/input-field/preview/index.tsx +++ b/web/app/components/rag-pipeline/components/input-field/preview/index.tsx @@ -1,6 +1,6 @@ import { useState } from 'react' import { RiCloseLine } from '@remixicon/react' -import DialogWrapper from './dialog-wrapper' +import DialogWrapper from '../dialog-wrapper' import { useTranslation } from 'react-i18next' import Badge from '@/app/components/base/badge' import DataSource from './data-source' @@ -24,7 +24,8 @@ const PreviewPanel = ({