This is an automated email from the ASF dual-hosted git repository.
songjian pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
The following commit(s) were added to refs/heads/dev by this push:
new a485771 [Fix][UI Next][V1.0.0-Alpha] Add the hover tips for the
datasource ta… (#8977)
a485771 is described below
commit a485771a738397dc8ced69636a3098eb89b47741
Author: Amy0104 <[email protected]>
AuthorDate: Fri Mar 18 14:29:51 2022 +0800
[Fix][UI Next][V1.0.0-Alpha] Add the hover tips for the datasource ta…
(#8977)
* [Fix][UI Next][V1.0.0-Alpha] Add the hover tips for the datasource table
action buttons.
* [Fix][UI Next][V1.0.0-Alpha] Remove the unused paramter for the
datasource table operation column render function.
---
.../src/locales/modules/en_US.ts | 1 +
.../src/locales/modules/zh_CN.ts | 1 +
.../src/views/datasource/list/use-columns.ts | 94 +++++++++++++---------
3 files changed, 58 insertions(+), 38 deletions(-)
diff --git a/dolphinscheduler-ui-next/src/locales/modules/en_US.ts
b/dolphinscheduler-ui-next/src/locales/modules/en_US.ts
index 646d75c..649dae0 100644
--- a/dolphinscheduler-ui-next/src/locales/modules/en_US.ts
+++ b/dolphinscheduler-ui-next/src/locales/modules/en_US.ts
@@ -1157,6 +1157,7 @@ const datasource = {
click_to_view: 'Click to view',
delete: 'Delete',
confirm: 'Confirm',
+ delete_confirm: 'Delete?',
cancel: 'Cancel',
create: 'Create',
edit: 'Edit',
diff --git a/dolphinscheduler-ui-next/src/locales/modules/zh_CN.ts
b/dolphinscheduler-ui-next/src/locales/modules/zh_CN.ts
index 5cd10ae..5dd3ec3 100644
--- a/dolphinscheduler-ui-next/src/locales/modules/zh_CN.ts
+++ b/dolphinscheduler-ui-next/src/locales/modules/zh_CN.ts
@@ -1144,6 +1144,7 @@ const datasource = {
click_to_view: '点击查看',
delete: '删除',
confirm: '确定',
+ delete_confirm: '删除?',
cancel: '取消',
create: '创建',
edit: '编辑',
diff --git a/dolphinscheduler-ui-next/src/views/datasource/list/use-columns.ts
b/dolphinscheduler-ui-next/src/views/datasource/list/use-columns.ts
index 493c506..02f6c70 100644
--- a/dolphinscheduler-ui-next/src/views/datasource/list/use-columns.ts
+++ b/dolphinscheduler-ui-next/src/views/datasource/list/use-columns.ts
@@ -17,7 +17,14 @@
import { h } from 'vue'
import { useI18n } from 'vue-i18n'
-import { NPopover, NButton, NIcon, NPopconfirm, NSpace } from 'naive-ui'
+import {
+ NPopover,
+ NButton,
+ NIcon,
+ NPopconfirm,
+ NSpace,
+ NTooltip
+} from 'naive-ui'
import { EditOutlined, DeleteOutlined } from '@vicons/antd'
import JsonHighlight from './json-highlight'
import ButtonLink from '@/components/button-link'
@@ -78,45 +85,56 @@ export function useColumns(onCallback: Function) {
title: t('datasource.operation'),
key: 'operation',
width: 150,
- render: (rowData, unused) => {
+ render: (rowData) => {
return h(NSpace, null, {
default: () => [
- h(
- NButton,
- {
- circle: true,
- type: 'info',
- onClick: () => void onCallback(rowData.id, 'edit')
- },
- {
- default: () =>
- h(NIcon, null, { default: () => h(EditOutlined) })
- }
- ),
- h(
- NPopconfirm,
- {
- onPositiveClick: () => void onCallback(rowData.id, 'delete'),
- negativeText: t('datasource.cancel'),
- positiveText: t('datasource.confirm')
- },
- {
- trigger: () =>
- h(
- NButton,
- {
- circle: true,
- type: 'error',
- class: 'btn-delete'
- },
- {
- default: () =>
- h(NIcon, null, { default: () => h(DeleteOutlined) })
- }
- ),
- default: () => t('datasource.delete')
- }
- )
+ h(NTooltip, null, {
+ trigger: () =>
+ h(
+ NButton,
+ {
+ circle: true,
+ type: 'info',
+ onClick: () => void onCallback(rowData.id, 'edit')
+ },
+ {
+ default: () =>
+ h(NIcon, null, { default: () => h(EditOutlined) })
+ }
+ ),
+ default: () => t('datasource.edit')
+ }),
+ h(NTooltip, null, {
+ trigger: () =>
+ h(
+ NPopconfirm,
+ {
+ onPositiveClick: () =>
+ void onCallback(rowData.id, 'delete'),
+ negativeText: t('datasource.cancel'),
+ positiveText: t('datasource.confirm')
+ },
+ {
+ trigger: () =>
+ h(
+ NButton,
+ {
+ circle: true,
+ type: 'error',
+ class: 'btn-delete'
+ },
+ {
+ default: () =>
+ h(NIcon, null, {
+ default: () => h(DeleteOutlined)
+ })
+ }
+ ),
+ default: () => t('datasource.delete_confirm')
+ }
+ ),
+ default: () => t('datasource.delete')
+ })
]
})
}