Seiya Tashiro пре 7 година
родитељ
комит
d3bdfbfa8d

+ 5 - 1
src/client/js/app.js

@@ -331,8 +331,12 @@ if (savePageControlsElem) {
 // RecentCreated dev GC-939 start
 const recentCreatedControlsElem = document.getElementById('user-created-list');
 if (recentCreatedControlsElem) {
+  let limit = crowi.getConfig().recentCreatedLimit;
+  if (null == limit) {
+    limit = 10;
+  }
   ReactDOM.render(
-    <RecentCreated  crowi={crowi} pageId={pageId}  >
+    <RecentCreated  crowi={crowi} pageId={pageId} limit={limit} >
 
     </RecentCreated>, document.getElementById('user-created-list')
   );

+ 2 - 2
src/client/js/components/RecentCreated/RecentCreated.js

@@ -10,7 +10,6 @@ export default class RecentCreated extends React.Component {
 
     this.state = {
       pages: [],
-      limit: 10, // TODO GC-941で対応予定
       activePage: 1,
       PaginationNumbers: {},
 
@@ -26,7 +25,7 @@ export default class RecentCreated extends React.Component {
 
     const pageId = this.props.pageId;
     const userId = this.props.crowi.me;
-    const limit = this.state.limit;
+    const limit = this.props.limit;
     const offset = (selectPageNumber - 1) * limit;
 
     // pagesList get and pagination calculate
@@ -191,6 +190,7 @@ export default class RecentCreated extends React.Component {
 RecentCreated.propTypes = {
   pageId: PropTypes.string.isRequired,
   crowi: PropTypes.object.isRequired,
+  limit: PropTypes.number,
 };
 
 RecentCreated.defaultProps = {

+ 1 - 0
src/server/models/config.js

@@ -622,6 +622,7 @@ module.exports = function(crowi) {
         HACKMD_URI: env.HACKMD_URI || null,
         MATHJAX: env.MATHJAX || null,
       },
+      recentCreatedLimit: Config.showRecentCreatedNumber(config),
     };
 
     return local_config;