From f384d71da06755ebdf426f0d036412118ba38a5a Mon Sep 17 00:00:00 2001 From: calvin Date: Tue, 16 May 2023 16:52:48 +0800 Subject: [PATCH] [Improvement-14111][UI] Add a tooltip for the copy button of workflow definition. (#14116) --- .../src/locales/en_US/project.ts | 1 + .../src/locales/zh_CN/project.ts | 1 + .../projects/workflow/definition/use-table.ts | 54 ++++++++++--------- 3 files changed, 31 insertions(+), 25 deletions(-) diff --git a/dolphinscheduler-ui/src/locales/en_US/project.ts b/dolphinscheduler-ui/src/locales/en_US/project.ts index fbbc07689a..2c8b4350f8 100644 --- a/dolphinscheduler-ui/src/locales/en_US/project.ts +++ b/dolphinscheduler-ui/src/locales/en_US/project.ts @@ -80,6 +80,7 @@ export default { up_line: 'Online', down_line: 'Offline', copy_workflow: 'Copy Workflow', + copy_workflow_name: 'Copy workflow name', cron_manage: 'Cron manage', delete: 'Delete', tree_view: 'Tree View', diff --git a/dolphinscheduler-ui/src/locales/zh_CN/project.ts b/dolphinscheduler-ui/src/locales/zh_CN/project.ts index e00d8845a9..ba99ecee68 100644 --- a/dolphinscheduler-ui/src/locales/zh_CN/project.ts +++ b/dolphinscheduler-ui/src/locales/zh_CN/project.ts @@ -82,6 +82,7 @@ export default { up_line: '上线', down_line: '下线', copy_workflow: '复制工作流', + copy_workflow_name: '复制工作流名称', cron_manage: '定时管理', delete: '删除', tree_view: '工作流树形图', diff --git a/dolphinscheduler-ui/src/views/projects/workflow/definition/use-table.ts b/dolphinscheduler-ui/src/views/projects/workflow/definition/use-table.ts index 1de86d286c..f177692fd1 100644 --- a/dolphinscheduler-ui/src/views/projects/workflow/definition/use-table.ts +++ b/dolphinscheduler-ui/src/views/projects/workflow/definition/use-table.ts @@ -31,7 +31,7 @@ import { } from '@/service/modules/process-definition' import TableAction from './components/table-action' import styles from './index.module.scss' -import { NTag, NSpace, NIcon, NButton, NEllipsis } from 'naive-ui' +import { NTag, NSpace, NIcon, NButton, NEllipsis, NTooltip } from 'naive-ui' import { CopyOutlined } from '@vicons/antd' import ButtonLink from '@/components/button-link' import { @@ -129,17 +129,21 @@ export function useTable() { key: 'copy', ...COLUMN_WIDTH_CONFIG['copy'], render: (row) => - h( - NButton, - { - quaternary: true, - circle: true, - type: 'info', - size: 'tiny', - onClick: () => void copy(row.name) - }, - { icon: () => h(NIcon, { size: 16 }, () => h(CopyOutlined)) } - ) + h(NTooltip, null, { + trigger: () => + h( + NButton, + { + quaternary: true, + circle: true, + type: 'info', + size: 'tiny', + onClick: () => void copy(row.name) + }, + { icon: () => h(NIcon, { size: 16 }, () => h(CopyOutlined)) } + ), + default: () => t('project.workflow.copy_workflow_name') + }) }, { title: t('project.workflow.status'), @@ -148,19 +152,19 @@ export function useTable() { render: (row) => row.releaseState === 'ONLINE' ? h( - NTag, - { type: 'success', size: 'small' }, - { - default: () => t('project.workflow.up_line') - } - ) + NTag, + { type: 'success', size: 'small' }, + { + default: () => t('project.workflow.up_line') + } + ) : h( - NTag, - { type: 'warning', size: 'small' }, - { - default: () => t('project.workflow.down_line') - } - ) + NTag, + { type: 'warning', size: 'small' }, + { + default: () => t('project.workflow.down_line') + } + ) }, { title: t('project.workflow.schedule_publish_status'), @@ -309,7 +313,7 @@ export function useTable() { }) } - const batchCopyWorkflow = () => { } + const batchCopyWorkflow = () => {} const releaseWorkflow = (row: any) => { const data = {