Skip to content

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

Fix: After deleting all compiled entities, returning to this page will show an empty data entry. (#18724)

balibabu0d747c6a3fe2
diff --git a/web/src/pages/user-setting/compilation-templates/edit-next/hooks/use-blueprint-selection.ts b/web/src/pages/user-setting/compilation-templates/edit-next/hooks/use-blueprint-selection.ts
index 2e8750369b..e389f66120 100644
--- a/web/src/pages/user-setting/compilation-templates/edit-next/hooks/use-blueprint-selection.ts
+++ b/web/src/pages/user-setting/compilation-templates/edit-next/hooks/use-blueprint-selection.ts
@@ -22,7 +22,6 @@ import {
import { capitalize, lowerCase } from 'lodash';
import { useCallback, useMemo, useState } from 'react';
import { UseFormReturn, useWatch } from 'react-hook-form';
-import { useTranslation } from 'react-i18next';
import { FormSchemaType } from '../schema';
@@ -49,7 +48,6 @@ export function useBlueprintSelection({
presets,
builtins,
}: UseBlueprintSelectionParams) {
- const { t } = useTranslation();
const [explicitValue, setExplicitValue] = useState<string>();
const kindPath = `templates.${selectedTemplateIndex}.kind` as const;
diff --git a/web/src/pages/user-setting/compilation-templates/edit-next/utils.ts b/web/src/pages/user-setting/compilation-templates/edit-next/utils.ts
index 99e89f980b..e6e832898f 100644
--- a/web/src/pages/user-setting/compilation-templates/edit-next/utils.ts
+++ b/web/src/pages/user-setting/compilation-templates/edit-next/utils.ts
@@ -29,7 +29,6 @@ import { CompilationTemplateKind } from '@/constants/compilation';
import { FormSchemaType, TemplateSchemaType } from './schema';
import {
- DefaultFieldKeys,
DefaultTemplateValues,
FieldKeyOrders,
SectionPriority,
@@ -66,14 +65,11 @@ export const normalizeSection = (
const fields = section?.fields ?? [];
return {
description: section?.description ?? '',
- fields:
- fields.length > 0
- ? fields.map((field) =>
- Object.fromEntries(
- Object.entries(field).map(([key, value]) => [key, value ?? '']),
- ),
- )
- : [createEmptyField(DefaultFieldKeys)],
+ fields: fields.map((field) =>
+ Object.fromEntries(
+ Object.entries(field).map(([key, value]) => [key, value ?? '']),
+ ),
+ ),
};
};
@@ -264,7 +260,7 @@ export const transformTemplateToPayload = (template: TemplateSchemaType) => {
return;
}
if (key === 'mode') {
- config[key] = value as ICompilationTemplateConfigRequest[string];
+ config.mode = value as ICompilationTemplateConfigRequest['mode'];
return;
}
if (isConfigMetaKey(key)) {