From 8b1f428ead8f489283d21de6ac63f3f2877fde35 Mon Sep 17 00:00:00 2001 From: HyaCinth <88471803+HyaCiovo@users.noreply.github.com> Date: Mon, 14 Jul 2025 13:57:26 +0800 Subject: [PATCH] Chore: Replace lodash/noop with lodash-es/noop (#22331) --- .../plugins/plugin-detail-panel/tool-selector/index.tsx | 4 ++-- .../workflow/nodes/_base/components/agent-strategy.tsx | 2 +- .../json-schema-config-modal/visual-editor/hooks.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/web/app/components/plugins/plugin-detail-panel/tool-selector/index.tsx b/web/app/components/plugins/plugin-detail-panel/tool-selector/index.tsx index 42467ce11..15401f105 100644 --- a/web/app/components/plugins/plugin-detail-panel/tool-selector/index.tsx +++ b/web/app/components/plugins/plugin-detail-panel/tool-selector/index.tsx @@ -55,7 +55,7 @@ type Props = { value?: ToolValue selectedTools?: ToolValue[] onSelect: (tool: ToolValue) => void - onSelectMultiple: (tool: ToolValue[]) => void + onSelectMultiple?: (tool: ToolValue[]) => void isEdit?: boolean onDelete?: () => void supportEnableSwitch?: boolean @@ -143,7 +143,7 @@ const ToolSelector: FC = ({ } const handleSelectMultipleTool = (tool: ToolDefaultValue[]) => { const toolValues = tool.map(item => getToolValue(item)) - onSelectMultiple(toolValues) + onSelectMultiple?.(toolValues) } const handleDescriptionChange = (e: React.ChangeEvent) => { diff --git a/web/app/components/workflow/nodes/_base/components/agent-strategy.tsx b/web/app/components/workflow/nodes/_base/components/agent-strategy.tsx index 31aa91cfd..ce9fbb77e 100644 --- a/web/app/components/workflow/nodes/_base/components/agent-strategy.tsx +++ b/web/app/components/workflow/nodes/_base/components/agent-strategy.tsx @@ -20,7 +20,7 @@ import { useRenderI18nObject } from '@/hooks/use-i18n' import type { NodeOutPutVar } from '../../../types' import type { Node } from 'reactflow' import type { PluginMeta } from '@/app/components/plugins/types' -import { noop } from 'lodash' +import { noop } from 'lodash-es' import { useDocLink } from '@/context/i18n' export type Strategy = { diff --git a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/hooks.ts b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/hooks.ts index eb3dff83d..d11ad9224 100644 --- a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/hooks.ts +++ b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/hooks.ts @@ -6,7 +6,7 @@ import type { EditData } from './edit-card' import { ArrayType, type Field, Type } from '../../../types' import Toast from '@/app/components/base/toast' import { findPropertyWithPath } from '../../../utils' -import _ from 'lodash' +import { noop } from 'lodash-es' type ChangeEventParams = { path: string[], @@ -21,7 +21,7 @@ type AddEventParams = { export const useSchemaNodeOperations = (props: VisualEditorProps) => { const { schema: jsonSchema, onChange: doOnChange } = props - const onChange = doOnChange || _.noop + const onChange = doOnChange || noop const backupSchema = useVisualEditorStore(state => state.backupSchema) const setBackupSchema = useVisualEditorStore(state => state.setBackupSchema) const isAddingNewField = useVisualEditorStore(state => state.isAddingNewField)