mirror of https://github.com/langgenius/dify.git
feat(publish): improve success and error notifications for knowledge pipeline publishing with localized messages and enhanced user guidance
This commit is contained in:
parent
9d3198f808
commit
3e27e97364
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -39,6 +39,15 @@ const translation = {
|
|||
title: '要删除此知识流水线模板吗?',
|
||||
content: '删除知识流水线模板是不可逆的。',
|
||||
},
|
||||
publishPipeline: {
|
||||
success: {
|
||||
message: '知识流水线发布成功',
|
||||
tip: '<CustomLink>前往文档</CustomLink>添加或管理文档。',
|
||||
},
|
||||
error: {
|
||||
message: '知识流水线发布失败',
|
||||
},
|
||||
},
|
||||
publishTemplate: {
|
||||
success: {
|
||||
message: '知识流水线模板发布成功',
|
||||
|
|
|
|||
Loading…
Reference in New Issue