Skip to content

Commit 51e5048

Browse files
committed
[Improvement-17947][ui] Fix delete confirmation i18n and warning style
1 parent d1709ed commit 51e5048

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

dolphinscheduler-ui/src/locales/en_US/project.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ export default {
150150
end_time: 'End Time',
151151
crontab: 'Crontab',
152152
delete_confirm: 'Delete?',
153+
delete_confirm_with_name: 'Delete "{name}"?',
153154
delete_irreversible:
154155
'This action cannot be undone. The workflow and its associated data will be permanently deleted.',
155156
enter_name_tips: 'Please enter name',

dolphinscheduler-ui/src/locales/zh_CN/project.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ export default {
149149
end_time: '结束时间',
150150
crontab: 'Crontab',
151151
delete_confirm: '确定删除吗?',
152+
delete_confirm_with_name: '确定删除“{name}”吗?',
152153
delete_irreversible: '此操作不可撤销。工作流及其关联数据将被永久删除。',
153154
enter_name_tips: '请输入名称',
154155
switch_version: '切换到该版本',

dolphinscheduler-ui/src/views/projects/workflow/definition/components/table-action.tsx

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717

1818
import { defineComponent, PropType, toRefs } from 'vue'
19-
import { NSpace, NTooltip, NButton, NIcon, NPopconfirm } from 'naive-ui'
19+
import { NSpace, NTooltip, NButton, NIcon, NPopconfirm, NText } from 'naive-ui'
2020
import {
2121
DeleteOutlined,
2222
DownloadOutlined,
@@ -274,14 +274,22 @@ export default defineComponent({
274274
default: () => (
275275
<div style={{ maxWidth: 360 }}>
276276
<div style={{ fontWeight: 600, marginBottom: 6 }}>
277-
{`${t('project.workflow.delete_confirm')} "${
278-
this.row?.name || ''
279-
}"`}
280-
</div>
281-
<div style={{ color: '#ff4d4f' }}>
282-
{t('project.workflow.delete_irreversible') ||
283-
'This action cannot be undone. The workflow and its associated data will be permanently deleted.'}
277+
{(() => {
278+
const workflowName = (this.row?.name || '').trim()
279+
if (!workflowName) {
280+
return t('project.workflow.delete_confirm')
281+
}
282+
return t(
283+
'project.workflow.delete_confirm_with_name',
284+
{
285+
name: workflowName
286+
}
287+
)
288+
})()}
284289
</div>
290+
<NText type='error'>
291+
{t('project.workflow.delete_irreversible')}
292+
</NText>
285293
</div>
286294
),
287295
trigger: () => (

0 commit comments

Comments
 (0)