Explorar o código

Merge pull request #8931 from weseek/feat/149415-149416-yjs-draft-deletion-lead

feat: Yjs draft deletion lead
Yuki Takei hai 1 ano
pai
achega
b256cd5b82

+ 4 - 0
apps/app/public/static/locales/en_US/translation.json

@@ -9,6 +9,7 @@
   "delete_all": "Delete all",
   "Duplicate": "Duplicate",
   "PathRecovery": "Path recovery",
+  "SyncLatestRevisionBody": "Sync editor with latest body",
   "Copy": "Copy",
   "preview": "Preview",
   "desktop": "Desktop",
@@ -877,5 +878,8 @@
   },
   "create_page": {
     "untitled": "Untitled"
+  },
+  "sync-latest-reevision-body": {
+    "confirm": "Delete the draft data being entered into the editor and synchronize the latest text. Are you sure you want to run it?"
   }
 }

+ 4 - 0
apps/app/public/static/locales/fr_FR/translation.json

@@ -9,6 +9,7 @@
   "delete_all": "Tout supprimer",
   "Duplicate": "Dupliquer",
   "PathRecovery": "Récupération de chemin",
+  "SyncLatestRevisionBody": "Synchroniser l'éditeur avec le dernier corps",
   "Copy": "Copier",
   "preview": "Prévisualiser",
   "desktop": "Ordinateur",
@@ -868,5 +869,8 @@
     "show_wip_page": "Voir brouillon",
     "size_s": "Taille: P",
     "size_l": "Taille: G"
+  },
+  "sync-latest-reevision-body": {
+    "confirm": "Delete the draft data being entered into the editor and synchronize the latest text. Are you sure you want to run it?"
   }
 }

+ 4 - 0
apps/app/public/static/locales/ja_JP/translation.json

@@ -9,6 +9,7 @@
   "delete_all": "全て削除",
   "Duplicate": "複製",
   "PathRecovery": "パスを修復",
+  "SyncLatestRevisionBody": "エディターを最新の本文に同期",
   "Copy": "コピー",
   "preview": "プレビュー",
   "desktop": "パソコン",
@@ -910,5 +911,8 @@
   },
   "create_page": {
     "untitled": "無題のページ"
+  },
+  "sync-latest-reevision-body": {
+    "confirm": "エディターに入力中のドラフトデータを削除して最新の本文を同期します。実行しますか?"
   }
 }

+ 4 - 0
apps/app/public/static/locales/zh_CN/translation.json

@@ -9,6 +9,7 @@
   "delete_all": "删除所有",
   "Duplicate": "复制",
   "PathRecovery": "路径恢复",
+  "SyncLatestRevisionBody": "将编辑器与最新机身同步",
   "Copy": "复制",
   "preview": "预览",
   "desktop": "电脑",
@@ -880,5 +881,8 @@
   },
   "create_page": {
     "untitled": "Untitled"
+  },
+  "sync-latest-reevision-body": {
+    "confirm": "删除输入编辑器的草稿数据,同步最新文本。 您真的想运行它吗?"
   }
 }

+ 0 - 1
apps/app/src/client/components/Common/Dropdown/PageItemControl.tsx

@@ -108,7 +108,6 @@ const PageItemControlDropdownMenu = React.memo((props: DropdownMenuProps): JSX.E
     await onClickRevertMenuItem(pageId);
   }, [onClickRevertMenuItem, pageId]);
 
-
   // eslint-disable-next-line react-hooks/rules-of-hooks
   const deleteItemClickedHandler = useCallback(async() => {
     if (pageInfo == null || onClickDeleteMenuItem == null) {

+ 16 - 0
apps/app/src/client/components/Navbar/GrowiContextualSubNavigation.tsx

@@ -76,8 +76,24 @@ const PageOperationMenuItems = (props: PageOperationMenuItemsProps): JSX.Element
   const { open: openPresentationModal } = usePagePresentationModal();
   const { open: openAccessoriesModal } = usePageAccessoriesModal();
 
+  const syncLatestRevisionBodyHandler = useCallback(async() => {
+    // eslint-disable-next-line no-alert
+    const answer = window.confirm(t('sync-latest-reevision-body.confirm'));
+    if (answer) {
+      // TODO: https://redmine.weseek.co.jp/issues/149418
+    }
+  }, [t]);
+
   return (
     <>
+      <DropdownItem
+        onClick={() => syncLatestRevisionBodyHandler()}
+        className="grw-page-control-dropdown-item"
+      >
+        <span className="material-symbols-outlined me-1 grw-page-control-dropdown-icon">sync</span>
+        {t('SyncLatestRevisionBody')}
+      </DropdownItem>
+
       {/* Presentation */}
       <DropdownItem
         onClick={() => openPresentationModal()}