From 8eee344fbb0f02133283d940d9a01d479117c396 Mon Sep 17 00:00:00 2001 From: twwu Date: Mon, 19 May 2025 18:21:17 +0800 Subject: [PATCH] fix: correct hover state logic and refactor environment variable handling in FieldItem and usePipelineInit --- .../input-field/field-list/field-item.tsx | 24 +++++++++---------- .../rag-pipeline/hooks/use-pipeline-init.ts | 6 ++--- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/web/app/components/rag-pipeline/components/input-field/field-list/field-item.tsx b/web/app/components/rag-pipeline/components/input-field/field-list/field-item.tsx index 9de9341c77..8faa5abdd5 100644 --- a/web/app/components/rag-pipeline/components/input-field/field-list/field-item.tsx +++ b/web/app/components/rag-pipeline/components/input-field/field-list/field-item.tsx @@ -34,10 +34,10 @@ const FieldItem = ({ return (
@@ -64,16 +64,8 @@ const FieldItem = ({ )}
- {(!isHovering || readonly) + {(isHovering && !readonly) ? ( -
- {payload.required && ( - {t('workflow.nodes.start.required')} - )} - -
- ) - : (!readonly && (
- )) + ) + : ( +
+ {payload.required && ( + {t('workflow.nodes.start.required')} + )} + +
+ ) }
) diff --git a/web/app/components/rag-pipeline/hooks/use-pipeline-init.ts b/web/app/components/rag-pipeline/hooks/use-pipeline-init.ts index 5ba0c4b601..7bd4697a1d 100644 --- a/web/app/components/rag-pipeline/hooks/use-pipeline-init.ts +++ b/web/app/components/rag-pipeline/hooks/use-pipeline-init.ts @@ -46,9 +46,9 @@ export const usePipelineInit = () => { setDraftUpdatedAt(res.updated_at) setToolPublished(res.tool_published) setEnvSecrets((res.environment_variables || []).filter(env => env.value_type === 'secret').reduce((acc, env) => { - acc[env.id] = env.value - return acc - }, {} as Record)) + acc[env.id] = env.value + return acc + }, {} as Record)) setEnvironmentVariables(res.environment_variables?.map(env => env.value_type === 'secret' ? { ...env, value: '[__HIDDEN__]' } : env) || []) setSyncWorkflowDraftHash(res.hash) setRagPipelineVariables?.(res.rag_pipeline_variables || [])