From 7b6ab22b783ac9cc936111319ce9ec397104035c Mon Sep 17 00:00:00 2001 From: Jimmy Ben Klieve Date: Thu, 25 Dec 2025 17:39:43 +0800 Subject: [PATCH] fix: chunk editor allows update image only if chunk type is image (#12210) ### What problem does this PR solve? Disallow updating image on non-image chunk in chunk editor. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- .../components/chunk-creating-modal/index.tsx | 70 ++++++++++--------- 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/web/src/pages/chunk/parsed-result/add-knowledge/components/knowledge-chunk/components/chunk-creating-modal/index.tsx b/web/src/pages/chunk/parsed-result/add-knowledge/components/knowledge-chunk/components/chunk-creating-modal/index.tsx index 73d988182e..87b9520a04 100644 --- a/web/src/pages/chunk/parsed-result/add-knowledge/components/knowledge-chunk/components/chunk-creating-modal/index.tsx +++ b/web/src/pages/chunk/parsed-result/add-knowledge/components/knowledge-chunk/components/chunk-creating-modal/index.tsx @@ -168,43 +168,45 @@ const ChunkCreatingModal: React.FC & kFProps> = ({ /> )} - ( - - {t('chunk.image')} + {isEditMode && form.getValues('doc_type_kwd') === 'image' && ( + ( + + {t('chunk.image')} -
- {data?.data?.img_id && ( - - )} - -
- - } +
+ {data?.data?.img_id && ( + - + )} + +
+ + } + /> + +
-
- - )} - /> + + )} + /> + )}