Shun Miyazawa il y a 4 ans
Parent
commit
479ed4d884

+ 1 - 31
packages/app/src/components/Sidebar/PageTree/Item.tsx

@@ -16,7 +16,7 @@ import { toastWarning, toastError, toastSuccess } from '~/client/util/apiNotific
 
 import { useSWRxPageChildren } from '~/stores/page-listing';
 import { apiv3Put, apiv3Post } from '~/client/util/apiv3-client';
-import { IPageForPageRenameModal, IPageForPageDuplicateModal } from '~/stores/modal';
+import { IPageForPageDuplicateModal } from '~/stores/modal';
 
 import TriangleIcon from '~/components/Icons/TriangleIcon';
 import { bookmark, unbookmark } from '~/client/services/page-operation';
@@ -256,11 +256,6 @@ const Item: FC<ItemProps> = (props: ItemProps) => {
     onClickDuplicateMenuItem(pageToDuplicate);
   }, [onClickDuplicateMenuItem, page]);
 
-
-  /*
-  * Rename: TODO: rename page title on input form by #87757
-  */
-
   const renameMenuItemClickHandler = useCallback(async(_pageId: string): Promise<void> => {
     setRenameInputShown(true);
   }, []);
@@ -289,30 +284,6 @@ const Item: FC<ItemProps> = (props: ItemProps) => {
     }
   };
 
-  // const renameMenuItemClickHandler = useCallback((): void => {
-  //   if (onClickRenameMenuItem == null) {
-  //     return;
-  //   }
-
-  //   const { _id: pageId, revision: revisionId, path } = page;
-
-  //   if (!page.isEmpty && revisionId == null) {
-  //     throw Error('Existing page should have revisionId');
-  //   }
-
-  //   if (pageId == null || path == null) {
-  //     throw Error('Any of _id and revisionId and path must not be null.');
-  //   }
-
-  //   const pageToRename: IPageForPageRenameModal = {
-  //     pageId,
-  //     revisionId: revisionId as string,
-  //     path,
-  //   };
-
-  //   onClickRenameMenuItem(pageToRename);
-  // }, [onClickRenameMenuItem, page]);
-
   const deleteMenuItemClickHandler = useCallback(async(_pageId: string, pageInfo: IPageInfoAll | undefined): Promise<void> => {
     if (page._id == null || page.revision == null || page.path == null) {
       throw Error('Any of _id, revision, and path must not be null.');
@@ -440,7 +411,6 @@ const Item: FC<ItemProps> = (props: ItemProps) => {
             </button>
           )}
         </div>
-        {/* TODO: rename page title on input form by 87757 */}
         { isRenameInputShown && (
           <ClosableTextInput
             isShown

+ 2 - 3
packages/app/src/components/Sidebar/PageTree/ItemsTree.tsx

@@ -4,11 +4,11 @@ import { useTranslation } from 'react-i18next';
 import { usePageTreeTermManager, useSWRxPageAncestorsChildren, useSWRxRootPage } from '~/stores/page-listing';
 import { TargetAndAncestors } from '~/interfaces/page-listing-results';
 import { IPageHasId, IPageToDeleteWithMeta } from '~/interfaces/page';
-import { OnDuplicatedFunction, OnRenamedFunction, OnDeletedFunction } from '~/interfaces/ui';
+import { OnDuplicatedFunction, OnDeletedFunction } from '~/interfaces/ui';
 import { SocketEventName, UpdateDescCountData, UpdateDescCountRawData } from '~/interfaces/websocket';
 import { toastError, toastSuccess } from '~/client/util/apiNotification';
 import {
-  IPageForPageDuplicateModal, usePageDuplicateModal, IPageForPageRenameModal, usePageRenameModal, usePageDeleteModal,
+  IPageForPageDuplicateModal, usePageDuplicateModal, usePageDeleteModal,
 } from '~/stores/modal';
 import { smoothScrollIntoView } from '~/client/util/smooth-scroll';
 
@@ -125,7 +125,6 @@ const ItemsTree: FC<ItemsTreeProps> = (props: ItemsTreeProps) => {
   const { data: rootPageData, error: error2 } = useSWRxRootPage();
   const { data: isEnabledAttachTitleHeader } = useIsEnabledAttachTitleHeader();
   const { open: openDuplicateModal } = usePageDuplicateModal();
-  const { open: openRenameModal } = usePageRenameModal();
   const { open: openDeleteModal } = usePageDeleteModal();
   const [isScrolled, setIsScrolled] = useState(false);