fix: fix chunk and segment detail components (#14002)
This commit is contained in:
parent
bbfe83c86b
commit
9c42626772
@ -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={{
|
components={{
|
||||||
code: CodeBlock,
|
code: CodeBlock,
|
||||||
img: Img,
|
img: Img,
|
||||||
|
@ -50,7 +50,6 @@ const ChildSegmentDetail: FC<IChildSegmentDetailProps> = ({
|
|||||||
|
|
||||||
const handleCancel = () => {
|
const handleCancel = () => {
|
||||||
onCancel()
|
onCancel()
|
||||||
setContent(childChunkInfo?.content || '')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleSave = () => {
|
const handleSave = () => {
|
||||||
|
@ -80,7 +80,7 @@ export const useSegmentListContext = (selector: (value: SegmentListContextValue)
|
|||||||
return useContextSelector(SegmentListContext, selector)
|
return useContextSelector(SegmentListContext, selector)
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ICompletedProps {
|
type ICompletedProps = {
|
||||||
embeddingAvailable: boolean
|
embeddingAvailable: boolean
|
||||||
showNewSegmentModal: boolean
|
showNewSegmentModal: boolean
|
||||||
onNewSegmentModalChange: (state: boolean) => void
|
onNewSegmentModalChange: (state: boolean) => void
|
||||||
@ -357,6 +357,7 @@ const Completed: FC<ICompletedProps> = ({
|
|||||||
if (seg.id === segmentId) {
|
if (seg.id === segmentId) {
|
||||||
seg.answer = res.data.answer
|
seg.answer = res.data.answer
|
||||||
seg.content = res.data.content
|
seg.content = res.data.content
|
||||||
|
seg.sign_content = res.data.sign_content
|
||||||
seg.keywords = res.data.keywords
|
seg.keywords = res.data.keywords
|
||||||
seg.word_count = res.data.word_count
|
seg.word_count = res.data.word_count
|
||||||
seg.hit_count = res.data.hit_count
|
seg.hit_count = res.data.hit_count
|
||||||
|
@ -68,7 +68,6 @@ const NewChildSegmentModal: FC<NewChildSegmentModalProps> = ({
|
|||||||
const handleCancel = (actionType: 'esc' | 'add' = 'esc') => {
|
const handleCancel = (actionType: 'esc' | 'add' = 'esc') => {
|
||||||
if (actionType === 'esc' || !addAnother)
|
if (actionType === 'esc' || !addAnother)
|
||||||
onCancel()
|
onCancel()
|
||||||
setContent('')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const { mutateAsync: addChildSegment } = useAddChildSegment()
|
const { mutateAsync: addChildSegment } = useAddChildSegment()
|
||||||
|
@ -49,7 +49,7 @@ const ChunkContent: FC<ChunkContentProps> = ({
|
|||||||
isFullDocMode ? 'line-clamp-3' : isCollapsed ? 'line-clamp-2' : 'line-clamp-20',
|
isFullDocMode ? 'line-clamp-3' : isCollapsed ? 'line-clamp-2' : 'line-clamp-20',
|
||||||
className,
|
className,
|
||||||
)}
|
)}
|
||||||
content={sign_content || content}
|
content={sign_content || content || ''}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,9 +57,6 @@ const SegmentDetail: FC<ISegmentDetailProps> = ({
|
|||||||
|
|
||||||
const handleCancel = () => {
|
const handleCancel = () => {
|
||||||
onCancel()
|
onCancel()
|
||||||
setQuestion(segInfo?.content || '')
|
|
||||||
setAnswer(segInfo?.answer || '')
|
|
||||||
setKeywords(segInfo?.keywords || [])
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleSave = () => {
|
const handleSave = () => {
|
||||||
|
@ -70,9 +70,6 @@ const NewSegmentModal: FC<NewSegmentModalProps> = ({
|
|||||||
const handleCancel = (actionType: 'esc' | 'add' = 'esc') => {
|
const handleCancel = (actionType: 'esc' | 'add' = 'esc') => {
|
||||||
if (actionType === 'esc' || !addAnother)
|
if (actionType === 'esc' || !addAnother)
|
||||||
onCancel()
|
onCancel()
|
||||||
setQuestion('')
|
|
||||||
setAnswer('')
|
|
||||||
setKeywords([])
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const { mutateAsync: addSegment } = useAddSegment()
|
const { mutateAsync: addSegment } = useAddSegment()
|
||||||
|
Loading…
Reference in New Issue
Block a user