Parcourir la source

fix translation.json archive pagesharemanagement

zahmis il y a 5 ans
Parent
commit
d1094174be

+ 1 - 0
resource/locales/en-US/translation.json

@@ -50,6 +50,7 @@
   "Shere this page link to public": "Shere this page link to public",
   "Create Archive Page": "Create Archive Page",
   "File type": "File type",
+  "Target page": "Target page",
   "Include Attachment File": "Include Attachment File",
   "Include Comment": "Include Comment",
   "Include Subordinated Page": "Include Subordinated Page",

+ 1 - 0
resource/locales/ja/translation.json

@@ -49,6 +49,7 @@
   "Not available for guest": "ゲストユーザーは利用できません",
   "Shere this page link to public": "外部に共有するリンクを発行する",
   "Create Archive Page": "アーカイブページの作成",
+  "Target page": "対象ページ",
   "File type": "ファイル形式",
   "Include Attachment File": "添付ファイルも含める",
   "Include Comment": "コメントも含める",

+ 22 - 4
src/client/js/components/ArchiveCreateModal.jsx

@@ -4,15 +4,20 @@ import { withTranslation } from 'react-i18next';
 import {
   Modal, ModalHeader, ModalBody, ModalFooter,
 } from 'reactstrap';
+import { pathUtils } from 'growi-commons';
+import { withUnstatedContainers } from './UnstatedUtils';
+import AppContainer from '../services/AppContainer';
+import PageContainer from '../services/PageContainer';
 
 
 const ArchiveCreateModal = (props) => {
-
-  const { t } = props;
-
+  const { t, pageContainer } = props;
+  const { path } = pageContainer.state;
+  const parentPath = pathUtils.addTrailingSlash(path);
   const [isCommentDownload, setIsCommentDownload] = useState(false);
   const [isFileDownload, setIsFileDownload] = useState(false);
   const [isSubordinatedPageDownload, setIsSubordinatedPageDownload] = useState(false);
+
   const [fileType, setFileType] = useState('markDown');
 
 
@@ -50,6 +55,12 @@ const ArchiveCreateModal = (props) => {
       </ModalHeader>
       <ModalBody>
         <div className="form-group">
+          <div className="form-group">
+            <label>{t('Target page')}</label>
+            <br />
+            <code>{parentPath}</code>
+          </div>
+
           <div className="custom-control custom-radio custom-control-inline ">
             <label>{t('File type')}: </label>
           </div>
@@ -135,10 +146,17 @@ const ArchiveCreateModal = (props) => {
   );
 };
 
+const ArchiveCreateModalWrapper = withUnstatedContainers(ArchiveCreateModal, [AppContainer, PageContainer]);
+
+
 ArchiveCreateModal.propTypes = {
   t: PropTypes.func.isRequired, //  i18next
+  AppContainer: PropTypes.instanceOf(AppContainer).isRequired,
+  pageContainer: PropTypes.instanceOf(PageContainer).isRequired,
   isOpen: PropTypes.bool.isRequired,
   onClose: PropTypes.func,
+  path: PropTypes.string.isRequired,
 };
 
-export default withTranslation()(ArchiveCreateModal);
+
+export default withTranslation()(ArchiveCreateModalWrapper);

+ 19 - 5
src/client/js/components/Page/PageShareManagement.jsx

@@ -16,6 +16,7 @@ import ArchiveCreateModal from '../ArchiveCreateModal';
 const PageShareManagement = (props) => {
   const { t, appContainer, pageContainer } = props;
 
+  const { path } = pageContainer.state;
   const { currentUser } = appContainer;
 
   const [isOutsideShareLinkModalShown, setIsOutsideShareLinkModalShown] = useState(false);
@@ -70,6 +71,7 @@ const PageShareManagement = (props) => {
         <ArchiveCreateModal
           isOpen={isArchiveCreateModalShown}
           onClose={closeArchiveCreateModalHandler}
+          path={path}
         />
       </>
     );
@@ -112,20 +114,32 @@ const PageShareManagement = (props) => {
       {currentUser == null ? renderGuestUser() : renderCurrentUser()}
       <div className="dropdown-menu dropdown-menu-right">
         <button className="dropdown-item" type="button" onClick={openOutsideShareLinkModalHandler}>
-          <i className="icon-fw icon-link"></i>{t('Shere this page link to public')}
+          <i className="icon-fw icon-link"></i>
+          {t('Shere this page link to public')}
           <span className="ml-2 badge badge-info badge-pill">{pageContainer.state.shareLinksNumber}</span>
         </button>
-        <button type="button" className="dropdown-item" onClick={() => { exportPageHundler('markdown') }}>
+        <button
+          type="button"
+          className="dropdown-item"
+          onClick={() => {
+            exportPageHundler('markdown');
+          }}
+        >
           <span>{t('export_bulk.export_page_markdown')}</span>
         </button>
-        <button type="button" className="dropdown-item" onClick={() => { exportPageHundler('pdf') }}>
+        <button
+          type="button"
+          className="dropdown-item"
+          onClick={() => {
+            exportPageHundler('pdf');
+          }}
+        >
           <span>{t('export_bulk.export_page_pdf')}</span>
         </button>
 
         <button className="dropdown-item" type="button" onClick={openArchiveModalHandler}>
-          <i className="icon-fw">{t('Create Archive Page')}</i>
+          <i className="icon-fw"></i>{t('Create Archive Page')}
         </button>
-
       </div>
       {renderModals()}
     </>