From e1861f5f9cabdd2df1cb1461ec84d90fd9ca3e57 Mon Sep 17 00:00:00 2001 From: twwu Date: Fri, 25 Jul 2025 17:30:19 +0800 Subject: [PATCH] fix: add dataset reset functionality and improve warning message consistency --- .../datasets/create/empty-dataset-creation-modal/index.tsx | 3 +++ web/i18n/en-US/dataset-pipeline.ts | 2 +- web/i18n/zh-Hans/dataset-pipeline.ts | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/web/app/components/datasets/create/empty-dataset-creation-modal/index.tsx b/web/app/components/datasets/create/empty-dataset-creation-modal/index.tsx index f9a3584f7f..d2a3235d35 100644 --- a/web/app/components/datasets/create/empty-dataset-creation-modal/index.tsx +++ b/web/app/components/datasets/create/empty-dataset-creation-modal/index.tsx @@ -11,6 +11,7 @@ import Button from '@/app/components/base/button' import { ToastContext } from '@/app/components/base/toast' import { createEmptyDataset } from '@/service/datasets' +import { useResetDatasetList } from '@/service/knowledge/use-dataset' type IProps = { show: boolean @@ -25,6 +26,7 @@ const EmptyDatasetCreationModal = ({ const { t } = useTranslation() const { notify } = useContext(ToastContext) const router = useRouter() + const resetDatasetList = useResetDatasetList() const submit = async () => { if (!inputValue) { @@ -37,6 +39,7 @@ const EmptyDatasetCreationModal = ({ } try { const dataset = await createEmptyDataset({ name: inputValue }) + resetDatasetList() onHide() router.push(`/datasets/${dataset.id}/documents`) } diff --git a/web/i18n/en-US/dataset-pipeline.ts b/web/i18n/en-US/dataset-pipeline.ts index 207cadd57a..96761955ba 100644 --- a/web/i18n/en-US/dataset-pipeline.ts +++ b/web/i18n/en-US/dataset-pipeline.ts @@ -131,7 +131,7 @@ const translation = { title: 'Convert to Knowledge Pipeline', descriptionChunk1: 'You can now convert your existing knowledge base to use the Knowledge Pipeline for document processing', descriptionChunk2: ' — a more open and flexible approach with access to plugins from our marketplace. This will apply the new processing method to all future documents.', - warning: 'This action cannot be undone', + warning: 'This action cannot be undone.', confirm: { title: 'Confirmation', content: 'This action is permanent. You won\'t be able to revert to the previous method.Please confirm to convert.', diff --git a/web/i18n/zh-Hans/dataset-pipeline.ts b/web/i18n/zh-Hans/dataset-pipeline.ts index 351dc9d069..dc8b11a840 100644 --- a/web/i18n/zh-Hans/dataset-pipeline.ts +++ b/web/i18n/zh-Hans/dataset-pipeline.ts @@ -131,7 +131,7 @@ const translation = { title: '转换为知识库 pipeline', descriptionChunk1: '您现在可以将现有知识库转换为使用知识库 pipeline 来处理文档', descriptionChunk2: ' —— 这是一种更开放、更灵活的方式,可以访问我们市场中的插件。新的处理方式将应用到后续添加的所有文档。', - warning: '此操作无法撤销', + warning: '此操作无法撤销。', confirm: { title: '确认', content: '此操作是永久性的。您将无法恢复到之前的方式。请确认转换。',