Explorar el Código

fix ArchiveCreateModal PageShareManagement

zahmis hace 5 años
padre
commit
fe7e6989a9

+ 15 - 17
src/client/js/components/ArchiveCreateModal.jsx

@@ -16,15 +16,17 @@ const ArchiveCreateModal = (props) => {
 
 
   function changeIsCommentDownloadHandler() {
-    setIsCommentDownload(true);
+    setIsCommentDownload(!isCommentDownload);
   }
   function changeIsFileDownloadHandler() {
-    setIsFileDownload(true);
+    setIsFileDownload(!isFileDownload);
   }
 
   function changeIsSubordinatedPageDownloadHandler() {
-    setIsSubordinatedPageDownload(true);
+    setIsSubordinatedPageDownload(!isSubordinatedPageDownload);
   }
+
+
   return (
     <Modal size="lg" isOpen={props.isOpen} toggle={props.onClose}>
       <ModalHeader tag="h4" toggle={props.onClose} className="bg-primary text-white">
@@ -45,43 +47,39 @@ const ArchiveCreateModal = (props) => {
           </div>
         </div>
 
-        <div className="custom-control custom-checkbox-success">
+        <div className="custom-control custom-checkbox custom-checkbox-warning">
           <input
             className="custom-control-input"
-            name="file_download"
-            id="downloadFile"
+            name="comment"
+            id="commentFile"
             type="checkbox"
             checked={isCommentDownload}
             onChange={changeIsCommentDownloadHandler}
           />
-          <label className="custom-control-label" htmlFor="isGitHubEnabled">
+          <label className="custom-control-label" htmlFor="commentFile">
             {t('Include Comment')}
           </label>
         </div>
-        <div className="custom-control custom-checkbox-success">
+        <div className="custom-control custom-checkbox custom-checkbox-warning">
           <input
             className="custom-control-input"
-            name="file_download"
             id="downloadFile"
             type="checkbox"
             checked={isFileDownload}
             onChange={changeIsFileDownloadHandler}
           />
-          <label className="custom-control-label" htmlFor="isGitHubEnabled">
-            {t('Include Attachment File')}
-          </label>
+          <label className="custom-control-label" htmlFor="downloadFile">{t('Include Attachment File')}</label>
         </div>
-        <div className="custom-control custom-checkbox-success">
+        <div className="custom-control custom-checkbox custom-checkbox-warning">
           <input
             className="custom-control-input"
-            name="file_download"
-            id="downloadFile"
+            id="subordinatedFile"
             type="checkbox"
             checked={isSubordinatedPageDownload}
             onChange={changeIsSubordinatedPageDownloadHandler}
           />
-          <label className="custom-control-label" htmlFor="isGitHubEnabled">
-            {('Include Subordinated Page')}
+          <label className="custom-control-label" htmlFor="subordinatedFile">
+            {'Include Subordinated Page'}
           </label>
         </div>
       </ModalBody>

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

@@ -30,6 +30,11 @@ const PageShareManagement = (props) => {
   }
 
   function closeArchiveCreateModalHandler() {
+
+    if (setIsArchiveCreateModalShown(null)) {
+      return null;
+    }
+
     setIsArchiveCreateModalShown(false);
   }