瀏覽代碼

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 2 月之前
父節點
當前提交
3e27e97364

+ 22
- 2
web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/popup.tsx 查看文件

useBoolean, useBoolean,
useKeyPress, useKeyPress,
} from 'ahooks' } from 'ahooks'
import { useTranslation } from 'react-i18next'
import { Trans, useTranslation } from 'react-i18next'
import { import {
useStore, useStore,
useWorkflowStore, useWorkflowStore,
}) })
setPublished(true) setPublished(true)
if (res) { 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) workflowStore.getState().setPublishedAt(res.created_at)
mutateDatasetRes?.() mutateDatasetRes?.()
invalidPublishedPipelineInfo() invalidPublishedPipelineInfo()
} }
} }
catch { catch {
notify({ type: 'error', message: t('datasetPipeline.publishPipeline.error.message') })
} }
finally { finally {
if (publishing) if (publishing)

+ 9
- 0
web/i18n/en-US/dataset-pipeline.ts 查看文件

title: 'Are you sure to delete this pipeline template?', title: 'Are you sure to delete this pipeline template?',
content: 'Deleting the pipeline template is irreversible.', 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: { publishTemplate: {
success: { success: {
message: 'Pipeline Template Published', message: 'Pipeline Template Published',

+ 9
- 0
web/i18n/zh-Hans/dataset-pipeline.ts 查看文件

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

Loading…
取消
儲存