From 73e217ab0d79dde2243863aa073a5da65e894648 Mon Sep 17 00:00:00 2001 From: GuanMu Date: Wed, 22 Oct 2025 13:06:15 +0800 Subject: [PATCH] Fix type error (#27250) --- web/app/components/base/pagination/type.ts | 12 +++++++++--- web/app/components/tools/labels/constant.ts | 5 ++++- .../workflow/store/workflow/debug/mock-data.ts | 18 ++++++++++++++++++ web/app/components/workflow/utils/debug.ts | 3 +++ 4 files changed, 34 insertions(+), 4 deletions(-) diff --git a/web/app/components/base/pagination/type.ts b/web/app/components/base/pagination/type.ts index c3744c06c2..d8b7cf1614 100644 --- a/web/app/components/base/pagination/type.ts +++ b/web/app/components/base/pagination/type.ts @@ -1,5 +1,11 @@ import type { ButtonHTMLAttributes } from 'react' +type ElementProps = { + className?: string + children?: React.ReactNode + [key: string]: unknown +} + type IBasePaginationProps = { currentPage: number setCurrentPage: (page: number) => void @@ -31,7 +37,7 @@ type IPagination = IUsePagination & { } type ButtonProps = ButtonHTMLAttributes & { - as?: React.ReactNode + as?: React.ReactElement children?: string | React.ReactNode className?: string dataTestId?: string @@ -39,9 +45,9 @@ type ButtonProps = ButtonHTMLAttributes & { type PageButtonProps = ButtonProps & { /** - * Provide a custom ReactNode (e.g. Next/Link) + * Provide a custom ReactElement (e.g. Next/Link) */ - as?: React.ReactNode + as?: React.ReactElement activeClassName?: string inactiveClassName?: string dataTestIdActive?: string diff --git a/web/app/components/tools/labels/constant.ts b/web/app/components/tools/labels/constant.ts index ad4836e6a8..e7d3503e73 100644 --- a/web/app/components/tools/labels/constant.ts +++ b/web/app/components/tools/labels/constant.ts @@ -1,4 +1,7 @@ +import type { TypeWithI18N } from '@/app/components/header/account-setting/model-provider-page/declarations' + export type Label = { name: string - label: string + label: TypeWithI18N + icon: string } diff --git a/web/app/components/workflow/store/workflow/debug/mock-data.ts b/web/app/components/workflow/store/workflow/debug/mock-data.ts index 9d1bf80076..0bc5555d8c 100644 --- a/web/app/components/workflow/store/workflow/debug/mock-data.ts +++ b/web/app/components/workflow/store/workflow/debug/mock-data.ts @@ -12,6 +12,9 @@ export const vars: VarInInspect[] = [ value_type: VarType.string, value: 'text value...', edited: false, + visible: true, + is_truncated: false, + full_content: { size_bytes: 0, download_url: '' }, }, { id: 'fdklajljgldjglkagjlk', @@ -22,6 +25,9 @@ export const vars: VarInInspect[] = [ value_type: VarType.string, value: 'made zhizhang', edited: false, + visible: true, + is_truncated: false, + full_content: { size_bytes: 0, download_url: '' }, }, ] @@ -35,6 +41,9 @@ export const conversationVars: VarInInspect[] = [ value_type: VarType.string, value: 'conversation var value...', edited: false, + visible: true, + is_truncated: false, + full_content: { size_bytes: 0, download_url: '' }, }, { id: 'con2', @@ -45,6 +54,9 @@ export const conversationVars: VarInInspect[] = [ value_type: VarType.number, value: 456, edited: false, + visible: true, + is_truncated: false, + full_content: { size_bytes: 0, download_url: '' }, }, ] @@ -58,6 +70,9 @@ export const systemVars: VarInInspect[] = [ value_type: VarType.string, value: 'Hello robot!', edited: false, + visible: true, + is_truncated: false, + full_content: { size_bytes: 0, download_url: '' }, }, { id: 'sys2', @@ -68,5 +83,8 @@ export const systemVars: VarInInspect[] = [ value_type: VarType.string, value: 'djflakjerlkjdlksfjslakjsdfl', edited: false, + visible: true, + is_truncated: false, + full_content: { size_bytes: 0, download_url: '' }, }, ] diff --git a/web/app/components/workflow/utils/debug.ts b/web/app/components/workflow/utils/debug.ts index 6dd111d714..4f47153111 100644 --- a/web/app/components/workflow/utils/debug.ts +++ b/web/app/components/workflow/utils/debug.ts @@ -21,5 +21,8 @@ export const outputToVarInInspect = ({ value_type: VarType.string, // TODO: wait for api or get from node value, edited: false, + visible: true, + is_truncated: false, + full_content: { size_bytes: 0, download_url: '' }, } }