mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-06-29 15:31:05 +08:00
Fix: Some bugs (#14734)
### What problem does this PR solve? Fix: Some bugs - Error during batch modification of metadata in the Knowledge Base - Manually configured metadata is not displayed in search settings ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@@ -50,10 +50,18 @@ export function MetadataFilter({
|
||||
|
||||
const methodName = prefix + 'meta_data_filter.method';
|
||||
|
||||
const kbIds: string[] = useWatch({
|
||||
const datasetIds: string[] = useWatch({
|
||||
control: form.control,
|
||||
name: prefix + 'dataset_ids',
|
||||
});
|
||||
|
||||
const oldKbIds: string[] = useWatch({
|
||||
control: form.control,
|
||||
name: prefix + 'kb_ids',
|
||||
});
|
||||
|
||||
const kbIds = datasetIds || oldKbIds || [];
|
||||
|
||||
const metadata = useWatch({
|
||||
control: form.control,
|
||||
name: methodName,
|
||||
|
||||
@@ -14,7 +14,10 @@ import {
|
||||
DropdownMenuSeparator,
|
||||
DropdownMenuTrigger,
|
||||
} from '@/components/ui/dropdown-menu';
|
||||
import { useRowSelection } from '@/hooks/logic-hooks/use-row-selection';
|
||||
import {
|
||||
useRowSelection,
|
||||
useSelectedIds,
|
||||
} from '@/hooks/logic-hooks/use-row-selection';
|
||||
import { useFetchDocumentList } from '@/hooks/use-document-request';
|
||||
import { useFetchKnowledgeBaseConfiguration } from '@/hooks/use-knowledge-request';
|
||||
import { LucidePlus } from 'lucide-react';
|
||||
@@ -93,6 +96,11 @@ export default function Dataset() {
|
||||
setRowSelection,
|
||||
});
|
||||
|
||||
const { selectedIds: selectedRowKeys } = useSelectedIds(
|
||||
rowSelection,
|
||||
documents,
|
||||
);
|
||||
|
||||
const handleAddMetadataWithDocuments = () => {
|
||||
showManageMetadataModal({
|
||||
type: MetadataType.Manage,
|
||||
@@ -117,7 +125,7 @@ export default function Dataset() {
|
||||
</div> */}
|
||||
</div>
|
||||
),
|
||||
documentIds: documents.map((doc) => doc.id),
|
||||
documentIds: selectedRowKeys,
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user