diff --git a/web/app/components/app/annotation/batch-add-annotation-modal/index.tsx b/web/app/components/app/annotation/batch-add-annotation-modal/index.tsx index 117536e0be..8f4e9079ef 100644 --- a/web/app/components/app/annotation/batch-add-annotation-modal/index.tsx +++ b/web/app/components/app/annotation/batch-add-annotation-modal/index.tsx @@ -11,6 +11,7 @@ import Toast from '@/app/components/base/toast' import { annotationBatchImport, checkAnnotationBatchImportProgress } from '@/service/annotation' import { useProviderContext } from '@/context/provider-context' import AnnotationFull from '@/app/components/billing/annotation-full' +import { noop } from 'lodash-es' export enum ProcessStatus { WAITING = 'waiting', @@ -87,7 +88,7 @@ const BatchModal: FC = ({ } return ( - { }} className='!max-w-[520px] !rounded-xl px-8 py-6'> +
{t('appAnnotation.batchModal.title')}
diff --git a/web/app/components/app/configuration/base/operation-btn/index.tsx b/web/app/components/app/configuration/base/operation-btn/index.tsx index 508d9e745d..aba35cded2 100644 --- a/web/app/components/app/configuration/base/operation-btn/index.tsx +++ b/web/app/components/app/configuration/base/operation-btn/index.tsx @@ -7,6 +7,7 @@ import { RiEditLine, } from '@remixicon/react' import cn from '@/utils/classnames' +import { noop } from 'lodash-es' export type IOperationBtnProps = { className?: string @@ -24,7 +25,7 @@ const OperationBtn: FC = ({ className, type, actionName, - onClick = () => { }, + onClick = noop, }) => { const { t } = useTranslation() return ( diff --git a/web/app/components/app/configuration/config-prompt/simple-prompt-input.tsx b/web/app/components/app/configuration/config-prompt/simple-prompt-input.tsx index 64c0924f86..90d440aba5 100644 --- a/web/app/components/app/configuration/config-prompt/simple-prompt-input.tsx +++ b/web/app/components/app/configuration/config-prompt/simple-prompt-input.tsx @@ -27,6 +27,7 @@ import { INSERT_VARIABLE_VALUE_BLOCK_COMMAND } from '@/app/components/base/promp import { PROMPT_EDITOR_UPDATE_VALUE_BY_EVENT_EMITTER } from '@/app/components/base/prompt-editor/plugins/update-block' import useBreakpoints, { MediaType } from '@/hooks/use-breakpoints' import { useFeaturesStore } from '@/app/components/base/features/hooks' +import { noop } from 'lodash-es' export type ISimplePromptInput = { mode: AppType @@ -233,7 +234,7 @@ const Prompt: FC = ({ user: '', assistant: '', }, - onEditRole: () => { }, + onEditRole: noop, }} queryBlock={{ show: false, diff --git a/web/app/components/app/configuration/config/agent/prompt-editor.tsx b/web/app/components/app/configuration/config/agent/prompt-editor.tsx index 550dd0a56c..7f7f140eda 100644 --- a/web/app/components/app/configuration/config/agent/prompt-editor.tsx +++ b/web/app/components/app/configuration/config/agent/prompt-editor.tsx @@ -14,8 +14,9 @@ import type { ExternalDataTool } from '@/models/common' import ConfigContext from '@/context/debug-configuration' import { useModalContext } from '@/context/modal-context' import { useToastContext } from '@/app/components/base/toast' - import s from '@/app/components/app/configuration/config-prompt/style.module.css' +import { noop } from 'lodash-es' + type Props = { className?: string type: 'first-prompt' | 'next-iteration' @@ -128,14 +129,14 @@ const Editor: FC = ({ user: '', assistant: '', }, - onEditRole: () => { }, + onEditRole: noop, }} queryBlock={{ show: false, selectable: false, }} onChange={onChange} - onBlur={() => { }} + onBlur={noop} />
diff --git a/web/app/components/app/configuration/dataset-config/params-config/weighted-score.tsx b/web/app/components/app/configuration/dataset-config/params-config/weighted-score.tsx index 2d63d6c4c4..5f0ad94d86 100644 --- a/web/app/components/app/configuration/dataset-config/params-config/weighted-score.tsx +++ b/web/app/components/app/configuration/dataset-config/params-config/weighted-score.tsx @@ -3,6 +3,7 @@ import { useTranslation } from 'react-i18next' import './weighted-score.css' import Slider from '@/app/components/base/slider' import cn from '@/utils/classnames' +import { noop } from 'lodash-es' const formatNumber = (value: number) => { if (value > 0 && value < 1) @@ -23,7 +24,7 @@ type WeightedScoreProps = { } const WeightedScore = ({ value, - onChange = () => {}, + onChange = noop, }: WeightedScoreProps) => { const { t } = useTranslation() diff --git a/web/app/components/app/configuration/debug/debug-with-multiple-model/context.tsx b/web/app/components/app/configuration/debug/debug-with-multiple-model/context.tsx index d95faf7ae9..1fcd878c44 100644 --- a/web/app/components/app/configuration/debug/debug-with-multiple-model/context.tsx +++ b/web/app/components/app/configuration/debug/debug-with-multiple-model/context.tsx @@ -2,6 +2,7 @@ import { createContext, useContext } from 'use-context-selector' import type { ModelAndParameter } from '../types' +import { noop } from 'lodash-es' export type DebugWithMultipleModelContextType = { multipleModelConfigs: ModelAndParameter[] @@ -11,8 +12,8 @@ export type DebugWithMultipleModelContextType = { } const DebugWithMultipleModelContext = createContext({ multipleModelConfigs: [], - onMultipleModelConfigsChange: () => {}, - onDebugWithMultipleModelChange: () => {}, + onMultipleModelConfigsChange: noop, + onDebugWithMultipleModelChange: noop, }) export const useDebugWithMultipleModelContext = () => useContext(DebugWithMultipleModelContext) diff --git a/web/app/components/app/configuration/debug/debug-with-multiple-model/text-generation-item.tsx b/web/app/components/app/configuration/debug/debug-with-multiple-model/text-generation-item.tsx index 4110c0a58a..8f8555efa4 100644 --- a/web/app/components/app/configuration/debug/debug-with-multiple-model/text-generation-item.tsx +++ b/web/app/components/app/configuration/debug/debug-with-multiple-model/text-generation-item.tsx @@ -14,6 +14,7 @@ import { TransferMethod } from '@/app/components/base/chat/types' import { useEventEmitterContextContext } from '@/context/event-emitter' import { useProviderContext } from '@/context/provider-context' import { useFeatures } from '@/app/components/base/features/hooks' +import { noop } from 'lodash-es' type TextGenerationItemProps = { modelAndParameter: ModelAndParameter @@ -134,7 +135,7 @@ const TextGenerationItem: FC = ({ siteInfo={null} messageId={messageId} isError={false} - onRetry={() => { }} + onRetry={noop} inSidePanel /> ) diff --git a/web/app/components/app/configuration/debug/index.tsx b/web/app/components/app/configuration/debug/index.tsx index 6ec400c6a5..477328dad3 100644 --- a/web/app/components/app/configuration/debug/index.tsx +++ b/web/app/components/app/configuration/debug/index.tsx @@ -47,6 +47,7 @@ import AgentLogModal from '@/app/components/base/agent-log-modal' import PromptLogModal from '@/app/components/base/prompt-log-modal' import { useStore as useAppStore } from '@/app/components/app/store' import { useFeatures, useFeaturesStore } from '@/app/components/base/features/hooks' +import { noop } from 'lodash-es' type IDebug = { isAPIKeySet: boolean @@ -515,7 +516,7 @@ const Debug: FC = ({ isInstalledApp={false} messageId={messageId} isError={false} - onRetry={() => { }} + onRetry={noop} siteInfo={null} />
diff --git a/web/app/components/app/configuration/tools/external-data-tool-modal.tsx b/web/app/components/app/configuration/tools/external-data-tool-modal.tsx index 70b0c120b8..9040de1b29 100644 --- a/web/app/components/app/configuration/tools/external-data-tool-modal.tsx +++ b/web/app/components/app/configuration/tools/external-data-tool-modal.tsx @@ -19,6 +19,7 @@ import type { } from '@/models/common' import { useToastContext } from '@/app/components/base/toast' import AppIcon from '@/app/components/base/app-icon' +import { noop } from 'lodash-es' const systemTypes = ['api'] type ExternalDataToolModalProps = { @@ -185,7 +186,7 @@ const ExternalDataToolModal: FC = ({ return ( { }} + onClose={noop} className='!w-[640px] !max-w-none !p-8 !pb-6' >
diff --git a/web/app/components/app/create-from-dsl-modal/index.tsx b/web/app/components/app/create-from-dsl-modal/index.tsx index 8c4f386c7c..e9124bd13b 100644 --- a/web/app/components/app/create-from-dsl-modal/index.tsx +++ b/web/app/components/app/create-from-dsl-modal/index.tsx @@ -26,6 +26,7 @@ import { NEED_REFRESH_APP_LIST_KEY } from '@/config' import { getRedirection } from '@/utils/app-redirection' import cn from '@/utils/classnames' import { usePluginDependencies } from '@/app/components/workflow/plugin-dependency/hooks' +import { noop } from 'lodash-es' type CreateFromDSLModalProps = { show: boolean @@ -203,7 +204,7 @@ const CreateFromDSLModal = ({ show, onSuccess, onClose, activeTab = CreateFromDS { }} + onClose={noop} >
{t('app.importFromDSL')} diff --git a/web/app/components/app/duplicate-modal/index.tsx b/web/app/components/app/duplicate-modal/index.tsx index f0500706e5..f98fb831ed 100644 --- a/web/app/components/app/duplicate-modal/index.tsx +++ b/web/app/components/app/duplicate-modal/index.tsx @@ -12,6 +12,7 @@ import AppIcon from '@/app/components/base/app-icon' import { useProviderContext } from '@/context/provider-context' import AppsFull from '@/app/components/billing/apps-full-in-dialog' import type { AppIconType } from '@/types/app' +import { noop } from 'lodash-es' export type DuplicateAppModalProps = { appName: string @@ -71,7 +72,7 @@ const DuplicateAppModal = ({ <> { }} + onClose={noop} className={cn('relative !max-w-[480px]', 'px-8')} >
diff --git a/web/app/components/app/log/list.tsx b/web/app/components/app/log/list.tsx index 0ca80c3ec3..c4e46af107 100644 --- a/web/app/components/app/log/list.tsx +++ b/web/app/components/app/log/list.tsx @@ -41,6 +41,7 @@ import { CopyIcon } from '@/app/components/base/copy-icon' import { buildChatItemTree, getThreadMessages } from '@/app/components/base/chat/utils' import { getProcessedFilesFromResponse } from '@/app/components/base/file-uploader/utils' import cn from '@/utils/classnames' +import { noop } from 'lodash-es' dayjs.extend(utc) dayjs.extend(timezone) @@ -411,7 +412,7 @@ function DetailPanel({ detail, onFeedback }: IDetailPanel) { content={detail.message.answer} messageId={detail.message.id} isError={false} - onRetry={() => { }} + onRetry={noop} isInstalledApp={false} supportFeedback feedback={detail.message.feedbacks.find((item: any) => item.from_source === 'admin')} diff --git a/web/app/components/app/switch-app-modal/index.tsx b/web/app/components/app/switch-app-modal/index.tsx index 9bb0f4103e..e2bab94b59 100644 --- a/web/app/components/app/switch-app-modal/index.tsx +++ b/web/app/components/app/switch-app-modal/index.tsx @@ -23,6 +23,7 @@ import type { App } from '@/types/app' import { AlertTriangle } from '@/app/components/base/icons/src/vender/solid/alertsAndFeedback' import AppIcon from '@/app/components/base/app-icon' import { useStore as useAppStore } from '@/app/components/app/store' +import { noop } from 'lodash-es' type SwitchAppModalProps = { show: boolean @@ -96,7 +97,7 @@ const SwitchAppModal = ({ show, appDetail, inAppDetail = false, onSuccess, onClo { }} + onClose={noop} >
diff --git a/web/app/components/base/app-icon-picker/index.tsx b/web/app/components/base/app-icon-picker/index.tsx index 9cd5173a50..8304de188c 100644 --- a/web/app/components/base/app-icon-picker/index.tsx +++ b/web/app/components/base/app-icon-picker/index.tsx @@ -15,6 +15,7 @@ import getCroppedImg from './utils' import type { AppIconType, ImageFile } from '@/types/app' import cn from '@/utils/classnames' import { DISABLE_UPLOAD_IMAGE_AS_ICON } from '@/config' +import { noop } from 'lodash-es' export type AppIconEmojiSelection = { type: 'emoji' @@ -107,7 +108,7 @@ const AppIconPicker: FC = ({ } return { }} + onClose={noop} isShow closable={false} wrapperClassName={className} diff --git a/web/app/components/base/chat/chat-with-history/context.tsx b/web/app/components/base/chat/chat-with-history/context.tsx index e5ea0d7379..7dd7a78691 100644 --- a/web/app/components/base/chat/chat-with-history/context.tsx +++ b/web/app/components/base/chat/chat-with-history/context.tsx @@ -15,6 +15,7 @@ import type { AppMeta, ConversationItem, } from '@/models/share' +import { noop } from 'lodash-es' export type ChatWithHistoryContextValue = { appInfoError?: any @@ -65,29 +66,29 @@ export const ChatWithHistoryContext = createContext conversationList: [], newConversationInputs: {}, newConversationInputsRef: { current: {} }, - handleNewConversationInputsChange: () => {}, + handleNewConversationInputsChange: noop, inputsForms: [], - handleNewConversation: () => {}, - handleStartChat: () => {}, - handleChangeConversation: () => {}, - handlePinConversation: () => {}, - handleUnpinConversation: () => {}, - handleDeleteConversation: () => {}, + handleNewConversation: noop, + handleStartChat: noop, + handleChangeConversation: noop, + handlePinConversation: noop, + handleUnpinConversation: noop, + handleDeleteConversation: noop, conversationRenaming: false, - handleRenameConversation: () => {}, - handleNewConversationCompleted: () => {}, + handleRenameConversation: noop, + handleNewConversationCompleted: noop, chatShouldReloadKey: '', isMobile: false, isInstalledApp: false, - handleFeedback: () => {}, - currentChatInstanceRef: { current: { handleStop: () => {} } }, + handleFeedback: noop, + currentChatInstanceRef: { current: { handleStop: noop } }, sidebarCollapseState: false, - handleSidebarCollapse: () => {}, + handleSidebarCollapse: noop, clearChatList: false, - setClearChatList: () => {}, + setClearChatList: noop, isResponding: false, - setIsResponding: () => {}, + setIsResponding: noop, currentConversationInputs: {}, - setCurrentConversationInputs: () => {}, + setCurrentConversationInputs: noop, }) export const useChatWithHistoryContext = () => useContext(ChatWithHistoryContext) diff --git a/web/app/components/base/chat/chat-with-history/hooks.tsx b/web/app/components/base/chat/chat-with-history/hooks.tsx index adf4cc7e57..88f6c8f616 100644 --- a/web/app/components/base/chat/chat-with-history/hooks.tsx +++ b/web/app/components/base/chat/chat-with-history/hooks.tsx @@ -42,6 +42,7 @@ import { changeLanguage } from '@/i18n/i18next-config' import { useAppFavicon } from '@/hooks/use-app-favicon' import { InputVarType } from '@/app/components/workflow/types' import { TransferMethod } from '@/types/app' +import { noop } from 'lodash-es' function getFormattedChatList(messages: any[]) { const newChatList: ChatItem[] = [] @@ -318,7 +319,7 @@ export const useChatWithHistory = (installedAppInfo?: InstalledApp) => { callback?.() } }, [setShowNewConversationItemInList, checkInputsRequired]) - const currentChatInstanceRef = useRef<{ handleStop: () => void }>({ handleStop: () => { } }) + const currentChatInstanceRef = useRef<{ handleStop: () => void }>({ handleStop: noop }) const handleChangeConversation = useCallback((conversationId: string) => { currentChatInstanceRef.current.handleStop() setNewConversationId('') diff --git a/web/app/components/base/chat/embedded-chatbot/context.tsx b/web/app/components/base/chat/embedded-chatbot/context.tsx index d2ea4b02ba..eb5e9d697f 100644 --- a/web/app/components/base/chat/embedded-chatbot/context.tsx +++ b/web/app/components/base/chat/embedded-chatbot/context.tsx @@ -14,6 +14,7 @@ import type { AppMeta, ConversationItem, } from '@/models/share' +import { noop } from 'lodash-es' export type EmbeddedChatbotContextValue = { appInfoError?: any @@ -57,22 +58,22 @@ export const EmbeddedChatbotContext = createContext conversationList: [], newConversationInputs: {}, newConversationInputsRef: { current: {} }, - handleNewConversationInputsChange: () => {}, + handleNewConversationInputsChange: noop, inputsForms: [], - handleNewConversation: () => {}, - handleStartChat: () => {}, - handleChangeConversation: () => {}, - handleNewConversationCompleted: () => {}, + handleNewConversation: noop, + handleStartChat: noop, + handleChangeConversation: noop, + handleNewConversationCompleted: noop, chatShouldReloadKey: '', isMobile: false, isInstalledApp: false, - handleFeedback: () => {}, - currentChatInstanceRef: { current: { handleStop: () => {} } }, + handleFeedback: noop, + currentChatInstanceRef: { current: { handleStop: noop } }, clearChatList: false, - setClearChatList: () => {}, + setClearChatList: noop, isResponding: false, - setIsResponding: () => {}, + setIsResponding: noop, currentConversationInputs: {}, - setCurrentConversationInputs: () => {}, + setCurrentConversationInputs: noop, }) export const useEmbeddedChatbotContext = () => useContext(EmbeddedChatbotContext) diff --git a/web/app/components/base/chat/embedded-chatbot/hooks.tsx b/web/app/components/base/chat/embedded-chatbot/hooks.tsx index 730db3550e..197aa7649c 100644 --- a/web/app/components/base/chat/embedded-chatbot/hooks.tsx +++ b/web/app/components/base/chat/embedded-chatbot/hooks.tsx @@ -35,6 +35,7 @@ import { changeLanguage } from '@/i18n/i18next-config' import { InputVarType } from '@/app/components/workflow/types' import { TransferMethod } from '@/types/app' import { addFileInfos, sortAgentSorts } from '@/app/components/tools/utils' +import { noop } from 'lodash-es' function getFormattedChatList(messages: any[]) { const newChatList: ChatItem[] = [] @@ -294,7 +295,7 @@ export const useEmbeddedChatbot = () => { callback?.() } }, [setShowNewConversationItemInList, checkInputsRequired]) - const currentChatInstanceRef = useRef<{ handleStop: () => void }>({ handleStop: () => { } }) + const currentChatInstanceRef = useRef<{ handleStop: () => void }>({ handleStop: noop }) const handleChangeConversation = useCallback((conversationId: string) => { currentChatInstanceRef.current.handleStop() setNewConversationId('') diff --git a/web/app/components/base/emoji-picker/index.tsx b/web/app/components/base/emoji-picker/index.tsx index f909f1c3f3..d3b20bb507 100644 --- a/web/app/components/base/emoji-picker/index.tsx +++ b/web/app/components/base/emoji-picker/index.tsx @@ -7,6 +7,7 @@ import cn from '@/utils/classnames' import Divider from '@/app/components/base/divider' import Button from '@/app/components/base/button' import Modal from '@/app/components/base/modal' +import { noop } from 'lodash-es' type IEmojiPickerProps = { isModal?: boolean @@ -32,7 +33,7 @@ const EmojiPicker: FC = ({ return isModal ? { }} + onClose={noop} isShow closable={false} wrapperClassName={className} diff --git a/web/app/components/base/features/new-feature-panel/conversation-opener/modal.tsx b/web/app/components/base/features/new-feature-panel/conversation-opener/modal.tsx index 5d63639e49..117c8a5558 100644 --- a/web/app/components/base/features/new-feature-panel/conversation-opener/modal.tsx +++ b/web/app/components/base/features/new-feature-panel/conversation-opener/modal.tsx @@ -14,6 +14,7 @@ import type { PromptVariable } from '@/models/debug' import type { InputVar } from '@/app/components/workflow/types' import { getNewVar } from '@/utils/var' import cn from '@/utils/classnames' +import { noop } from 'lodash-es' type OpeningSettingModalProps = { data: OpeningStatement @@ -171,7 +172,7 @@ const OpeningSettingModal = ({ return ( { }} + onClose={noop} className='!mt-14 !w-[640px] !max-w-none !bg-components-panel-bg-blur !p-6' >
diff --git a/web/app/components/base/features/new-feature-panel/moderation/moderation-setting-modal.tsx b/web/app/components/base/features/new-feature-panel/moderation/moderation-setting-modal.tsx index 6af80ec6a1..297e2b3f02 100644 --- a/web/app/components/base/features/new-feature-panel/moderation/moderation-setting-modal.tsx +++ b/web/app/components/base/features/new-feature-panel/moderation/moderation-setting-modal.tsx @@ -24,6 +24,7 @@ import { InfoCircle } from '@/app/components/base/icons/src/vender/line/general' import { useModalContext } from '@/context/modal-context' import { CustomConfigurationStatusEnum } from '@/app/components/header/account-setting/model-provider-page/declarations' import cn from '@/utils/classnames' +import { noop } from 'lodash-es' const systemTypes = ['openai_moderation', 'keywords', 'api'] @@ -239,7 +240,7 @@ const ModerationSettingModal: FC = ({ return ( { }} + onClose={noop} className='!mt-14 !w-[600px] !max-w-none !p-6' >
diff --git a/web/app/components/base/file-uploader/hooks.ts b/web/app/components/base/file-uploader/hooks.ts index 7c82e0a04e..66d5b46ba7 100644 --- a/web/app/components/base/file-uploader/hooks.ts +++ b/web/app/components/base/file-uploader/hooks.ts @@ -28,6 +28,7 @@ import type { FileUpload } from '@/app/components/base/features/types' import { formatFileSize } from '@/utils/format' import { uploadRemoteFileInfo } from '@/service/common' import type { FileUploadConfigResponse } from '@/models/common' +import { noop } from 'lodash-es' export const useFileSizeLimit = (fileUploadConfig?: FileUploadConfigResponse) => { const imgSizeLimit = Number(fileUploadConfig?.image_file_size_limit) * 1024 * 1024 || IMG_SIZE_LIMIT @@ -243,9 +244,9 @@ export const useFile = (fileConfig: FileUpload) => { }) }, [checkSizeLimit, handleAddFile, handleUpdateFile, notify, t, handleRemoveFile, fileConfig?.allowed_file_types, fileConfig.allowed_file_extensions, startProgressTimer, params.token]) - const handleLoadFileFromLinkSuccess = useCallback(() => { }, []) + const handleLoadFileFromLinkSuccess = useCallback(noop, []) - const handleLoadFileFromLinkError = useCallback(() => { }, []) + const handleLoadFileFromLinkError = useCallback(noop, []) const handleClearFiles = useCallback(() => { const { diff --git a/web/app/components/base/file-uploader/pdf-preview.tsx b/web/app/components/base/file-uploader/pdf-preview.tsx index 54c6ae8001..f8a02e8daa 100644 --- a/web/app/components/base/file-uploader/pdf-preview.tsx +++ b/web/app/components/base/file-uploader/pdf-preview.tsx @@ -9,6 +9,7 @@ import { useHotkeys } from 'react-hotkeys-hook' import Loading from '@/app/components/base/loading' import useBreakpoints, { MediaType } from '@/hooks/use-breakpoints' import Tooltip from '@/app/components/base/tooltip' +import { noop } from 'lodash-es' type PdfPreviewProps = { url: string @@ -65,8 +66,8 @@ const PdfPreview: FC = ({ event.altKey} - scrollRef={() => { }} - onScrollChange={() => { }} + scrollRef={noop} + onScrollChange={noop} onSelectionFinished={() => null} highlightTransform={() => { return
}} highlights={[]} diff --git a/web/app/components/base/fullscreen-modal/index.tsx b/web/app/components/base/fullscreen-modal/index.tsx index 14fbded8aa..209507a09c 100644 --- a/web/app/components/base/fullscreen-modal/index.tsx +++ b/web/app/components/base/fullscreen-modal/index.tsx @@ -1,6 +1,7 @@ import { Dialog, DialogPanel, Transition, TransitionChild } from '@headlessui/react' import { RiCloseLargeLine } from '@remixicon/react' import classNames from '@/utils/classnames' +import { noop } from 'lodash-es' type IModal = { className?: string @@ -18,7 +19,7 @@ export default function FullScreenModal({ className, wrapperClassName, open, - onClose = () => { }, + onClose = noop, children, closable = false, overflowVisible = false, diff --git a/web/app/components/base/image-uploader/image-preview.tsx b/web/app/components/base/image-uploader/image-preview.tsx index 93c2ed5a5a..e67edaa3ca 100644 --- a/web/app/components/base/image-uploader/image-preview.tsx +++ b/web/app/components/base/image-uploader/image-preview.tsx @@ -6,6 +6,7 @@ import { RiAddBoxLine, RiCloseLine, RiDownloadCloud2Line, RiFileCopyLine, RiZoom import { useHotkeys } from 'react-hotkeys-hook' import Tooltip from '@/app/components/base/tooltip' import Toast from '@/app/components/base/toast' +import { noop } from 'lodash-es' type ImagePreviewProps = { url: string @@ -198,8 +199,8 @@ const ImagePreview: FC = ({ useHotkeys('esc', onCancel) useHotkeys('up', zoomIn) useHotkeys('down', zoomOut) - useHotkeys('left', onPrev || (() => { })) - useHotkeys('right', onNext || (() => { })) + useHotkeys('left', onPrev || noop) + useHotkeys('right', onNext || noop) return createPortal(
{ }, + onChange = noop, unit, ...props }: InputProps) => { diff --git a/web/app/components/base/modal/index.tsx b/web/app/components/base/modal/index.tsx index a1313322ff..dd60b00bb2 100644 --- a/web/app/components/base/modal/index.tsx +++ b/web/app/components/base/modal/index.tsx @@ -2,6 +2,7 @@ import { Dialog, DialogPanel, DialogTitle, Transition, TransitionChild } from '@ import { Fragment } from 'react' import { RiCloseLine } from '@remixicon/react' import classNames from '@/utils/classnames' +import { noop } from 'lodash-es' // https://headlessui.com/react/dialog type IModal = { @@ -20,7 +21,7 @@ export default function Modal({ className, wrapperClassName, isShow, - onClose = () => { }, + onClose = noop, title, description, children, diff --git a/web/app/components/base/notion-page-selector/notion-page-selector-modal/index.tsx b/web/app/components/base/notion-page-selector/notion-page-selector-modal/index.tsx index 03ec81aa89..22d2a1634e 100644 --- a/web/app/components/base/notion-page-selector/notion-page-selector-modal/index.tsx +++ b/web/app/components/base/notion-page-selector/notion-page-selector-modal/index.tsx @@ -6,6 +6,7 @@ import s from './index.module.css' import type { NotionPage } from '@/models/common' import cn from '@/utils/classnames' import Modal from '@/app/components/base/modal' +import { noop } from 'lodash-es' type NotionPageSelectorModalProps = { isShow: boolean @@ -36,7 +37,7 @@ const NotionPageSelectorModal = ({ { }} + onClose={noop} >
{t('common.dataSource.notion.selector.addPages')}
diff --git a/web/app/components/base/prompt-editor/plugins/context-block/context-block-replacement-block.tsx b/web/app/components/base/prompt-editor/plugins/context-block/context-block-replacement-block.tsx index 9d44a4023f..7d96827b56 100644 --- a/web/app/components/base/prompt-editor/plugins/context-block/context-block-replacement-block.tsx +++ b/web/app/components/base/prompt-editor/plugins/context-block/context-block-replacement-block.tsx @@ -14,12 +14,13 @@ import { ContextBlockNode, } from '../context-block/node' import { CustomTextNode } from '../custom-text/node' +import { noop } from 'lodash-es' const REGEX = new RegExp(CONTEXT_PLACEHOLDER_TEXT) const ContextBlockReplacementBlock = ({ datasets = [], - onAddContext = () => {}, + onAddContext = noop, onInsert, canNotAddContext, }: ContextBlockType) => { diff --git a/web/app/components/base/prompt-editor/plugins/context-block/index.tsx b/web/app/components/base/prompt-editor/plugins/context-block/index.tsx index 5be4f1fad6..c115065f8e 100644 --- a/web/app/components/base/prompt-editor/plugins/context-block/index.tsx +++ b/web/app/components/base/prompt-editor/plugins/context-block/index.tsx @@ -14,6 +14,7 @@ import { $createContextBlockNode, ContextBlockNode, } from './node' +import { noop } from 'lodash-es' export const INSERT_CONTEXT_BLOCK_COMMAND = createCommand('INSERT_CONTEXT_BLOCK_COMMAND') export const DELETE_CONTEXT_BLOCK_COMMAND = createCommand('DELETE_CONTEXT_BLOCK_COMMAND') @@ -26,7 +27,7 @@ export type Dataset = { const ContextBlock = memo(({ datasets = [], - onAddContext = () => {}, + onAddContext = noop, onInsert, onDelete, canNotAddContext, diff --git a/web/app/components/base/prompt-editor/plugins/history-block/history-block-replacement-block.tsx b/web/app/components/base/prompt-editor/plugins/history-block/history-block-replacement-block.tsx index 04aa0cbc89..78459030e1 100644 --- a/web/app/components/base/prompt-editor/plugins/history-block/history-block-replacement-block.tsx +++ b/web/app/components/base/prompt-editor/plugins/history-block/history-block-replacement-block.tsx @@ -13,12 +13,13 @@ import { HistoryBlockNode, } from '../history-block/node' import { CustomTextNode } from '../custom-text/node' +import { noop } from 'lodash-es' const REGEX = new RegExp(HISTORY_PLACEHOLDER_TEXT) const HistoryBlockReplacementBlock = ({ history = { user: '', assistant: '' }, - onEditRole = () => {}, + onEditRole = noop, onInsert, }: HistoryBlockType) => { const [editor] = useLexicalComposerContext() diff --git a/web/app/components/base/prompt-editor/plugins/history-block/index.tsx b/web/app/components/base/prompt-editor/plugins/history-block/index.tsx index 78c7349519..d51c986719 100644 --- a/web/app/components/base/prompt-editor/plugins/history-block/index.tsx +++ b/web/app/components/base/prompt-editor/plugins/history-block/index.tsx @@ -14,6 +14,7 @@ import { $createHistoryBlockNode, HistoryBlockNode, } from './node' +import { noop } from 'lodash-es' export const INSERT_HISTORY_BLOCK_COMMAND = createCommand('INSERT_HISTORY_BLOCK_COMMAND') export const DELETE_HISTORY_BLOCK_COMMAND = createCommand('DELETE_HISTORY_BLOCK_COMMAND') @@ -32,7 +33,7 @@ export type HistoryBlockProps = { const HistoryBlock = memo(({ history = { user: '', assistant: '' }, - onEditRole = () => {}, + onEditRole = noop, onInsert, onDelete, }: HistoryBlockType) => { diff --git a/web/app/components/base/radio-card/index.tsx b/web/app/components/base/radio-card/index.tsx index c89d681633..417897270b 100644 --- a/web/app/components/base/radio-card/index.tsx +++ b/web/app/components/base/radio-card/index.tsx @@ -2,6 +2,7 @@ import type { FC } from 'react' import React from 'react' import cn from '@/utils/classnames' +import { noop } from 'lodash-es' type Props = { className?: string @@ -23,7 +24,7 @@ const RadioCard: FC = ({ description, noRadio, isChosen, - onChosen = () => { }, + onChosen = noop, chosenConfig, chosenConfigWrapClassName, className, diff --git a/web/app/components/base/tag-management/selector.tsx b/web/app/components/base/tag-management/selector.tsx index 2c5c2686ba..038f0daf54 100644 --- a/web/app/components/base/tag-management/selector.tsx +++ b/web/app/components/base/tag-management/selector.tsx @@ -15,6 +15,7 @@ import type { Tag } from '@/app/components/base/tag-management/constant' import Checkbox from '@/app/components/base/checkbox' import { bindTag, createTag, fetchTagList, unBindTag } from '@/service/tag' import { ToastContext } from '@/app/components/base/toast' +import { noop } from 'lodash-es' type TagSelectorProps = { targetID: string @@ -161,7 +162,7 @@ const Panel = (props: PanelProps) => { { }} + onCheck={noop} />
{tag.name}
@@ -175,7 +176,7 @@ const Panel = (props: PanelProps) => { { }} + onCheck={noop} />
{tag.name}
diff --git a/web/app/components/base/tag-management/tag-remove-modal.tsx b/web/app/components/base/tag-management/tag-remove-modal.tsx index a8c0e79e1a..85f1831ac1 100644 --- a/web/app/components/base/tag-management/tag-remove-modal.tsx +++ b/web/app/components/base/tag-management/tag-remove-modal.tsx @@ -7,6 +7,7 @@ import Button from '@/app/components/base/button' import Modal from '@/app/components/base/modal' import { AlertTriangle } from '@/app/components/base/icons/src/vender/solid/alertsAndFeedback' import type { Tag } from '@/app/components/base/tag-management/constant' +import { noop } from 'lodash-es' type TagRemoveModalProps = { show: boolean @@ -22,7 +23,7 @@ const TagRemoveModal = ({ show, tag, onConfirm, onClose }: TagRemoveModalProps) { }} + onClose={noop} >
diff --git a/web/app/components/base/toast/index.spec.tsx b/web/app/components/base/toast/index.spec.tsx index 366fb4cb0e..7cbacfeb59 100644 --- a/web/app/components/base/toast/index.spec.tsx +++ b/web/app/components/base/toast/index.spec.tsx @@ -2,6 +2,7 @@ import React from 'react' import { act, render, screen, waitFor } from '@testing-library/react' import Toast, { ToastProvider, useToastContext } from '.' import '@testing-library/jest-dom' +import { noop } from 'lodash-es' // Mock timers for testing timeouts jest.useFakeTimers() @@ -76,11 +77,11 @@ describe('Toast', () => { test('does not render close button when close is undefined', () => { // Create a modified context where close is undefined - const CustomToastContext = React.createContext({ notify: () => { }, close: undefined }) + const CustomToastContext = React.createContext({ notify: noop, close: undefined }) // Create a wrapper component using the custom context const Wrapper = ({ children }: any) => ( - { }, close: undefined }}> + {children} ) diff --git a/web/app/components/base/toast/index.tsx b/web/app/components/base/toast/index.tsx index fe87044519..b84a321dd4 100644 --- a/web/app/components/base/toast/index.tsx +++ b/web/app/components/base/toast/index.tsx @@ -12,6 +12,7 @@ import { import { createContext, useContext } from 'use-context-selector' import ActionButton from '@/app/components/base/action-button' import classNames from '@/utils/classnames' +import { noop } from 'lodash-es' export type IToastProps = { type?: 'success' | 'error' | 'warning' | 'info' @@ -134,7 +135,7 @@ Toast.notify = ({ root.render( { }, + notify: noop, close: () => { if (holder) { root.unmount() diff --git a/web/app/components/base/with-input-validation/index.spec.tsx b/web/app/components/base/with-input-validation/index.spec.tsx index 9f49c8d18f..732a16d8f1 100644 --- a/web/app/components/base/with-input-validation/index.spec.tsx +++ b/web/app/components/base/with-input-validation/index.spec.tsx @@ -2,6 +2,7 @@ import { render, screen } from '@testing-library/react' import '@testing-library/jest-dom' import { z } from 'zod' import withValidation from '.' +import { noop } from 'lodash-es' describe('withValidation HOC', () => { // schema for validation @@ -16,7 +17,7 @@ describe('withValidation HOC', () => { const WrappedComponent = withValidation(TestComponent, schema) beforeAll(() => { - jest.spyOn(console, 'error').mockImplementation(() => { }) + jest.spyOn(console, 'error').mockImplementation(noop) }) afterAll(() => { diff --git a/web/app/components/datasets/common/document-status-with-action/index-failed.tsx b/web/app/components/datasets/common/document-status-with-action/index-failed.tsx index 37311768b9..802e3d872f 100644 --- a/web/app/components/datasets/common/document-status-with-action/index-failed.tsx +++ b/web/app/components/datasets/common/document-status-with-action/index-failed.tsx @@ -6,6 +6,7 @@ import useSWR from 'swr' import StatusWithAction from './status-with-action' import { getErrorDocs, retryErrorDocs } from '@/service/datasets' import type { IndexingStatusResponse } from '@/models/datasets' +import { noop } from 'lodash-es' type Props = { datasetId: string @@ -62,7 +63,7 @@ const RetryButton: FC = ({ datasetId }) => { description={`${errorDocs?.total} ${t('dataset.docsFailedNotice')}`} actionText={t('dataset.retry')} disabled={indexState.value === 'retry'} - onAction={indexState.value === 'error' ? onRetryErrorDocs : () => { }} + onAction={indexState.value === 'error' ? onRetryErrorDocs : noop} /> ) } diff --git a/web/app/components/datasets/documents/detail/batch-modal/index.tsx b/web/app/components/datasets/documents/detail/batch-modal/index.tsx index f7518844d5..775d755106 100644 --- a/web/app/components/datasets/documents/detail/batch-modal/index.tsx +++ b/web/app/components/datasets/documents/detail/batch-modal/index.tsx @@ -8,6 +8,7 @@ import CSVDownloader from './csv-downloader' import Button from '@/app/components/base/button' import Modal from '@/app/components/base/modal' import type { ChunkingMode } from '@/models/datasets' +import { noop } from 'lodash-es' export type IBatchModalProps = { isShow: boolean @@ -39,7 +40,7 @@ const BatchModal: FC = ({ }, [isShow]) return ( - { }} className='!max-w-[520px] !rounded-xl px-8 py-6'> +
{t('datasetDocuments.list.batchModal.title')}
diff --git a/web/app/components/datasets/documents/detail/completed/common/full-screen-drawer.tsx b/web/app/components/datasets/documents/detail/completed/common/full-screen-drawer.tsx index 0d86d2de61..64f5bd7033 100644 --- a/web/app/components/datasets/documents/detail/completed/common/full-screen-drawer.tsx +++ b/web/app/components/datasets/documents/detail/completed/common/full-screen-drawer.tsx @@ -1,6 +1,7 @@ import React, { type FC } from 'react' import Drawer from '@/app/components/base/drawer' import classNames from '@/utils/classnames' +import { noop } from 'lodash-es' type IFullScreenDrawerProps = { isOpen: boolean @@ -11,7 +12,7 @@ type IFullScreenDrawerProps = { const FullScreenDrawer: FC = ({ isOpen, - onClose = () => {}, + onClose = noop, fullScreen, children, }) => { diff --git a/web/app/components/datasets/documents/detail/completed/common/regeneration-modal.tsx b/web/app/components/datasets/documents/detail/completed/common/regeneration-modal.tsx index c2dfe04e7b..95bb339db9 100644 --- a/web/app/components/datasets/documents/detail/completed/common/regeneration-modal.tsx +++ b/web/app/components/datasets/documents/detail/completed/common/regeneration-modal.tsx @@ -5,6 +5,7 @@ import { useCountDown } from 'ahooks' import Modal from '@/app/components/base/modal' import Button from '@/app/components/base/button' import { useEventEmitterContextContext } from '@/context/event-emitter' +import { noop } from 'lodash-es' type IDefaultContentProps = { onCancel: () => void @@ -120,7 +121,7 @@ const RegenerationModal: FC = ({ }) return ( - {}} className='!max-w-[480px] !rounded-2xl'> + {!loading && !updateSucceeded && } {loading && !updateSucceeded && } {!loading && updateSucceeded && } diff --git a/web/app/components/datasets/documents/detail/completed/index.tsx b/web/app/components/datasets/documents/detail/completed/index.tsx index 9095f8854e..197a6514da 100644 --- a/web/app/components/datasets/documents/detail/completed/index.tsx +++ b/web/app/components/datasets/documents/detail/completed/index.tsx @@ -46,6 +46,7 @@ import { useUpdateSegment, } from '@/service/knowledge/use-segment' import { useInvalid } from '@/service/use-base' +import { noop } from 'lodash-es' const DEFAULT_LIMIT = 10 @@ -71,7 +72,7 @@ type SegmentListContextValue = { const SegmentListContext = createContext({ isCollapsed: true, fullScreen: false, - toggleFullScreen: () => {}, + toggleFullScreen: noop, currSegment: { showModal: false }, currChildChunk: { showModal: false }, }) diff --git a/web/app/components/datasets/metadata/metadata-dataset/create-content.tsx b/web/app/components/datasets/metadata/metadata-dataset/create-content.tsx index 4f94cc5578..3ac1a046ff 100644 --- a/web/app/components/datasets/metadata/metadata-dataset/create-content.tsx +++ b/web/app/components/datasets/metadata/metadata-dataset/create-content.tsx @@ -8,6 +8,7 @@ import OptionCard from '../../../workflow/nodes/_base/components/option-card' import Input from '@/app/components/base/input' import { RiArrowLeftLine } from '@remixicon/react' import { useTranslation } from 'react-i18next' +import { noop } from 'lodash-es' const i18nPrefix = 'dataset.metadata.createMetadata' @@ -19,7 +20,7 @@ export type Props = { } const CreateContent: FC = ({ - onClose = () => { }, + onClose = noop, hasBack, onBack, onSave, diff --git a/web/app/components/datasets/rename-modal/index.tsx b/web/app/components/datasets/rename-modal/index.tsx index 57c7d6fc9e..6a64804702 100644 --- a/web/app/components/datasets/rename-modal/index.tsx +++ b/web/app/components/datasets/rename-modal/index.tsx @@ -13,6 +13,7 @@ import Modal from '@/app/components/base/modal' import { ToastContext } from '@/app/components/base/toast' import type { DataSet } from '@/models/datasets' import { updateDatasetSetting } from '@/service/datasets' +import { noop } from 'lodash-es' type RenameDatasetModalProps = { show: boolean @@ -66,7 +67,7 @@ const RenameDatasetModal = ({ show, dataset, onSuccess, onClose }: RenameDataset { }} + onClose={noop} >
{t('datasetSettings.title')}
diff --git a/web/app/components/header/account-about/index.tsx b/web/app/components/header/account-about/index.tsx index 87761b4dc7..a9d08279b8 100644 --- a/web/app/components/header/account-about/index.tsx +++ b/web/app/components/header/account-about/index.tsx @@ -8,6 +8,7 @@ import Button from '@/app/components/base/button' import type { LangGeniusVersionResponse } from '@/models/common' import { IS_CE_EDITION } from '@/config' import LogoSite from '@/app/components/base/logo/logo-site' +import { noop } from 'lodash-es' type IAccountSettingProps = { langeniusVersionInfo: LangGeniusVersionResponse @@ -27,7 +28,7 @@ export default function AccountAbout({ return ( { }} + onClose={noop} className='!w-[480px] !max-w-[480px] !px-6 !py-4' >
diff --git a/web/app/components/header/account-setting/api-based-extension-page/modal.tsx b/web/app/components/header/account-setting/api-based-extension-page/modal.tsx index 81869b2b57..53f7673b15 100644 --- a/web/app/components/header/account-setting/api-based-extension-page/modal.tsx +++ b/web/app/components/header/account-setting/api-based-extension-page/modal.tsx @@ -10,6 +10,7 @@ import { updateApiBasedExtension, } from '@/service/common' import { useToastContext } from '@/app/components/base/toast' +import { noop } from 'lodash-es' export type ApiBasedExtensionData = { name?: string @@ -74,7 +75,7 @@ const ApiBasedExtensionModal: FC = ({ return ( { }} + onClose={noop} className='!w-[640px] !max-w-none !p-8 !pb-6' >
diff --git a/web/app/components/header/account-setting/data-source-page/data-source-notion/index.tsx b/web/app/components/header/account-setting/data-source-page/data-source-notion/index.tsx index b0db511550..38efdcb1b7 100644 --- a/web/app/components/header/account-setting/data-source-page/data-source-notion/index.tsx +++ b/web/app/components/header/account-setting/data-source-page/data-source-notion/index.tsx @@ -8,6 +8,7 @@ import type { DataSourceNotion as TDataSourceNotion } from '@/models/common' import { useAppContext } from '@/context/app-context' import { fetchNotionConnection } from '@/service/common' import NotionIcon from '@/app/components/base/notion-icon' +import { noop } from 'lodash-es' const Icon: FC<{ src: string @@ -74,7 +75,7 @@ const DataSourceNotion: FC = ({ total: workspace.source_info.total || 0, }, }))} - onRemove={() => { }} // handled in operation/index.tsx + onRemove={noop} // handled in operation/index.tsx notionActions={{ onChangeAuthorizedPage: handleAuthAgain, }} diff --git a/web/app/components/header/account-setting/members-page/edit-workspace-modal/index.tsx b/web/app/components/header/account-setting/members-page/edit-workspace-modal/index.tsx index b84fd20a82..22a427b63b 100644 --- a/web/app/components/header/account-setting/members-page/edit-workspace-modal/index.tsx +++ b/web/app/components/header/account-setting/members-page/edit-workspace-modal/index.tsx @@ -11,6 +11,8 @@ import { RiCloseLine } from '@remixicon/react' import { useAppContext } from '@/context/app-context' import { updateWorkspaceInfo } from '@/service/common' import { ToastContext } from '@/app/components/base/toast' +import { noop } from 'lodash-es' + type IEditWorkspaceModalProps = { onCancel: () => void } @@ -40,7 +42,7 @@ const EditWorkspaceModal = ({ return (
- {}} className={cn(s.modal)}> +
{t('common.account.editWorkspaceInfo')}
diff --git a/web/app/components/header/account-setting/members-page/invite-modal/index.tsx b/web/app/components/header/account-setting/members-page/invite-modal/index.tsx index c663f054e6..55f19c4a20 100644 --- a/web/app/components/header/account-setting/members-page/invite-modal/index.tsx +++ b/web/app/components/header/account-setting/members-page/invite-modal/index.tsx @@ -15,8 +15,9 @@ import { emailRegex } from '@/config' import { ToastContext } from '@/app/components/base/toast' import type { InvitationResult } from '@/models/common' import I18n from '@/context/i18n' - import 'react-multi-email/dist/style.css' +import { noop } from 'lodash-es' + type IInviteModalProps = { isEmailSetup: boolean onCancel: () => void @@ -57,7 +58,7 @@ const InviteModal = ({ return (
- { }} className={cn(s.modal)}> +
{t('common.members.inviteTeamMember')}
diff --git a/web/app/components/header/account-setting/members-page/invited-modal/index.tsx b/web/app/components/header/account-setting/members-page/invited-modal/index.tsx index 785d6c1ccf..2719708672 100644 --- a/web/app/components/header/account-setting/members-page/invited-modal/index.tsx +++ b/web/app/components/header/account-setting/members-page/invited-modal/index.tsx @@ -10,6 +10,7 @@ import Button from '@/app/components/base/button' import { IS_CE_EDITION } from '@/config' import type { InvitationResult } from '@/models/common' import Tooltip from '@/app/components/base/tooltip' +import { noop } from 'lodash-es' export type SuccessInvitationResult = Extract export type FailedInvitationResult = Extract @@ -29,7 +30,7 @@ const InvitedModal = ({ return (
- {}} className={s.modal}> +
- { }}> +
diff --git a/web/app/components/header/app-selector/index.tsx b/web/app/components/header/app-selector/index.tsx index 2c88668d5d..1c0dbc55d6 100644 --- a/web/app/components/header/app-selector/index.tsx +++ b/web/app/components/header/app-selector/index.tsx @@ -9,6 +9,7 @@ import type { AppDetailResponse } from '@/models/app' import CreateAppDialog from '@/app/components/app/create-app-dialog' import AppIcon from '@/app/components/base/app-icon' import { useAppContext } from '@/context/app-context' +import { noop } from 'lodash-es' type IAppSelectorProps = { appItems: AppDetailResponse[] @@ -104,7 +105,7 @@ export default function AppSelector({ appItems, curApp }: IAppSelectorProps) { setShowNewAppDialog(false)} - onSuccess={() => { }} + onSuccess={noop} />
) diff --git a/web/app/components/plugins/marketplace/context.tsx b/web/app/components/plugins/marketplace/context.tsx index 47da7ee160..53f57c0252 100644 --- a/web/app/components/plugins/marketplace/context.tsx +++ b/web/app/components/plugins/marketplace/context.tsx @@ -37,6 +37,7 @@ import { getMarketplaceListFilterType, } from './utils' import { useInstalledPluginList } from '@/service/use-plugins' +import { noop } from 'lodash-es' export type MarketplaceContextValue = { intersected: boolean @@ -66,26 +67,26 @@ export type MarketplaceContextValue = { export const MarketplaceContext = createContext({ intersected: true, - setIntersected: () => {}, + setIntersected: noop, searchPluginText: '', - handleSearchPluginTextChange: () => {}, + handleSearchPluginTextChange: noop, filterPluginTags: [], - handleFilterPluginTagsChange: () => {}, + handleFilterPluginTagsChange: noop, activePluginType: 'all', - handleActivePluginTypeChange: () => {}, + handleActivePluginTypeChange: noop, page: 1, - handlePageChange: () => {}, + handlePageChange: noop, plugins: undefined, pluginsTotal: 0, - resetPlugins: () => {}, + resetPlugins: noop, sort: DEFAULT_SORT, - handleSortChange: () => {}, - handleQueryPlugins: () => {}, - handleMoreClick: () => {}, + handleSortChange: noop, + handleQueryPlugins: noop, + handleMoreClick: noop, marketplaceCollectionsFromClient: [], - setMarketplaceCollectionsFromClient: () => {}, + setMarketplaceCollectionsFromClient: noop, marketplaceCollectionPluginsMapFromClient: {}, - setMarketplaceCollectionPluginsMapFromClient: () => {}, + setMarketplaceCollectionPluginsMapFromClient: noop, isLoading: false, isSuccessCollections: false, }) diff --git a/web/app/components/plugins/plugin-page/context.tsx b/web/app/components/plugins/plugin-page/context.tsx index 6363bcae69..cf26cd4e08 100644 --- a/web/app/components/plugins/plugin-page/context.tsx +++ b/web/app/components/plugins/plugin-page/context.tsx @@ -14,6 +14,7 @@ import { useSelector as useAppContextSelector } from '@/context/app-context' import type { FilterState } from './filter-management' import { useTranslation } from 'react-i18next' import { useTabSearchParams } from '@/hooks/use-tab-searchparams' +import { noop } from 'lodash-es' export type PluginPageContextValue = { containerRef: React.RefObject @@ -29,15 +30,15 @@ export type PluginPageContextValue = { export const PluginPageContext = createContext({ containerRef: { current: null }, currentPluginID: undefined, - setCurrentPluginID: () => { }, + setCurrentPluginID: noop, filters: { categories: [], tags: [], searchQuery: '', }, - setFilters: () => { }, + setFilters: noop, activeTab: '', - setActiveTab: () => { }, + setActiveTab: noop, options: [], }) diff --git a/web/app/components/plugins/plugin-page/empty/index.tsx b/web/app/components/plugins/plugin-page/empty/index.tsx index 8654fc8e8e..372adac29c 100644 --- a/web/app/components/plugins/plugin-page/empty/index.tsx +++ b/web/app/components/plugins/plugin-page/empty/index.tsx @@ -11,6 +11,7 @@ import Line from '../../marketplace/empty/line' import { useInstalledPluginList } from '@/service/use-plugins' import { useTranslation } from 'react-i18next' import { SUPPORT_INSTALL_LOCAL_FILE_EXTENSIONS } from '@/config' +import { noop } from 'lodash-es' const Empty = () => { const { t } = useTranslation() @@ -99,14 +100,14 @@ const Empty = () => {
{selectedAction === 'github' && { }} + onSuccess={noop} onClose={() => setSelectedAction(null)} />} {selectedAction === 'local' && selectedFile && ( setSelectedAction(null)} - onSuccess={() => { }} + onSuccess={noop} /> ) } diff --git a/web/app/components/plugins/plugin-page/index.tsx b/web/app/components/plugins/plugin-page/index.tsx index eb28e17655..801eaf6607 100644 --- a/web/app/components/plugins/plugin-page/index.tsx +++ b/web/app/components/plugins/plugin-page/index.tsx @@ -39,6 +39,7 @@ import { marketplaceApiPrefix } from '@/config' import { SUPPORT_INSTALL_LOCAL_FILE_EXTENSIONS } from '@/config' import { LanguagesSupported } from '@/i18n/language' import I18n from '@/context/i18n' +import { noop } from 'lodash-es' const PACKAGE_IDS_KEY = 'package-ids' const BUNDLE_INFO_KEY = 'bundle-info' @@ -230,8 +231,8 @@ const PluginPage = ({ {currentFile && ( { })} - onSuccess={() => { }} + onClose={removeFile ?? noop} + onSuccess={noop} /> )} { })} + onChange={fileChangeHandle ?? noop} /> )} diff --git a/web/app/components/plugins/plugin-page/install-plugin-dropdown.tsx b/web/app/components/plugins/plugin-page/install-plugin-dropdown.tsx index 33ef06df05..5a61adf8ac 100644 --- a/web/app/components/plugins/plugin-page/install-plugin-dropdown.tsx +++ b/web/app/components/plugins/plugin-page/install-plugin-dropdown.tsx @@ -17,6 +17,7 @@ import { import { useSelector as useAppContextSelector } from '@/context/app-context' import { useTranslation } from 'react-i18next' import { SUPPORT_INSTALL_LOCAL_FILE_EXTENSIONS } from '@/config' +import { noop } from 'lodash-es' type Props = { onSwitchToMarketplaceTab: () => void @@ -118,14 +119,14 @@ const InstallPluginDropdown = ({
{selectedAction === 'github' && { }} + onSuccess={noop} onClose={() => setSelectedAction(null)} />} {selectedAction === 'local' && selectedFile && ( setSelectedAction(null)} - onSuccess={() => { }} + onSuccess={noop} /> ) } diff --git a/web/app/components/tools/labels/selector.tsx b/web/app/components/tools/labels/selector.tsx index 339b314131..587c204456 100644 --- a/web/app/components/tools/labels/selector.tsx +++ b/web/app/components/tools/labels/selector.tsx @@ -14,6 +14,7 @@ import { Tag03 } from '@/app/components/base/icons/src/vender/line/financeAndECo import Checkbox from '@/app/components/base/checkbox' import type { Label } from '@/app/components/tools/labels/constant' import { useTags } from '@/app/components/plugins/hooks' +import { noop } from 'lodash-es' type LabelSelectorProps = { value: string[] @@ -99,7 +100,7 @@ const LabelSelector: FC = ({ { }} + onCheck={noop} />
{label.label}
diff --git a/web/app/components/tools/setting/build-in/config-credentials.tsx b/web/app/components/tools/setting/build-in/config-credentials.tsx index 276f3c10f5..3ce3f62639 100644 --- a/web/app/components/tools/setting/build-in/config-credentials.tsx +++ b/web/app/components/tools/setting/build-in/config-credentials.tsx @@ -13,6 +13,7 @@ import Loading from '@/app/components/base/loading' import Form from '@/app/components/header/account-setting/model-provider-page/model-modal/Form' import { LinkExternal02 } from '@/app/components/base/icons/src/vender/line/general' import { useLanguage } from '@/app/components/header/account-setting/model-provider-page/hooks' +import { noop } from 'lodash-es' type Props = { collection: Collection @@ -28,7 +29,7 @@ const ConfigCredential: FC = ({ onCancel, onSaved, isHideRemoveBtn, - onRemove = () => { }, + onRemove = noop, isSaving, }) => { const { t } = useTranslation() diff --git a/web/app/components/tools/workflow-tool/confirm-modal/index.tsx b/web/app/components/tools/workflow-tool/confirm-modal/index.tsx index 1f8515bfae..1327adc7e5 100644 --- a/web/app/components/tools/workflow-tool/confirm-modal/index.tsx +++ b/web/app/components/tools/workflow-tool/confirm-modal/index.tsx @@ -6,6 +6,7 @@ import cn from '@/utils/classnames' import Button from '@/app/components/base/button' import Modal from '@/app/components/base/modal' import { AlertTriangle } from '@/app/components/base/icons/src/vender/solid/alertsAndFeedback' +import { noop } from 'lodash-es' type ConfirmModalProps = { show: boolean @@ -20,7 +21,7 @@ const ConfirmModal = ({ show, onConfirm, onClose }: ConfirmModalProps) => { { }} + onClose={noop} >
diff --git a/web/app/components/workflow/dsl-export-confirm-modal.tsx b/web/app/components/workflow/dsl-export-confirm-modal.tsx index c504b5ec16..e9c51de936 100644 --- a/web/app/components/workflow/dsl-export-confirm-modal.tsx +++ b/web/app/components/workflow/dsl-export-confirm-modal.tsx @@ -8,6 +8,7 @@ import Modal from '@/app/components/base/modal' import Checkbox from '@/app/components/base/checkbox' import Button from '@/app/components/base/button' import type { EnvironmentVariable } from '@/app/components/workflow/types' +import { noop } from 'lodash-es' export type DSLExportConfirmModalProps = { envList: EnvironmentVariable[] @@ -32,7 +33,7 @@ const DSLExportConfirmModal = ({ return ( { }} + onClose={noop} className={cn('w-[480px] max-w-[480px]')} >
{t('workflow.env.export.title')}
diff --git a/web/app/components/workflow/nodes/_base/components/editor/code-editor/index.tsx b/web/app/components/workflow/nodes/_base/components/editor/code-editor/index.tsx index 1e6ef906dd..8aacfba64b 100644 --- a/web/app/components/workflow/nodes/_base/components/editor/code-editor/index.tsx +++ b/web/app/components/workflow/nodes/_base/components/editor/code-editor/index.tsx @@ -8,8 +8,8 @@ import { CodeLanguage } from '@/app/components/workflow/nodes/code/types' import { getFilesInLogs, } from '@/app/components/base/file-uploader/utils' - import './style.css' +import { noop } from 'lodash-es' // load file from local instead of cdn https://github.com/suren-atoyan/monaco-react/issues/482 loader.config({ paths: { vs: '/vs' } }) @@ -55,7 +55,7 @@ const DEFAULT_THEME = { const CodeEditor: FC = ({ value = '', placeholder = '', - onChange = () => { }, + onChange = noop, title = '', headerRight, language, diff --git a/web/app/components/workflow/nodes/_base/components/file-type-item.tsx b/web/app/components/workflow/nodes/_base/components/file-type-item.tsx index 17cf28d6e2..6791dbbec5 100644 --- a/web/app/components/workflow/nodes/_base/components/file-type-item.tsx +++ b/web/app/components/workflow/nodes/_base/components/file-type-item.tsx @@ -8,6 +8,7 @@ import { FILE_EXTS } from '@/app/components/base/prompt-editor/constants' import TagInput from '@/app/components/base/tag-input' import Checkbox from '@/app/components/base/checkbox' import { FileTypeIcon } from '@/app/components/base/file-uploader' +import { noop } from 'lodash-es' type Props = { type: SupportUploadFileTypes.image | SupportUploadFileTypes.document | SupportUploadFileTypes.audio | SupportUploadFileTypes.video | SupportUploadFileTypes.custom @@ -22,7 +23,7 @@ const FileTypeItem: FC = ({ selected, onToggle, customFileTypes = [], - onCustomFileTypesChange = () => { }, + onCustomFileTypesChange = noop, }) => { const { t } = useTranslation() diff --git a/web/app/components/workflow/nodes/_base/components/input-support-select-var.tsx b/web/app/components/workflow/nodes/_base/components/input-support-select-var.tsx index 8ba2a2cf2d..33e13637d4 100644 --- a/web/app/components/workflow/nodes/_base/components/input-support-select-var.tsx +++ b/web/app/components/workflow/nodes/_base/components/input-support-select-var.tsx @@ -12,6 +12,7 @@ import { BlockEnum } from '@/app/components/workflow/types' import PromptEditor from '@/app/components/base/prompt-editor' import { Variable02 } from '@/app/components/base/icons/src/vender/solid/development' import Tooltip from '@/app/components/base/tooltip' +import { noop } from 'lodash-es' type Props = { instanceId?: string @@ -68,7 +69,7 @@ const Editor: FC = ({ show: false, selectable: false, datasets: [], - onAddContext: () => { }, + onAddContext: noop, }} historyBlock={{ show: false, @@ -77,7 +78,7 @@ const Editor: FC = ({ user: 'Human', assistant: 'Assistant', }, - onEditRole: () => { }, + onEditRole: noop, }} queryBlock={{ show: false, diff --git a/web/app/components/workflow/nodes/_base/components/variable/var-reference-picker.tsx b/web/app/components/workflow/nodes/_base/components/variable/var-reference-picker.tsx index 1647642950..3597c6493c 100644 --- a/web/app/components/workflow/nodes/_base/components/variable/var-reference-picker.tsx +++ b/web/app/components/workflow/nodes/_base/components/variable/var-reference-picker.tsx @@ -37,6 +37,7 @@ import AddButton from '@/app/components/base/button/add-button' import Badge from '@/app/components/base/badge' import Tooltip from '@/app/components/base/tooltip' import { isExceptionVariable } from '@/app/components/workflow/utils' +import { noop } from 'lodash-es' const TRIGGER_DEFAULT_WIDTH = 227 @@ -73,7 +74,7 @@ const VarReferencePicker: FC = ({ className, isShowNodeName = true, value = [], - onOpen = () => { }, + onOpen = noop, onChange, isSupportConstantValue, defaultVarKindType = VarKindType.constant, @@ -283,7 +284,7 @@ const VarReferencePicker: FC = ({ {isAddBtnTrigger ? (
- { }}> +
) : (
diff --git a/web/app/components/workflow/nodes/assigner/components/var-list/index.tsx b/web/app/components/workflow/nodes/assigner/components/var-list/index.tsx index e334c0b281..e7392eece6 100644 --- a/web/app/components/workflow/nodes/assigner/components/var-list/index.tsx +++ b/web/app/components/workflow/nodes/assigner/components/var-list/index.tsx @@ -15,6 +15,7 @@ import ActionButton from '@/app/components/base/action-button' import Input from '@/app/components/base/input' import Textarea from '@/app/components/base/textarea' import CodeEditor from '@/app/components/workflow/nodes/_base/components/editor/code-editor' +import { noop } from 'lodash-es' type Props = { readonly: boolean @@ -36,7 +37,7 @@ const VarList: FC = ({ nodeId, list, onChange, - onOpen = () => { }, + onOpen = noop, filterVar, filterToAssignedVar, getAssignedVarType, diff --git a/web/app/components/workflow/nodes/if-else/components/condition-wrap.tsx b/web/app/components/workflow/nodes/if-else/components/condition-wrap.tsx index d13cb04c3e..ec6f474f35 100644 --- a/web/app/components/workflow/nodes/if-else/components/condition-wrap.tsx +++ b/web/app/components/workflow/nodes/if-else/components/condition-wrap.tsx @@ -18,6 +18,7 @@ import ConditionAdd from './condition-add' import cn from '@/utils/classnames' import Button from '@/app/components/base/button' import { PortalSelect as Select } from '@/app/components/base/select' +import { noop } from 'lodash-es' type Props = { isSubVariable?: boolean @@ -49,7 +50,7 @@ const ConditionWrap: FC = ({ nodeId: id = '', cases = [], readOnly, - handleSortCase = () => { }, + handleSortCase = noop, handleRemoveCase, handleUpdateCondition, handleAddCondition, diff --git a/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/metadata-filter/index.tsx b/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/metadata-filter/index.tsx index fd67ae4c28..925970e311 100644 --- a/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/metadata-filter/index.tsx +++ b/web/app/components/workflow/nodes/knowledge-retrieval/components/metadata/metadata-filter/index.tsx @@ -10,6 +10,7 @@ import Tooltip from '@/app/components/base/tooltip' import type { MetadataShape } from '@/app/components/workflow/nodes/knowledge-retrieval/types' import { MetadataFilteringModeEnum } from '@/app/components/workflow/nodes/knowledge-retrieval/types' import ModelParameterModal from '@/app/components/header/account-setting/model-provider-page/model-parameter-modal' +import { noop } from 'lodash-es' type MetadataFilterProps = { metadataFilterMode?: MetadataFilteringModeEnum @@ -85,8 +86,8 @@ const MetadataFilter = ({ provider={metadataModelConfig?.provider || ''} completionParams={metadataModelConfig?.completion_params || { temperature: 0.7 }} modelId={metadataModelConfig?.name || ''} - setModel={handleMetadataModelChange || (() => {})} - onCompletionParamsChange={handleMetadataCompletionParamsChange || (() => {})} + setModel={handleMetadataModelChange || noop} + onCompletionParamsChange={handleMetadataCompletionParamsChange || noop} hideDebugWithMultipleModel debugWithMultipleModel={false} /> diff --git a/web/app/components/workflow/nodes/start/components/var-item.tsx b/web/app/components/workflow/nodes/start/components/var-item.tsx index e19a669e86..9d94ebe14a 100644 --- a/web/app/components/workflow/nodes/start/components/var-item.tsx +++ b/web/app/components/workflow/nodes/start/components/var-item.tsx @@ -12,6 +12,7 @@ import { Variable02 } from '@/app/components/base/icons/src/vender/solid/develop import { Edit03 } from '@/app/components/base/icons/src/vender/solid/general' import Badge from '@/app/components/base/badge' import ConfigVarModal from '@/app/components/app/configuration/config-var/config-modal' +import { noop } from 'lodash-es' type Props = { readonly: boolean @@ -26,8 +27,8 @@ type Props = { const VarItem: FC = ({ readonly, payload, - onChange = () => { }, - onRemove = () => { }, + onChange = noop, + onRemove = noop, rightContent, varKeys = [], showLegacyBadge = false, diff --git a/web/app/components/workflow/nodes/tool/components/input-var-list.tsx b/web/app/components/workflow/nodes/tool/components/input-var-list.tsx index 8ed1032d8a..dc25184f5a 100644 --- a/web/app/components/workflow/nodes/tool/components/input-var-list.tsx +++ b/web/app/components/workflow/nodes/tool/components/input-var-list.tsx @@ -16,6 +16,7 @@ import useAvailableVarList from '@/app/components/workflow/nodes/_base/hooks/use import { VarType } from '@/app/components/workflow/types' import AppSelector from '@/app/components/plugins/plugin-detail-panel/app-selector' import ModelParameterModal from '@/app/components/plugins/plugin-detail-panel/model-selector' +import { noop } from 'lodash-es' type Props = { readOnly: boolean @@ -34,7 +35,7 @@ const InputVarList: FC = ({ schema, value, onChange, - onOpen = () => { }, + onOpen = noop, isSupportConstantValue, filterVar, }) => { diff --git a/web/app/components/workflow/nodes/variable-assigner/components/var-list/index.tsx b/web/app/components/workflow/nodes/variable-assigner/components/var-list/index.tsx index a89215b7cc..2b3a06f39b 100644 --- a/web/app/components/workflow/nodes/variable-assigner/components/var-list/index.tsx +++ b/web/app/components/workflow/nodes/variable-assigner/components/var-list/index.tsx @@ -8,6 +8,7 @@ import ListNoDataPlaceholder from '../../../_base/components/list-no-data-placeh import VarReferencePicker from '@/app/components/workflow/nodes/_base/components/variable/var-reference-picker' import type { ValueSelector, Var } from '@/app/components/workflow/types' import { VarType as VarKindType } from '@/app/components/workflow/nodes/tool/types' +import { noop } from 'lodash-es' type Props = { readonly: boolean @@ -23,7 +24,7 @@ const VarList: FC = ({ nodeId, list, onChange, - onOpen = () => { }, + onOpen = noop, filterVar, }) => { const { t } = useTranslation() diff --git a/web/app/components/workflow/panel/debug-and-preview/conversation-variable-modal.tsx b/web/app/components/workflow/panel/debug-and-preview/conversation-variable-modal.tsx index 6c1e4583bb..57fe461e03 100644 --- a/web/app/components/workflow/panel/debug-and-preview/conversation-variable-modal.tsx +++ b/web/app/components/workflow/panel/debug-and-preview/conversation-variable-modal.tsx @@ -21,6 +21,7 @@ import { CodeLanguage } from '@/app/components/workflow/nodes/code/types' import useTimestamp from '@/hooks/use-timestamp' import { fetchCurrentValueOfConversationVariable } from '@/service/workflow' import cn from '@/utils/classnames' +import { noop } from 'lodash-es' export type Props = { conversationID: string @@ -76,7 +77,7 @@ const ConversationVariableModal = ({ return ( { }} + onClose={noop} className={cn('h-[640px] w-[920px] max-w-[920px] p-0')} >
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 b691b86698..e94032f805 100644 --- a/web/app/components/workflow/panel/debug-and-preview/index.tsx +++ b/web/app/components/workflow/panel/debug-and-preview/index.tsx @@ -23,13 +23,14 @@ import { BubbleX } from '@/app/components/base/icons/src/vender/line/others' import Tooltip from '@/app/components/base/tooltip' import ActionButton, { ActionButtonState } from '@/app/components/base/action-button' import { useStore } from '@/app/components/workflow/store' +import { noop } from 'lodash-es' export type ChatWrapperRefType = { handleRestart: () => void } const DebugAndPreview = () => { const { t } = useTranslation() - const chatRef = useRef({ handleRestart: () => { } }) + const chatRef = useRef({ handleRestart: noop }) const { handleCancelDebugAndPreviewPanel } = useWorkflowInteractions() const { handleNodeCancelRunningStatus } = useNodesInteractions() const { handleEdgeCancelRunningStatus } = useEdgesInteractions() diff --git a/web/app/components/workflow/run/utils/format-log/iteration/index.spec.ts b/web/app/components/workflow/run/utils/format-log/iteration/index.spec.ts index 478df67f79..f5feb5c367 100644 --- a/web/app/components/workflow/run/utils/format-log/iteration/index.spec.ts +++ b/web/app/components/workflow/run/utils/format-log/iteration/index.spec.ts @@ -1,10 +1,11 @@ import format from '.' import graphToLogStruct from '../graph-to-log-struct' +import { noop } from 'lodash-es' describe('iteration', () => { const list = graphToLogStruct('start -> (iteration, iterationNode, plainNode1 -> plainNode2)') // const [startNode, iterationNode, ...iterations] = list - const result = format(list as any, () => { }) + const result = format(list as any, noop) test('result should have no nodes in iteration node', () => { expect((result as any).find((item: any) => !!item.execution_metadata?.iteration_id)).toBeUndefined() }) diff --git a/web/app/components/workflow/run/utils/format-log/loop/index.spec.ts b/web/app/components/workflow/run/utils/format-log/loop/index.spec.ts index 3371328fcf..73162cf6b4 100644 --- a/web/app/components/workflow/run/utils/format-log/loop/index.spec.ts +++ b/web/app/components/workflow/run/utils/format-log/loop/index.spec.ts @@ -1,10 +1,11 @@ import format from '.' import graphToLogStruct from '../graph-to-log-struct' +import { noop } from 'lodash-es' describe('loop', () => { const list = graphToLogStruct('start -> (loop, loopNode, plainNode1 -> plainNode2)') const [startNode, loopNode, ...loops] = list - const result = format(list as any, () => { }) + const result = format(list as any, noop) test('result should have no nodes in loop node', () => { expect((result as any).find((item: any) => !!item.execution_metadata?.loop_id)).toBeUndefined() }) diff --git a/web/app/components/workflow/workflow-history-store.tsx b/web/app/components/workflow/workflow-history-store.tsx index a49e9b64e7..52132f3657 100644 --- a/web/app/components/workflow/workflow-history-store.tsx +++ b/web/app/components/workflow/workflow-history-store.tsx @@ -4,8 +4,9 @@ import { type TemporalState, temporal } from 'zundo' import isDeepEqual from 'fast-deep-equal' import type { Edge, Node } from './types' import type { WorkflowHistoryEvent } from './hooks' +import { noop } from 'lodash-es' -export const WorkflowHistoryStoreContext = createContext({ store: null, shortcutsEnabled: true, setShortcutsEnabled: () => {} }) +export const WorkflowHistoryStoreContext = createContext({ store: null, shortcutsEnabled: true, setShortcutsEnabled: noop }) export const Provider = WorkflowHistoryStoreContext.Provider export function WorkflowHistoryProvider({ diff --git a/web/app/education-apply/education-apply-page.tsx b/web/app/education-apply/education-apply-page.tsx index 8d822f2ab0..f99cca2670 100644 --- a/web/app/education-apply/education-apply-page.tsx +++ b/web/app/education-apply/education-apply-page.tsx @@ -24,6 +24,7 @@ import { useProviderContext } from '@/context/provider-context' import { useToastContext } from '@/app/components/base/toast' import { EDUCATION_VERIFYING_LOCALSTORAGE_ITEM } from '@/app/education-apply/constants' import { getLocaleOnClient } from '@/i18n' +import { noop } from 'lodash-es' const EducationApplyAge = () => { const { t } = useTranslation() @@ -35,7 +36,7 @@ const EducationApplyAge = () => { const { isPending, mutateAsync: educationAdd, - } = useEducationAdd({ onSuccess: () => {} }) + } = useEducationAdd({ onSuccess: noop }) const [modalShow, setShowModal] = useState void }>(undefined) const { onPlanInfoChanged } = useProviderContext() const updateEducationStatus = useInvalidateEducationStatus() @@ -181,8 +182,8 @@ const EducationApplyAge = () => { isShow={!!modalShow} title={modalShow?.title || ''} content={modalShow?.desc} - onConfirm={modalShow?.onConfirm || (() => {})} - onCancel={modalShow?.onConfirm || (() => {})} + onConfirm={modalShow?.onConfirm || noop} + onCancel={modalShow?.onConfirm || noop} />
) diff --git a/web/app/reset-password/page.tsx b/web/app/reset-password/page.tsx index 3a138807fc..dd8cdbc69e 100644 --- a/web/app/reset-password/page.tsx +++ b/web/app/reset-password/page.tsx @@ -12,6 +12,7 @@ import Input from '@/app/components/base/input' import Toast from '@/app/components/base/toast' import { sendResetPasswordCode } from '@/service/common' import I18NContext from '@/context/i18n' +import { noop } from 'lodash-es' export default function CheckCode() { const { t } = useTranslation() @@ -76,7 +77,7 @@ export default function CheckCode() {

-
{ }}> +
diff --git a/web/app/signin/components/mail-and-code-auth.tsx b/web/app/signin/components/mail-and-code-auth.tsx index ab9b02c65a..3ad57de855 100644 --- a/web/app/signin/components/mail-and-code-auth.tsx +++ b/web/app/signin/components/mail-and-code-auth.tsx @@ -9,6 +9,7 @@ import Toast from '@/app/components/base/toast' import { sendEMailLoginCode } from '@/service/common' import { COUNT_DOWN_KEY, COUNT_DOWN_TIME_MS } from '@/app/components/signin/countdown' import I18NContext from '@/context/i18n' +import { noop } from 'lodash-es' type MailAndCodeAuthProps = { isInvite: boolean @@ -55,7 +56,7 @@ export default function MailAndCodeAuth({ isInvite }: MailAndCodeAuthProps) { } } - return ( { }}> + return (
diff --git a/web/app/signin/components/mail-and-password-auth.tsx b/web/app/signin/components/mail-and-password-auth.tsx index 27302d3a9a..7360fdac44 100644 --- a/web/app/signin/components/mail-and-password-auth.tsx +++ b/web/app/signin/components/mail-and-password-auth.tsx @@ -9,6 +9,7 @@ import { emailRegex } from '@/config' import { login } from '@/service/common' import Input from '@/app/components/base/input' import I18NContext from '@/context/i18n' +import { noop } from 'lodash-es' type MailAndPasswordAuthProps = { isInvite: boolean @@ -103,7 +104,7 @@ export default function MailAndPasswordAuth({ isInvite, isEmailSetup, allowRegis } } - return { }}> + return