From 34f3591d4c058cc95d262ac8d58db0a4f8176763 Mon Sep 17 00:00:00 2001 From: Evan <2869018789@qq.com> Date: Tue, 9 Jun 2026 16:51:28 +0800 Subject: [PATCH] refactor(web): mark Props of workflow/variable-inspect components as read-only (#25219) (#37230) --- web/app/components/workflow/variable-inspect/group.tsx | 4 ++-- .../components/workflow/variable-inspect/large-data-alert.tsx | 4 ++-- web/app/components/workflow/variable-inspect/left.tsx | 4 ++-- web/app/components/workflow/variable-inspect/right.tsx | 4 ++-- .../components/workflow/variable-inspect/value-content.tsx | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/web/app/components/workflow/variable-inspect/group.tsx b/web/app/components/workflow/variable-inspect/group.tsx index 9362f6a365..7b4dddb7f1 100644 --- a/web/app/components/workflow/variable-inspect/group.tsx +++ b/web/app/components/workflow/variable-inspect/group.tsx @@ -18,7 +18,7 @@ import { VariableIconWithColor } from '@/app/components/workflow/nodes/_base/com import { VarInInspectType } from '@/types/workflow' import { useToolIcon } from '../hooks' -type Props = { +type Props = Readonly<{ nodeData?: NodeWithVar currentVar?: currentVarType varType: VarInInspectType @@ -26,7 +26,7 @@ type Props = { handleSelect: (state: any) => void handleView?: () => void handleClear?: () => void -} +}> const Group = ({ nodeData, diff --git a/web/app/components/workflow/variable-inspect/large-data-alert.tsx b/web/app/components/workflow/variable-inspect/large-data-alert.tsx index 47e05dd267..c22b64c43f 100644 --- a/web/app/components/workflow/variable-inspect/large-data-alert.tsx +++ b/web/app/components/workflow/variable-inspect/large-data-alert.tsx @@ -5,11 +5,11 @@ import { RiInformation2Fill } from '@remixicon/react' import * as React from 'react' import { useTranslation } from 'react-i18next' -type Props = { +type Props = Readonly<{ textHasNoExport?: boolean downloadUrl?: string className?: string -} +}> const LargeDataAlert: FC = ({ textHasNoExport, diff --git a/web/app/components/workflow/variable-inspect/left.tsx b/web/app/components/workflow/variable-inspect/left.tsx index 4cbd6b5f63..1b1ceda87f 100644 --- a/web/app/components/workflow/variable-inspect/left.tsx +++ b/web/app/components/workflow/variable-inspect/left.tsx @@ -11,10 +11,10 @@ import { useNodesInteractions } from '../hooks/use-nodes-interactions' import { useStore } from '../store' import Group from './group' -type Props = { +type Props = Readonly<{ currentNodeVar?: currentVarType handleVarSelect: (state: any) => void -} +}> const Left = ({ currentNodeVar, diff --git a/web/app/components/workflow/variable-inspect/right.tsx b/web/app/components/workflow/variable-inspect/right.tsx index 22f062bf91..97768c6394 100644 --- a/web/app/components/workflow/variable-inspect/right.tsx +++ b/web/app/components/workflow/variable-inspect/right.tsx @@ -36,12 +36,12 @@ import { BlockEnum } from '../types' import Empty from './empty' import ValueContent from './value-content' -type Props = { +type Props = Readonly<{ nodeId: string currentNodeVar?: currentVarType handleOpenMenu: () => void isValueFetching?: boolean -} +}> const Right = ({ nodeId, diff --git a/web/app/components/workflow/variable-inspect/value-content.tsx b/web/app/components/workflow/variable-inspect/value-content.tsx index a87f37e3c2..fddaef232f 100644 --- a/web/app/components/workflow/variable-inspect/value-content.tsx +++ b/web/app/components/workflow/variable-inspect/value-content.tsx @@ -20,11 +20,11 @@ import { validateInspectJsonValue, } from './value-content.helpers' -type Props = { +type Props = Readonly<{ currentVar: VarInInspect handleValueChange: (varId: string, value: any) => void isTruncated: boolean -} +}> const ValueContent = ({ currentVar,