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 MetadataConstants

From Leeroopedia
Revision as of 11:21, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/Infiniflow_Ragflow_MetadataConstants.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

Metadata type enums, delete-confirmation message maps, and value-type label helpers for the dataset metadata subsystem.

Description

This constants module defines the MetadataType enum (Manage, UpdateSingle, Setting, SingleFileSetting) that controls metadata editing modes. MetadataDeleteMap is a factory that accepts an i18n translation function and returns per-mode warning messages for field and value deletion confirmations. The file also exports VALUE_TYPE_LABELS (string, time, number, list), metadataValueTypeEnum, metadataValueTypeOptions for select dropdowns, and getMetadataValueTypeLabel for display resolution.

Usage

Import these constants in metadata management components and hooks to drive conditional UI rendering, populate type selectors, and display context-appropriate deletion warnings.

Code Reference

Source Location

Signature

export enum MetadataType {
  Manage = 1, UpdateSingle = 2, Setting = 3, SingleFileSetting = 4,
}

export const MetadataDeleteMap = (t: TFunction): Record<MetadataType, { title: string; warnFieldText: string; warnValueText: string; warnFieldName: string; warnValueName: string }>;

export const DEFAULT_VALUE_TYPE: MetadataValueType;
export const VALUE_TYPE_LABELS: Record<MetadataValueType, string>;
export const metadataValueTypeEnum: Record<MetadataValueType, MetadataValueType>;
export const metadataValueTypeOptions: { label: string; value: string }[];
export const getMetadataValueTypeLabel: (value?: MetadataValueType) => string;

Import

import { MetadataType, MetadataDeleteMap, VALUE_TYPE_LABELS, metadataValueTypeOptions, getMetadataValueTypeLabel } from '../constant';

I/O Contract

Inputs

Name Type Required Description
t TFunction Yes i18n translation function for MetadataDeleteMap
value MetadataValueType No Value type key for getMetadataValueTypeLabel

Outputs

Name Type Description
MetadataDeleteMap result Record<MetadataType, object> Per-mode warning strings for delete confirmations
metadataValueTypeOptions Array Select dropdown options for value types

Usage Examples

import { MetadataType, MetadataDeleteMap, metadataValueTypeOptions } from '../constant';

// Get delete warning text for the current mode
const warnings = MetadataDeleteMap(t)[MetadataType.Manage];
console.log(warnings.warnFieldText);

// Populate a select dropdown
<Select options={metadataValueTypeOptions} />

Related Pages

Page Connections

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