Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Infiniflow Ragflow UseBulkOperateDataset Hook

From Leeroopedia
Revision as of 11:22, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/Infiniflow_Ragflow_UseBulkOperateDataset_Hook.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Sources
Domains Frontend, Knowledge_Base
Last Updated 2026-02-12 06:00 GMT

Overview

Bulk operations hook providing enable, disable, run, cancel, metadata, and delete actions with document filtering for selected rows.

Description

useBulkOperateDataset takes row selection state and document list, resolves selected IDs via useSelectedIds, and provides six bulk operations: enable/disable (via useSetDocumentStatus), run (opens reparse modal), cancel parsing, batch metadata, and delete. The run operation filters out virtual documents and shows a toast error if none remain. Delete filters out currently-running documents. The hook computes total chunkNum across selected documents for the reparse dialog. It returns an action list array with id, label, icon, and onClick for each operation, plus modal state for the reparse confirmation.

Usage

Consumed by the bulk operation bar above the dataset table to provide batch document management actions.

Code Reference

Source Location

Signature

export function useBulkOperateDataset({
  rowSelection, setRowSelection, documents,
}: Pick<UseRowSelectionType, 'rowSelection' | 'setRowSelection'> & {
  documents: IDocumentInfo[];
}) => {
  chunkNum, list, visible, hideModal, showModal, handleRunClick,
};

Import

import { useBulkOperateDataset } from './use-bulk-operate-dataset';

I/O Contract

Inputs

Name Type Required Description
rowSelection object Yes TanStack row selection state
setRowSelection function Yes Reset selection callback
documents IDocumentInfo[] Yes Full document list for filtering

Outputs

Name Type Description
list array Action items with id, label, icon, onClick
chunkNum number Total chunks across selected documents
handleRunClick function Run selected documents with reparse options

Usage Examples

const { list, chunkNum, visible, hideModal, handleRunClick } = useBulkOperateDataset({
  rowSelection, setRowSelection, documents,
});

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment