fix: fix chunk and segment detail components (#14002)

This commit is contained in:
Wu Tianwei 2025-02-20 15:13:43 +08:00 committed by GitHub
parent bbfe83c86b
commit 9c42626772
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 4 additions and 11 deletions

View File

@ -265,7 +265,7 @@ export function Markdown(props: { content: string; className?: string }) {
}
},
]}
disallowedElements={['iframe', 'head', 'html', 'meta', 'link', 'style', 'body']}
disallowedElements={['iframe', 'head', 'html', 'meta', 'link', 'style', 'body', 'input']}
components={{
code: CodeBlock,
img: Img,

View File

@ -50,7 +50,6 @@ const ChildSegmentDetail: FC<IChildSegmentDetailProps> = ({
const handleCancel = () => {
onCancel()
setContent(childChunkInfo?.content || '')
}
const handleSave = () => {

View File

@ -80,7 +80,7 @@ export const useSegmentListContext = (selector: (value: SegmentListContextValue)
return useContextSelector(SegmentListContext, selector)
}
interface ICompletedProps {
type ICompletedProps = {
embeddingAvailable: boolean
showNewSegmentModal: boolean
onNewSegmentModalChange: (state: boolean) => void
@ -357,6 +357,7 @@ const Completed: FC<ICompletedProps> = ({
if (seg.id === segmentId) {
seg.answer = res.data.answer
seg.content = res.data.content
seg.sign_content = res.data.sign_content
seg.keywords = res.data.keywords
seg.word_count = res.data.word_count
seg.hit_count = res.data.hit_count

View File

@ -68,7 +68,6 @@ const NewChildSegmentModal: FC<NewChildSegmentModalProps> = ({
const handleCancel = (actionType: 'esc' | 'add' = 'esc') => {
if (actionType === 'esc' || !addAnother)
onCancel()
setContent('')
}
const { mutateAsync: addChildSegment } = useAddChildSegment()

View File

@ -49,7 +49,7 @@ const ChunkContent: FC<ChunkContentProps> = ({
isFullDocMode ? 'line-clamp-3' : isCollapsed ? 'line-clamp-2' : 'line-clamp-20',
className,
)}
content={sign_content || content}
content={sign_content || content || ''}
/>
}

View File

@ -57,9 +57,6 @@ const SegmentDetail: FC<ISegmentDetailProps> = ({
const handleCancel = () => {
onCancel()
setQuestion(segInfo?.content || '')
setAnswer(segInfo?.answer || '')
setKeywords(segInfo?.keywords || [])
}
const handleSave = () => {

View File

@ -70,9 +70,6 @@ const NewSegmentModal: FC<NewSegmentModalProps> = ({
const handleCancel = (actionType: 'esc' | 'add' = 'esc') => {
if (actionType === 'esc' || !addAnother)
onCancel()
setQuestion('')
setAnswer('')
setKeywords([])
}
const { mutateAsync: addSegment } = useAddSegment()