itizawa 5 lat temu
rodzic
commit
c84a9268d0

+ 1 - 1
src/client/js/components/Page/DisplaySwitcher.jsx

@@ -30,7 +30,7 @@ const DisplaySwitcher = (props) => {
             <div className="grw-side-contents-container">
             <div className="grw-side-contents-container">
               <div className="grw-side-contents-sticky-container">
               <div className="grw-side-contents-sticky-container">
                 <div className="border-bottom pb-1">
                 <div className="border-bottom pb-1">
-                  <PageAccessories isPageExist={isPageExist} />
+                  <PageAccessories isNotFoundPage={!isPageExist} />
                 </div>
                 </div>
 
 
                 <div className="d-none d-lg-block">
                 <div className="d-none d-lg-block">

+ 4 - 4
src/client/js/components/PageAccessories.jsx

@@ -9,7 +9,7 @@ import AppContainer from '../services/AppContainer';
 import PageAccessoriesContainer from '../services/PageAccessoriesContainer';
 import PageAccessoriesContainer from '../services/PageAccessoriesContainer';
 
 
 const PageAccessories = (props) => {
 const PageAccessories = (props) => {
-  const { appContainer, pageAccessoriesContainer, isPageExist } = props;
+  const { appContainer, pageAccessoriesContainer, isNotFoundPage } = props;
   const { isGuestUser, isSharedUser } = appContainer;
   const { isGuestUser, isSharedUser } = appContainer;
 
 
   return (
   return (
@@ -17,12 +17,12 @@ const PageAccessories = (props) => {
       <PageAccessoriesModalControl
       <PageAccessoriesModalControl
         isGuestUser={isGuestUser}
         isGuestUser={isGuestUser}
         isSharedUser={isSharedUser}
         isSharedUser={isSharedUser}
-        isPageExist={isPageExist}
+        isNotFoundPage={isNotFoundPage}
       />
       />
       <PageAccessoriesModal
       <PageAccessoriesModal
         isGuestUser={isGuestUser}
         isGuestUser={isGuestUser}
         isSharedUser={isSharedUser}
         isSharedUser={isSharedUser}
-        isPageExist={isPageExist}
+        isNotFoundPage={isNotFoundPage}
         isOpen={pageAccessoriesContainer.state.isPageAccessoriesModalShown}
         isOpen={pageAccessoriesContainer.state.isPageAccessoriesModalShown}
         onClose={pageAccessoriesContainer.closePageAccessoriesModal}
         onClose={pageAccessoriesContainer.closePageAccessoriesModal}
       />
       />
@@ -38,7 +38,7 @@ PageAccessories.propTypes = {
   appContainer: PropTypes.instanceOf(AppContainer).isRequired,
   appContainer: PropTypes.instanceOf(AppContainer).isRequired,
   pageAccessoriesContainer: PropTypes.instanceOf(PageAccessoriesContainer).isRequired,
   pageAccessoriesContainer: PropTypes.instanceOf(PageAccessoriesContainer).isRequired,
 
 
-  isPageExist: PropTypes.bool.isRequired,
+  isNotFoundPage: PropTypes.bool.isRequired,
 };
 };
 
 
 export default PageAccessoriesWrapper;
 export default PageAccessoriesWrapper;

+ 6 - 6
src/client/js/components/PageAccessoriesModal.jsx

@@ -24,7 +24,7 @@ import ExpandOrContractButton from './ExpandOrContractButton';
 
 
 const PageAccessoriesModal = (props) => {
 const PageAccessoriesModal = (props) => {
   const {
   const {
-    t, pageAccessoriesContainer, onClose, isGuestUser, isSharedUser, isPageExist,
+    t, pageAccessoriesContainer, onClose, isGuestUser, isSharedUser, isNotFoundPage,
   } = props;
   } = props;
   const { switchActiveTab } = pageAccessoriesContainer;
   const { switchActiveTab } = pageAccessoriesContainer;
   const { activeTab, activeComponents } = pageAccessoriesContainer.state;
   const { activeTab, activeComponents } = pageAccessoriesContainer.state;
@@ -48,22 +48,22 @@ const PageAccessoriesModal = (props) => {
         Icon: HistoryIcon,
         Icon: HistoryIcon,
         i18n: t('History'),
         i18n: t('History'),
         index: 2,
         index: 2,
-        isLinkEnabled: v => !isGuestUser && !isSharedUser && isPageExist,
+        isLinkEnabled: v => !isGuestUser && !isSharedUser && !isNotFoundPage,
       },
       },
       attachment: {
       attachment: {
         Icon: AttachmentIcon,
         Icon: AttachmentIcon,
         i18n: t('attachment_data'),
         i18n: t('attachment_data'),
         index: 3,
         index: 3,
-        isLinkEnabled: v => isPageExist,
+        isLinkEnabled: v => !isNotFoundPage,
       },
       },
       shareLink: {
       shareLink: {
         Icon: ShareLinkIcon,
         Icon: ShareLinkIcon,
         i18n: t('share_links.share_link_management'),
         i18n: t('share_links.share_link_management'),
         index: 4,
         index: 4,
-        isLinkEnabled: v => !isGuestUser && !isSharedUser && isPageExist,
+        isLinkEnabled: v => !isGuestUser && !isSharedUser && !isNotFoundPage,
       },
       },
     };
     };
-  }, [t, isGuestUser, isSharedUser]);
+  }, [t, isGuestUser, isSharedUser, isNotFoundPage]);
 
 
   const closeModalHandler = useCallback(() => {
   const closeModalHandler = useCallback(() => {
     if (onClose == null) {
     if (onClose == null) {
@@ -150,7 +150,7 @@ PageAccessoriesModal.propTypes = {
   pageAccessoriesContainer: PropTypes.instanceOf(PageAccessoriesContainer).isRequired,
   pageAccessoriesContainer: PropTypes.instanceOf(PageAccessoriesContainer).isRequired,
   isGuestUser: PropTypes.bool.isRequired,
   isGuestUser: PropTypes.bool.isRequired,
   isSharedUser: PropTypes.bool.isRequired,
   isSharedUser: PropTypes.bool.isRequired,
-  isPageExist: PropTypes.bool.isRequired,
+  isNotFoundPage: PropTypes.bool.isRequired,
   isOpen: PropTypes.bool.isRequired,
   isOpen: PropTypes.bool.isRequired,
   onClose: PropTypes.func,
   onClose: PropTypes.func,
 };
 };

+ 7 - 7
src/client/js/components/PageAccessoriesModalControl.jsx

@@ -17,7 +17,7 @@ import { withUnstatedContainers } from './UnstatedUtils';
 
 
 const PageAccessoriesModalControl = (props) => {
 const PageAccessoriesModalControl = (props) => {
   const {
   const {
-    t, pageAccessoriesContainer, isGuestUser, isSharedUser, isPageExist,
+    t, pageAccessoriesContainer, isGuestUser, isSharedUser, isNotFoundPage,
   } = props;
   } = props;
 
 
   const accessoriesBtnList = useMemo(() => {
   const accessoriesBtnList = useMemo(() => {
@@ -37,23 +37,23 @@ const PageAccessoriesModalControl = (props) => {
       {
       {
         name: 'pageHistory',
         name: 'pageHistory',
         Icon: <HistoryIcon />,
         Icon: <HistoryIcon />,
-        disabled: isGuestUser || isSharedUser || !isPageExist,
+        disabled: isGuestUser || isSharedUser || isNotFoundPage,
         i18n: t('History'),
         i18n: t('History'),
       },
       },
       {
       {
         name: 'attachment',
         name: 'attachment',
         Icon: <AttachmentIcon />,
         Icon: <AttachmentIcon />,
-        disabled: !isPageExist,
+        disabled: isNotFoundPage,
         i18n: t('attachment_data'),
         i18n: t('attachment_data'),
       },
       },
       {
       {
         name: 'shareLink',
         name: 'shareLink',
         Icon: <ShareLinkIcon />,
         Icon: <ShareLinkIcon />,
-        disabled: isGuestUser || isSharedUser || !isPageExist,
+        disabled: isGuestUser || isSharedUser || isNotFoundPage,
         i18n: t('share_links.share_link_management'),
         i18n: t('share_links.share_link_management'),
       },
       },
     ];
     ];
-  }, [t, isGuestUser, isSharedUser, isPageExist]);
+  }, [t, isGuestUser, isSharedUser, isNotFoundPage]);
 
 
   return (
   return (
     <div className="grw-page-accessories-control d-flex flex-nowrap align-items-center justify-content-end justify-content-lg-between">
     <div className="grw-page-accessories-control d-flex flex-nowrap align-items-center justify-content-end justify-content-lg-between">
@@ -61,7 +61,7 @@ const PageAccessoriesModalControl = (props) => {
 
 
         let tooltipMessage;
         let tooltipMessage;
         if (accessory.disabled) {
         if (accessory.disabled) {
-          tooltipMessage = isPageExist ? t('Not available for guest') : t('not_found_page.page_not_exist');
+          tooltipMessage = isNotFoundPage ? t('not_found_page.page_not_exist') : t('Not available for guest');
         }
         }
         else {
         else {
           tooltipMessage = accessory.i18n;
           tooltipMessage = accessory.i18n;
@@ -103,7 +103,7 @@ PageAccessoriesModalControl.propTypes = {
 
 
   isGuestUser: PropTypes.bool.isRequired,
   isGuestUser: PropTypes.bool.isRequired,
   isSharedUser: PropTypes.bool.isRequired,
   isSharedUser: PropTypes.bool.isRequired,
-  isPageExist: PropTypes.bool.isRequired,
+  isNotFoundPage: PropTypes.bool.isRequired,
 };
 };
 
 
 export default withTranslation()(PageAccessoriesModalControlWrapper);
 export default withTranslation()(PageAccessoriesModalControlWrapper);