Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Feat: If a compilation type is not selected, the toggle for re-splitting Parser output is not displayed. (#19771)

balibabu1ee80e271583
diff --git a/web/src/pages/user-setting/compilation-templates/edit-next/components/template-configuration.tsx b/web/src/pages/user-setting/compilation-templates/edit-next/components/template-configuration.tsx
index 56f795fb37..0f6a63e5cd 100644
--- a/web/src/pages/user-setting/compilation-templates/edit-next/components/template-configuration.tsx
+++ b/web/src/pages/user-setting/compilation-templates/edit-next/components/template-configuration.tsx
@@ -21,7 +21,7 @@ import { Input } from '@/components/ui/input';
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
import { Textarea } from '@/components/ui/textarea';
import { ICompilationTemplateBuiltin } from '@/interfaces/database/compilation-template';
-import { startCase } from 'lodash';
+import { isEmpty, startCase } from 'lodash';
import { ReactNode, useCallback } from 'react';
import { UseFormReturn, useWatch } from 'react-hook-form';
import { useTranslation } from 'react-i18next';
@@ -214,8 +214,14 @@ export function TemplateConfiguration({
onChange={field.onChange}
disabled={field.disabled}
options={[
- { label: t('knowledgeCompilation.entityMode'), value: 'entity' },
- { label: t('knowledgeCompilation.topicMode'), value: 'topic' },
+ {
+ label: t('knowledgeCompilation.entityMode'),
+ value: 'entity',
+ },
+ {
+ label: t('knowledgeCompilation.topicMode'),
+ value: 'topic',
+ },
]}
/>
)}
@@ -226,7 +232,7 @@ export function TemplateConfiguration({
<TreeTemplateFields index={selectedTemplateIndex} />
) : (
<>
- {kind !== CompilationTemplateKind.Artifacts && (
+ {kind !== CompilationTemplateKind.Artifacts && !isEmpty(kind) && (
<>
<SwitchFormField
name={`templates.${selectedTemplateIndex}.config.rechunk`}
@@ -240,7 +246,9 @@ export function TemplateConfiguration({
label={t('knowledgeCompilation.rechunkRules')}
>
<Textarea
- placeholder={t('knowledgeCompilation.rechunkRulesPlaceholder')}
+ placeholder={t(
+ 'knowledgeCompilation.rechunkRulesPlaceholder',
+ )}
rows={6}
resize="vertical"
/>