balibabu
commited on
Commit
·
9426215
1
Parent(s):
c365dd0
feat: add Tooltip to action icon of FileManager (#561)
Browse files### What problem does this PR solve?
#345
feat: add Tooltip to action icon of FileManager
### Type of change
- [x] New Feature (non-breaking change which adds functionality)
web/src/locales/en.ts
CHANGED
@@ -23,6 +23,7 @@ export default {
|
|
23 |
copy: 'Copy',
|
24 |
copied: 'Copied',
|
25 |
comingSoon: 'Coming Soon',
|
|
|
26 |
},
|
27 |
login: {
|
28 |
login: 'Sign in',
|
|
|
23 |
copy: 'Copy',
|
24 |
copied: 'Copied',
|
25 |
comingSoon: 'Coming Soon',
|
26 |
+
download: 'Download',
|
27 |
},
|
28 |
login: {
|
29 |
login: 'Sign in',
|
web/src/locales/zh-traditional.ts
CHANGED
@@ -23,6 +23,7 @@ export default {
|
|
23 |
copy: '複製',
|
24 |
copied: '複製成功',
|
25 |
comingSoon: '即將推出',
|
|
|
26 |
},
|
27 |
login: {
|
28 |
login: '登入',
|
|
|
23 |
copy: '複製',
|
24 |
copied: '複製成功',
|
25 |
comingSoon: '即將推出',
|
26 |
+
download: '下載',
|
27 |
},
|
28 |
login: {
|
29 |
login: '登入',
|
web/src/locales/zh.ts
CHANGED
@@ -23,6 +23,7 @@ export default {
|
|
23 |
copy: '复制',
|
24 |
copied: '复制成功',
|
25 |
comingSoon: '即将推出',
|
|
|
26 |
},
|
27 |
login: {
|
28 |
login: '登录',
|
|
|
23 |
copy: '复制',
|
24 |
copied: '复制成功',
|
25 |
comingSoon: '即将推出',
|
26 |
+
download: '下载',
|
27 |
},
|
28 |
login: {
|
29 |
login: '登录',
|
web/src/pages/file-manager/action-cell/index.tsx
CHANGED
@@ -6,7 +6,7 @@ import {
|
|
6 |
DeleteOutlined,
|
7 |
DownloadOutlined,
|
8 |
EditOutlined,
|
9 |
-
|
10 |
} from '@ant-design/icons';
|
11 |
import { Button, Space, Tooltip } from 'antd';
|
12 |
import { useHandleDeleteFile } from '../hooks';
|
@@ -30,7 +30,7 @@ const ActionCell = ({
|
|
30 |
}: IProps) => {
|
31 |
const documentId = record.id;
|
32 |
const beingUsed = false;
|
33 |
-
const { t } = useTranslate('
|
34 |
const { handleRemoveFile } = useHandleDeleteFile(
|
35 |
[documentId],
|
36 |
setSelectedRowKeys,
|
@@ -58,13 +58,15 @@ const ActionCell = ({
|
|
58 |
|
59 |
return (
|
60 |
<Space size={0}>
|
61 |
-
<
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
|
|
|
|
68 |
|
69 |
<Tooltip title={t('rename', { keyPrefix: 'common' })}>
|
70 |
<Button
|
@@ -76,23 +78,27 @@ const ActionCell = ({
|
|
76 |
<EditOutlined size={20} />
|
77 |
</Button>
|
78 |
</Tooltip>
|
79 |
-
<
|
80 |
-
type="text"
|
81 |
-
disabled={beingUsed}
|
82 |
-
onClick={handleRemoveFile}
|
83 |
-
className={styles.iconButton}
|
84 |
-
>
|
85 |
-
<DeleteOutlined size={20} />
|
86 |
-
</Button>
|
87 |
-
{record.type !== 'folder' && (
|
88 |
<Button
|
89 |
type="text"
|
90 |
disabled={beingUsed}
|
91 |
-
onClick={
|
92 |
className={styles.iconButton}
|
93 |
>
|
94 |
-
<
|
95 |
</Button>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
)}
|
97 |
</Space>
|
98 |
);
|
|
|
6 |
DeleteOutlined,
|
7 |
DownloadOutlined,
|
8 |
EditOutlined,
|
9 |
+
LinkOutlined,
|
10 |
} from '@ant-design/icons';
|
11 |
import { Button, Space, Tooltip } from 'antd';
|
12 |
import { useHandleDeleteFile } from '../hooks';
|
|
|
30 |
}: IProps) => {
|
31 |
const documentId = record.id;
|
32 |
const beingUsed = false;
|
33 |
+
const { t } = useTranslate('fileManager');
|
34 |
const { handleRemoveFile } = useHandleDeleteFile(
|
35 |
[documentId],
|
36 |
setSelectedRowKeys,
|
|
|
58 |
|
59 |
return (
|
60 |
<Space size={0}>
|
61 |
+
<Tooltip title={t('addToKnowledge')}>
|
62 |
+
<Button
|
63 |
+
type="text"
|
64 |
+
className={styles.iconButton}
|
65 |
+
onClick={onShowConnectToKnowledgeModal}
|
66 |
+
>
|
67 |
+
<LinkOutlined size={20} />
|
68 |
+
</Button>
|
69 |
+
</Tooltip>
|
70 |
|
71 |
<Tooltip title={t('rename', { keyPrefix: 'common' })}>
|
72 |
<Button
|
|
|
78 |
<EditOutlined size={20} />
|
79 |
</Button>
|
80 |
</Tooltip>
|
81 |
+
<Tooltip title={t('delete', { keyPrefix: 'common' })}>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
<Button
|
83 |
type="text"
|
84 |
disabled={beingUsed}
|
85 |
+
onClick={handleRemoveFile}
|
86 |
className={styles.iconButton}
|
87 |
>
|
88 |
+
<DeleteOutlined size={20} />
|
89 |
</Button>
|
90 |
+
</Tooltip>
|
91 |
+
{record.type !== 'folder' && (
|
92 |
+
<Tooltip title={t('download', { keyPrefix: 'common' })}>
|
93 |
+
<Button
|
94 |
+
type="text"
|
95 |
+
disabled={beingUsed}
|
96 |
+
onClick={onDownloadDocument}
|
97 |
+
className={styles.iconButton}
|
98 |
+
>
|
99 |
+
<DownloadOutlined size={20} />
|
100 |
+
</Button>
|
101 |
+
</Tooltip>
|
102 |
)}
|
103 |
</Space>
|
104 |
);
|