Просмотр исходного кода

Remove unused translation and fix code

https://youtrack.weseek.co.jp/issue/GW-7923
- Remove unused translation
- Update Japanese translation
- Update DragItemDataType type definition
- Update droppable condition of bookmark item
- Fix droppable area mistyping
Mudana-Grune 3 лет назад
Родитель
Сommit
a69ce5b3e5

+ 2 - 3
packages/app/public/static/locales/ja_JP/translation.json

@@ -824,9 +824,8 @@
     "input_placeholder": "フォルダ名を入力してください`",
     "new_folder": "新しいフォルダ",
     "delete": "フォルダを削除",
-    "drop_item_here": "ここに項目をドラッグ アンド ドロップします",
-    "cancel_bookmark": "このページのブックマークを解除",
-    "bookmark_this_page": "このページをブックマークして"
+    "drop_item_here": "ブックマークを解除",
+    "cancel_bookmark": "このページのブックマークを解除"
   },
   "v5_page_migration": {
     "page_tree_not_avaliable" : "Page Tree 機能は現在使用できません。",

+ 1 - 2
packages/app/public/static/locales/zh_CN/translation.json

@@ -828,8 +828,7 @@
     "new_folder": "新建文件夹",
     "delete": "删除文件夹",
     "drop_item_here": "将项目拖放到此处",
-    "cancel_bookmark": "取消收藏此页面",
-    "bookmark_this_page": "收藏此页"
+    "cancel_bookmark": "取消收藏此页面"
   },
   "v5_page_migration": {
     "page_tree_not_avaliable": "Page Tree 功能不可用",

+ 5 - 3
packages/app/src/components/Bookmarks/BookmarkFolderItem.tsx

@@ -31,7 +31,9 @@ type BookmarkFolderItemProps = {
   isUserHomePage?: boolean
 }
 
-type DragItemDataType = BookmarkFolderItemProps & IPageHasId & { parentFolder: BookmarkFolderItems } ;
+type DragItemDataType = {
+  parentFolder: BookmarkFolderItems
+} & BookmarkFolderItemProps & IPageHasId
 
 const BookmarkFolderItem: FC<BookmarkFolderItemProps> = (props: BookmarkFolderItemProps) => {
   const acceptedTypes: DragItemType[] = [DRAG_ITEM_TYPE.FOLDER, DRAG_ITEM_TYPE.BOOKMARK];
@@ -173,8 +175,8 @@ const BookmarkFolderItem: FC<BookmarkFolderItemProps> = (props: BookmarkFolderIt
       }
       return item.root !== targetRoot || item.level >= targetLevel;
     }
-    const isSameTarget = item.parentFolder && item.parentFolder._id === bookmarkFolder._id;
-    if (isSameTarget) {
+
+    if (item.parentFolder != null && item.parentFolder._id === bookmarkFolder._id) {
       return false;
     }
     return true;

+ 5 - 5
packages/app/src/components/Bookmarks/BookmarkFolderTree.tsx

@@ -145,16 +145,16 @@ const BookmarkFolderTree = (props: BookmarkFolderTreeProps): JSX.Element => {
             </div>
           ))}
         </ul>
-        { bookmarkFolderData && bookmarkFolderData.length > 0 && (
-          <div ref={(c) => { dropRef(c) }} className= 'grw-drop-item-area '>
-            <div className="grw-accept-drop-item ">
-              <div className='d-flex flex-column align-items-center' >
+        {bookmarkFolderData != null && bookmarkFolderData.length > 0 && (
+          <div ref={(c) => { dropRef(c) }} className="grw-drop-item-area">
+            <div className="grw-accept-drop-item">
+              <div className="d-flex flex-column align-items-center">
                 {t('bookmark_folder.drop_item_here')}
               </div>
             </div>
 
           </div>
-        ) }
+        )}
       </div>
     </>
   );