diff --git a/web/app/components/rag-pipeline/components/chunk-card-list/types.ts b/web/app/components/rag-pipeline/components/chunk-card-list/types.ts index 6117855b3b..b1213917e4 100644 --- a/web/app/components/rag-pipeline/components/chunk-card-list/types.ts +++ b/web/app/components/rag-pipeline/components/chunk-card-list/types.ts @@ -26,7 +26,8 @@ export type QAChunks = { export type ChunkInfo = GeneralChunks | ParentChildChunks | QAChunks -export enum QAItemType { - Question = 'question', - Answer = 'answer', -} +export const QAItemType = { + Question: 'question', + Answer: 'answer', +} as const +export type QAItemType = typeof QAItemType[keyof typeof QAItemType] diff --git a/web/app/components/rag-pipeline/components/panel/test-run/types.ts b/web/app/components/rag-pipeline/components/panel/test-run/types.ts index ac5ca3ced2..d129487fe1 100644 --- a/web/app/components/rag-pipeline/components/panel/test-run/types.ts +++ b/web/app/components/rag-pipeline/components/panel/test-run/types.ts @@ -1,9 +1,10 @@ import type { DataSourceNodeType } from '@/app/components/workflow/nodes/data-source/types' -export enum TestRunStep { - dataSource = 'dataSource', - documentProcessing = 'documentProcessing', -} +export const TestRunStep = { + dataSource: 'dataSource', + documentProcessing: 'documentProcessing', +} as const +export type TestRunStep = typeof TestRunStep[keyof typeof TestRunStep] export type DataSourceOption = { label: string diff --git a/web/app/components/workflow/note-node/types.ts b/web/app/components/workflow/note-node/types.ts index ad68bd0f10..e8a18589fd 100644 --- a/web/app/components/workflow/note-node/types.ts +++ b/web/app/components/workflow/note-node/types.ts @@ -1,13 +1,14 @@ import type { CommonNodeType } from '../types' -export enum NoteTheme { - blue = 'blue', - cyan = 'cyan', - green = 'green', - yellow = 'yellow', - pink = 'pink', - violet = 'violet', -} +export const NoteTheme = { + blue: 'blue', + cyan: 'cyan', + green: 'green', + yellow: 'yellow', + pink: 'pink', + violet: 'violet', +} as const +export type NoteTheme = typeof NoteTheme[keyof typeof NoteTheme] export type NoteNodeType = CommonNodeType & { text: string diff --git a/web/app/components/workflow/variable-inspect/right.tsx b/web/app/components/workflow/variable-inspect/right.tsx index af939d41ea..893c477d04 100644 --- a/web/app/components/workflow/variable-inspect/right.tsx +++ b/web/app/components/workflow/variable-inspect/right.tsx @@ -174,7 +174,7 @@ const Right = ({ {currentNodeVar?.var && ( <> { - [VarInInspectType.environment, VarInInspectType.conversation, VarInInspectType.system].includes(currentNodeVar.nodeType as VarInInspectType) && ( + ([VarInInspectType.environment, VarInInspectType.conversation, VarInInspectType.system] as VarInInspectType[]).includes(currentNodeVar.nodeType as VarInInspectType) && (