From 4c1476032d38be2aca366ab534f16a51c07907be Mon Sep 17 00:00:00 2001 From: balibabu Date: Mon, 29 Apr 2024 18:22:17 +0800 Subject: [PATCH] fix: omit long file names (#608) ### What problem does this PR solve? #607 fix: omit long file names fix: change the parsing method from tag to select fix: replace icon for new chat fix: change the OK button text of the Chat Bot API modal to close ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- .../components/chunk-method-modal/hooks.ts | 6 ++-- .../components/chunk-method-modal/index.less | 4 +++ .../components/chunk-method-modal/index.tsx | 27 +++++--------- web/src/locales/en.ts | 1 + web/src/locales/zh-traditional.ts | 1 + web/src/locales/zh.ts | 1 + .../components/knowledge-file/index.less | 6 +++- .../components/knowledge-file/index.tsx | 10 ++++-- .../components/knowledge-file/model.ts | 8 ++++- .../parsing-action-cell/index.tsx | 36 ++++++++++--------- .../pages/chat/chat-overview-modal/index.tsx | 1 + web/src/pages/chat/index.tsx | 7 ++-- 12 files changed, 63 insertions(+), 45 deletions(-) diff --git a/web/src/components/chunk-method-modal/hooks.ts b/web/src/components/chunk-method-modal/hooks.ts index 8f605ba55..27e5a903b 100644 --- a/web/src/components/chunk-method-modal/hooks.ts +++ b/web/src/components/chunk-method-modal/hooks.ts @@ -74,9 +74,9 @@ export const useFetchParserListOnMount = ( setSelectedTag(parserId); }, [parserId, documentId]); - const handleChange = (tag: string, checked: boolean) => { - const nextSelectedTag = checked ? tag : selectedTag; - setSelectedTag(nextSelectedTag); + const handleChange = (tag: string) => { + // const nextSelectedTag = checked ? tag : selectedTag; + setSelectedTag(tag); }; return { parserList: nextParserList, handleChange, selectedTag }; diff --git a/web/src/components/chunk-method-modal/index.less b/web/src/components/chunk-method-modal/index.less index 8123b026c..ec79449bf 100644 --- a/web/src/components/chunk-method-modal/index.less +++ b/web/src/components/chunk-method-modal/index.less @@ -8,3 +8,7 @@ cursor: help; writing-mode: horizontal-tb; } + +.chunkMethod { + margin-bottom: 0; +} diff --git a/web/src/components/chunk-method-modal/index.tsx b/web/src/components/chunk-method-modal/index.tsx index 7f592b546..7490b9b5d 100644 --- a/web/src/components/chunk-method-modal/index.tsx +++ b/web/src/components/chunk-method-modal/index.tsx @@ -13,9 +13,9 @@ import { Form, InputNumber, Modal, + Select, Space, Switch, - Tag, Tooltip, } from 'antd'; import omit from 'lodash/omit'; @@ -25,8 +25,6 @@ import { useFetchParserListOnMount } from './hooks'; import { useTranslate } from '@/hooks/commonHooks'; import styles from './index.less'; -const { CheckableTag } = Tag; - interface IProps extends Omit { loading: boolean; onOk: ( @@ -113,21 +111,14 @@ const ChunkMethodModal: React.FC = ({ afterClose={afterClose} > -
- {parserList.map((x) => { - return ( - { - handleChange(x.value, checked); - }} - > - {x.label} - - ); - })} -
+ +