Implementation:Infiniflow Ragflow SavingButton Component
| Knowledge Sources | |
|---|---|
| Domains | Frontend, Knowledge_Base |
| Last Updated | 2026-02-12 06:00 GMT |
Overview
Save button components with form validation and knowledge base configuration persistence for both general and parser settings.
Description
This module exports two button components. GeneralSavingButton validates only the name field via form.trigger('name'), then saves a subset of form values (name, description, permission, avatar) along with the existing parser_id from default values. SavingButton validates the entire form, then saves all form values with parser_config transformations: it synchronizes image_context_size and table_context_size from image_table_context_window, and conditionally unsets children_delimiter when enable_children is false. Both use useUpdateKnowledge for the API call and ButtonLoading for loading state.
Usage
Placed at the bottom of the general settings and parser settings sections respectively within the dataset configuration page.
Code Reference
Source Location
- Repository: Infiniflow_Ragflow
- File: web/src/pages/dataset/dataset-setting/saving-button.tsx
- Lines: 1-100
Signature
export function GeneralSavingButton(): JSX.Element;
export function SavingButton(): JSX.Element;
Import
import { GeneralSavingButton, SavingButton } from './saving-button';
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| (FormContext) | react-hook-form context | Yes | Parent form providing all dataset fields |
| (URL params) | string | Yes | kb_id from route params |
Outputs
| Name | Type | Description |
|---|---|---|
| JSX.Element | React element | Save button with loading state |
Usage Examples
<FormProvider {...form}>
<GeneralForm />
<GeneralSavingButton />
</FormProvider>