Quellcode durchsuchen

feat(publish): improve success and error notifications for knowledge pipeline publishing with localized messages and enhanced user guidance

tags/2.0.0-beta.1
twwu vor 2 Monaten
Ursprung
Commit
3e27e97364

+ 22
- 2
web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/popup.tsx Datei anzeigen

@@ -13,7 +13,7 @@ import {
useBoolean,
useKeyPress,
} from 'ahooks'
import { useTranslation } from 'react-i18next'
import { Trans, useTranslation } from 'react-i18next'
import {
useStore,
useWorkflowStore,
@@ -107,7 +107,26 @@ const Popup = () => {
})
setPublished(true)
if (res) {
notify({ type: 'success', message: t('common.api.actionSuccess') })
notify({
type: 'success',
message: t('datasetPipeline.publishPipeline.success.message'),
children: (
<div className='system-xs-regular text-text-secondary'>
<Trans
i18nKey='datasetPipeline.publishPipeline.success.tip'
components={{
CustomLink: (
<Link
className='system-xs-medium text-text-accent'
href={`/datasets/${datasetId}/documents`}
>
</Link>
),
}}
/>
</div>
),
})
workflowStore.getState().setPublishedAt(res.created_at)
mutateDatasetRes?.()
invalidPublishedPipelineInfo()
@@ -116,6 +135,7 @@ const Popup = () => {
}
}
catch {
notify({ type: 'error', message: t('datasetPipeline.publishPipeline.error.message') })
}
finally {
if (publishing)

+ 9
- 0
web/i18n/en-US/dataset-pipeline.ts Datei anzeigen

@@ -39,6 +39,15 @@ const translation = {
title: 'Are you sure to delete this pipeline template?',
content: 'Deleting the pipeline template is irreversible.',
},
publishPipeline: {
success: {
message: 'Knowledge Pipeline Published',
tip: '<CustomLink>Go to Documents</CustomLink> to add or manage documents.',
},
error: {
message: 'Failed to Publish Knowledge Pipeline',
},
},
publishTemplate: {
success: {
message: 'Pipeline Template Published',

+ 9
- 0
web/i18n/zh-Hans/dataset-pipeline.ts Datei anzeigen

@@ -39,6 +39,15 @@ const translation = {
title: '要删除此知识流水线模板吗?',
content: '删除知识流水线模板是不可逆的。',
},
publishPipeline: {
success: {
message: '知识流水线发布成功',
tip: '<CustomLink>前往文档</CustomLink>添加或管理文档。',
},
error: {
message: '知识流水线发布失败',
},
},
publishTemplate: {
success: {
message: '知识流水线模板发布成功',

Laden…
Abbrechen
Speichern