mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Fix: File selection in Retrieval testing causes other options to disappear (#7759)
### What problem does this PR solve? https://github.com/infiniflow/ragflow/issues/7753 The internal is due to when the selected row keys change will trigger a testing, but I do not know why. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -18,10 +18,15 @@ type FieldType = {
|
||||
|
||||
interface IProps {
|
||||
form: FormInstance;
|
||||
handleTesting: () => Promise<any>;
|
||||
handleTesting: (documentIds?: string[]) => Promise<any>;
|
||||
selectedDocumentIds: string[];
|
||||
}
|
||||
|
||||
const TestingControl = ({ form, handleTesting }: IProps) => {
|
||||
const TestingControl = ({
|
||||
form,
|
||||
handleTesting,
|
||||
selectedDocumentIds,
|
||||
}: IProps) => {
|
||||
const question = Form.useWatch('question', { form, preserve: true });
|
||||
const loading = useChunkIsTesting();
|
||||
const { t } = useTranslate('knowledgeDetails');
|
||||
@ -29,6 +34,10 @@ const TestingControl = ({ form, handleTesting }: IProps) => {
|
||||
const buttonDisabled =
|
||||
!question || (typeof question === 'string' && question.trim() === '');
|
||||
|
||||
const onClick = () => {
|
||||
handleTesting(selectedDocumentIds);
|
||||
};
|
||||
|
||||
return (
|
||||
<section className={styles.testingControlWrapper}>
|
||||
<div>
|
||||
@ -53,7 +62,7 @@ const TestingControl = ({ form, handleTesting }: IProps) => {
|
||||
<Button
|
||||
type="primary"
|
||||
size="small"
|
||||
onClick={handleTesting}
|
||||
onClick={onClick}
|
||||
disabled={buttonDisabled}
|
||||
loading={loading}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user