Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

refactor(web): mark Props of workflow/variable-inspect components as read-only (#25219) (#37230)

Evan34f3591d4c05
diff --git a/web/app/components/workflow/variable-inspect/group.tsx b/web/app/components/workflow/variable-inspect/group.tsx
index 9362f6a365b..7b4dddb7f1a 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 47e05dd267e..c22b64c43fd 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<Props> = ({
textHasNoExport,
diff --git a/web/app/components/workflow/variable-inspect/left.tsx b/web/app/components/workflow/variable-inspect/left.tsx
index 4cbd6b5f633..1b1ceda87fb 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 22f062bf91a..97768c63949 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 a87f37e3c29..fddaef232fe 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,