Răsfoiți Sursa

fix pageAttachment

zahmis 5 ani în urmă
părinte
comite
1079ad6eb6

+ 2 - 2
src/client/js/components/PageAttachment.jsx

@@ -18,7 +18,7 @@ class PageAttachment extends React.Component {
     this.state = {
       activePage: 1,
       totalAttachments: 0,
-      limit: 10,
+      limit: null,
       attachments: [],
       inUse: {},
       attachmentToDelete: null,
@@ -111,10 +111,10 @@ class PageAttachment extends React.Component {
 
 
   render() {
+    console.log(this.state.limit);
     const { t } = this.props;
     if (this.state.attachments.length === 0) {
       return t('No_attachments_yet');
-
     }
 
     let deleteAttachmentModal = '';

+ 4 - 2
src/client/js/components/PaginationWrapper.jsx

@@ -17,7 +17,7 @@ class PaginationWrapper extends React.Component {
       totalItemsCount: 0,
       activePage: 1,
       paginationNumbers: {},
-      limit: Infinity,
+      limit: this.props.pagingLimit || Infinity,
     };
 
     this.calculatePagination = this.calculatePagination.bind(this);
@@ -189,11 +189,13 @@ PaginationWrapper.propTypes = {
   activePage: PropTypes.number.isRequired,
   changePage: PropTypes.func.isRequired,
   totalItemsCount: PropTypes.number.isRequired,
-  pagingLimit: PropTypes.number.isRequired,
+  pagingLimit: PropTypes.number,
   align: PropTypes.string,
 };
 PaginationWrapper.defaultProps = {
   align: 'left',
+  pagingLimit: PropTypes.number,
+
 };
 
 export default withTranslation()(PaginationWrappered);