Skip to content

Commit 278335c

Browse files
authored
[Improvement-17947][ui] Improve delete confirmation to show workflow name (#18029)
1 parent 07f4dfb commit 278335c

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@ export default {
150150
end_time: 'End Time',
151151
crontab: 'Crontab',
152152
delete_confirm: 'Delete?',
153+
delete_confirm_with_name: 'Delete "{name}"?',
154+
delete_irreversible:
155+
'This action cannot be undone. The workflow and its associated data will be permanently deleted.',
153156
enter_name_tips: 'Please enter name',
154157
switch_version: 'Switch To This Version',
155158
confirm_switch_version: 'Confirm Switch To This Version?',

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

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

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

Lines changed: 22 additions & 2 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,
@@ -271,7 +271,27 @@ export default defineComponent({
271271
onPositiveClick={this.handleDeleteWorkflow}
272272
>
273273
{{
274-
default: () => t('project.workflow.delete_confirm'),
274+
default: () => (
275+
<div style={{ maxWidth: 360 }}>
276+
<div style={{ fontWeight: 600, marginBottom: 6 }}>
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+
})()}
289+
</div>
290+
<NText type='error'>
291+
{t('project.workflow.delete_irreversible')}
292+
</NText>
293+
</div>
294+
),
275295
trigger: () => (
276296
<NButton
277297
size='small'

0 commit comments

Comments
 (0)