|
|
@@ -1,45 +1,42 @@
|
|
|
import React, { useState, useCallback } from 'react';
|
|
|
-import { useTranslation } from 'react-i18next';
|
|
|
-import PropTypes from 'prop-types';
|
|
|
-
|
|
|
|
|
|
+import PropTypes from 'prop-types';
|
|
|
+import { useTranslation } from 'react-i18next';
|
|
|
import { DropdownItem } from 'reactstrap';
|
|
|
|
|
|
-import { OnDuplicatedFunction, OnRenamedFunction, OnDeletedFunction } from '~/interfaces/ui';
|
|
|
-import { IPageHasId, IPageToRenameWithMeta, IPageWithMeta } from '~/interfaces/page';
|
|
|
-
|
|
|
-import { withUnstatedContainers } from '../UnstatedUtils';
|
|
|
import EditorContainer from '~/client/services/EditorContainer';
|
|
|
+import { exportAsMarkdown } from '~/client/services/page-operation';
|
|
|
+import { toastSuccess, toastError } from '~/client/util/apiNotification';
|
|
|
+import { apiPost } from '~/client/util/apiv1-client';
|
|
|
+import { IPageHasId, IPageToRenameWithMeta, IPageWithMeta } from '~/interfaces/page';
|
|
|
+import { OnDuplicatedFunction, OnRenamedFunction, OnDeletedFunction } from '~/interfaces/ui';
|
|
|
import {
|
|
|
- EditorMode, useDrawerMode, useEditorMode, useIsDeviceSmallerThanMd, useIsAbleToShowPageManagement, useIsAbleToShowTagLabel,
|
|
|
- useIsAbleToShowPageEditorModeManager, useIsAbleToShowPageAuthors,
|
|
|
-} from '~/stores/ui';
|
|
|
+ useCurrentCreatedAt, useCurrentUpdatedAt, useCurrentPageId, useRevisionId, useCurrentPagePath,
|
|
|
+ useCreator, useRevisionAuthor, useCurrentUser, useIsGuestUser, useIsSharedUser, useShareLinkId,
|
|
|
+} from '~/stores/context';
|
|
|
import {
|
|
|
usePageAccessoriesModal, PageAccessoriesModalContents, IPageForPageDuplicateModal,
|
|
|
usePageDuplicateModal, usePageRenameModal, usePageDeleteModal, usePagePresentationModal,
|
|
|
} from '~/stores/modal';
|
|
|
-
|
|
|
-
|
|
|
-import {
|
|
|
- useCurrentCreatedAt, useCurrentUpdatedAt, useCurrentPageId, useRevisionId, useCurrentPagePath,
|
|
|
- useCreator, useRevisionAuthor, useCurrentUser, useIsGuestUser, useIsSharedUser, useShareLinkId,
|
|
|
-} from '~/stores/context';
|
|
|
import { useSWRTagsInfo } from '~/stores/page';
|
|
|
+import {
|
|
|
+ EditorMode, useDrawerMode, useEditorMode, useIsDeviceSmallerThanMd, useIsAbleToShowPageManagement, useIsAbleToShowTagLabel,
|
|
|
+ useIsAbleToShowPageEditorModeManager, useIsAbleToShowPageAuthors,
|
|
|
+} from '~/stores/ui';
|
|
|
|
|
|
-
|
|
|
-import { toastSuccess, toastError } from '~/client/util/apiNotification';
|
|
|
-import { apiPost } from '~/client/util/apiv1-client';
|
|
|
-
|
|
|
-import HistoryIcon from '../Icons/HistoryIcon';
|
|
|
+import { AdditionalMenuItemsRendererProps } from '../Common/Dropdown/PageItemControl';
|
|
|
import AttachmentIcon from '../Icons/AttachmentIcon';
|
|
|
+import HistoryIcon from '../Icons/HistoryIcon';
|
|
|
+import { withUnstatedContainers } from '../UnstatedUtils';
|
|
|
+
|
|
|
import ShareLinkIcon from '../Icons/ShareLinkIcon';
|
|
|
-import { AdditionalMenuItemsRendererProps } from '../Common/Dropdown/PageItemControl';
|
|
|
-import { SubNavButtons } from './SubNavButtons';
|
|
|
-import PageEditorModeManager from './PageEditorModeManager';
|
|
|
+
|
|
|
import { GrowiSubNavigation } from './GrowiSubNavigation';
|
|
|
+import PageEditorModeManager from './PageEditorModeManager';
|
|
|
+import { SubNavButtons } from './SubNavButtons';
|
|
|
+
|
|
|
import PresentationIcon from '../Icons/PresentationIcon';
|
|
|
import CreateTemplateModal from '../CreateTemplateModal';
|
|
|
-import { exportAsMarkdown } from '~/client/services/page-operation';
|
|
|
|
|
|
|
|
|
type AdditionalMenuItemsProps = AdditionalMenuItemsRendererProps & {
|
|
|
@@ -101,6 +98,7 @@ const AdditionalMenuItems = (props: AdditionalMenuItemsProps): JSX.Element => {
|
|
|
<DropdownItem
|
|
|
onClick={() => openAccessoriesModal(PageAccessoriesModalContents.PageHistory)}
|
|
|
disabled={isGuestUser || isSharedUser}
|
|
|
+ data-testid="open-page-accessories-modal-btn-with-history-tab"
|
|
|
className="grw-page-control-dropdown-item"
|
|
|
>
|
|
|
<span className="grw-page-control-dropdown-icon">
|
|
|
@@ -111,6 +109,7 @@ const AdditionalMenuItems = (props: AdditionalMenuItemsProps): JSX.Element => {
|
|
|
|
|
|
<DropdownItem
|
|
|
onClick={() => openAccessoriesModal(PageAccessoriesModalContents.Attachment)}
|
|
|
+ data-testid="open-page-accessories-modal-btn-with-attachment-data-tab"
|
|
|
className="grw-page-control-dropdown-item"
|
|
|
>
|
|
|
<span className="grw-page-control-dropdown-icon">
|