Преглед изворни кода

Merge pull request #5971 from weseek/feat/show-tooltip-for-rename-operation

Feat/show tooltip for rename operation
Yohei Shiina пре 3 година
родитељ
комит
87cf4bc201

+ 6 - 1
packages/app/resource/locales/en_US/translation.json

@@ -1110,7 +1110,12 @@
     "cancel_bookmark": "Cancel Bookmark",
     "receive_notifications": "Receive Notifications",
     "stop_notification": "Stop Notification",
-    "footprints": "Footprints"
+    "footprints": "Footprints",
+    "operation": {
+      "attention": {
+        "rename": "Renaming paths of descendant pages was not successful, please open the menu from the 3-point reader and select 'Path recovery'"
+      }
+    }
   },
   "page_operation":{
     "paths_recovered": "Paths recovered successfully",

+ 6 - 1
packages/app/resource/locales/ja_JP/translation.json

@@ -1103,7 +1103,12 @@
     "cancel_bookmark": "ブックマークを取り消す",
     "receive_notifications": "通知を受け取る",
     "stop_notification": "通知を止める",
-    "footprints": "足跡"
+    "footprints": "足跡",
+    "operation": {
+      "attention": {
+        "rename": "配下のページパスの更新が正常に行われませんでした。3点リーダーからメニューを開き、「パスを修復」を選択してしてください。"
+      }
+    }
   },
   "page_operation":{
     "paths_recovered": "パスを修復しました",

+ 7 - 2
packages/app/resource/locales/zh_CN/translation.json

@@ -5,7 +5,7 @@
 	"Delete": "删除",
 	"delete_all": "删除所有",
 	"Duplicate": "复制",
-  "PathRecovery": "路径复",
+  "PathRecovery": "路径复",
 	"Copy": "复制",
   "preview":"预览",
   "desktop":"电脑",
@@ -1113,7 +1113,12 @@
     "cancel_bookmark": "取消书签",
     "receive_notifications": "接收通知",
     "stop_notification": "停止通知",
-    "footprints": "脚印"
+    "footprints": "脚印",
+    "operation": {
+      "attention": {
+        "rename": "重命名子孙页的路径没有成功,请从三点式阅读器上打开菜单,选择 '路径恢复'。"
+      }
+    }
   },
   "page_operation":{
     "paths_recovered": "成功恢复了页面路径",

+ 8 - 3
packages/app/src/components/Sidebar/PageTree/Item.tsx

@@ -7,8 +7,7 @@ import nodePath from 'path';
 import { pathUtils, pagePathUtils } from '@growi/core';
 import { useDrag, useDrop } from 'react-dnd';
 import { useTranslation } from 'react-i18next';
-import { DropdownToggle } from 'reactstrap';
-
+import { UncontrolledTooltip, DropdownToggle } from 'reactstrap';
 
 import { bookmark, unbookmark, resumeRenameOperation } from '~/client/services/page-operation';
 import { toastWarning, toastError, toastSuccess } from '~/client/util/apiNotification';
@@ -451,8 +450,14 @@ const Item: FC<ItemProps> = (props: ItemProps) => {
           : (
             <>
               { shouldShowAttentionIcon && (
-                <i className="fa fa-warning mr-2 text-warning"></i>
+                <>
+                  <i id="path-recovery" className="fa fa-warning mr-2 text-warning"></i>
+                  <UncontrolledTooltip placement="top" target="path-recovery" fade={false}>
+                    {t('tooltip.operation.attention.rename')}
+                  </UncontrolledTooltip>
+                </>
               )}
+
               <a href={`/${page._id}`} className="grw-pagetree-title-anchor flex-grow-1">
                 <p className={`text-truncate m-auto ${page.isEmpty && 'grw-sidebar-text-muted'}`}>{nodePath.basename(page.path ?? '') || '/'}</p>
               </a>