Просмотр исходного кода

rename pageListLimitForUserPage to pageLimitationM

kaoritokashiki 5 лет назад
Родитель
Сommit
3859678bdc

+ 1 - 2
src/client/js/components/Admin/Customize/CustomizeFunctionSetting.jsx

@@ -144,8 +144,7 @@ class CustomizeFunctionSetting extends React.Component {
                 </div>
                 <Dropdown isOpen={this.state.isDropdownOpenM} toggle={this.onToggleDropdownM}>
                   <DropdownToggle className="text-right col-6" caret>
-                    {/* [TODO: rename pageListLimitForUserPage to pageLimitationM by gw3920] */}
-                    <span className="float-left">{adminCustomizeContainer.state.pageListLimitForUserPage}</span>
+                    <span className="float-left">{adminCustomizeContainer.state.pageLimitationM}</span>
                   </DropdownToggle>
                   <DropdownMenu className="dropdown-menu" role="menu">
                     <DropdownItem key={10} role="presentation" onClick={() => { adminCustomizeContainer.switchPageListLimitationM(10) }}>

+ 1 - 1
src/client/js/components/MyBookmarkList/MyBookmarkList.jsx

@@ -43,7 +43,7 @@ class MyBookmarkList extends React.Component {
     const userId = appContainer.currentUserId;
     /* TODO #2 change variable name in database keys */
     /* TODO #3 write migration */
-    const limit = appContainer.getConfig().pageListLimitForUserPage;
+    const limit = appContainer.getConfig().pageLimitationM;
     const page = selectPageNumber;
     const params = { page, limit };
 

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

@@ -68,8 +68,8 @@ class MyDraftList extends React.Component {
 
   getCurrentDrafts(selectPageNumber) {
     const { appContainer } = this.props;
-
-    const limit = appContainer.getConfig().pageListLimitForUserPage;
+    // [TODO: rename pageLimitationM to pageLimitationL]
+    const limit = appContainer.getConfig().pageLimitationM;
 
     const totalDrafts = this.state.drafts.length;
     const activePage = selectPageNumber;

+ 1 - 1
src/client/js/components/RecentCreated/RecentCreated.jsx

@@ -36,7 +36,7 @@ class RecentCreated extends React.Component {
     const { appContainer, userId } = this.props;
 
     // const userId = appContainer.currentUserId;
-    const limit = appContainer.getConfig().pageListLimitForUserPage;
+    const limit = appContainer.getConfig().pageLimitationM;
     const offset = (selectPageNumber - 1) * limit;
 
     // pagesList get and pagination calculate

+ 5 - 7
src/client/js/services/AdminCustomizeContainer.js

@@ -29,8 +29,7 @@ export default class AdminCustomizeContainer extends Container {
       isEnabledAttachTitleHeader: false,
 
       pageLimitationS: 10,
-      // [TODO: rename pageListLimitForUserPage to pageLimitationM by gw3920]
-      pageListLimitForUserPage: 10,
+      pageLimitationM: 10,
       pageLimitationL: 10,
       pageLimitationXL: 10,
 
@@ -80,7 +79,7 @@ export default class AdminCustomizeContainer extends Container {
         isEnabledTimeline: customizeParams.isEnabledTimeline,
         isSavedStatesOfTabChanges: customizeParams.isSavedStatesOfTabChanges,
         isEnabledAttachTitleHeader: customizeParams.isEnabledAttachTitleHeader,
-        pageListLimitForUserPage: customizeParams.pageListLimitForUserPage,
+        pageLimitationM: customizeParams.pageLimitationM,
         // TODO implement for pageListLimitForModal
         isEnabledStaleNotification: customizeParams.isEnabledStaleNotification,
         isAllReplyShown: customizeParams.isAllReplyShown,
@@ -146,9 +145,8 @@ export default class AdminCustomizeContainer extends Container {
   /**
    * M: Switch pageListLimitationM
    */
-  // [TODO: rename pageListLimitForUserPage to pageLimitationM by gw3920]
   switchPageListLimitationM(value) {
-    this.setState({ pageListLimitForUserPage: value });
+    this.setState({ pageLimitationM: value });
   }
 
   /**
@@ -285,7 +283,7 @@ export default class AdminCustomizeContainer extends Container {
         isEnabledTimeline: this.state.isEnabledTimeline,
         isSavedStatesOfTabChanges: this.state.isSavedStatesOfTabChanges,
         isEnabledAttachTitleHeader: this.state.isEnabledAttachTitleHeader,
-        pageListLimitForUserPage: this.state.pageListLimitForUserPage,
+        pageLimitationM: this.state.pageLimitationM,
         // TODO implement for pageListLimitForModal
         isEnabledStaleNotification: this.state.isEnabledStaleNotification,
         isAllReplyShown: this.state.isAllReplyShown,
@@ -295,7 +293,7 @@ export default class AdminCustomizeContainer extends Container {
         isEnabledTimeline: customizedParams.isEnabledTimeline,
         isSavedStatesOfTabChanges: customizedParams.isSavedStatesOfTabChanges,
         isEnabledAttachTitleHeader: customizedParams.isEnabledAttachTitleHeader,
-        pageListLimitForUserPage: customizedParams.pageListLimitForUserPage,
+        pageLimitationM: customizedParams.pageLimitationM,
         // TODO implement for pageListLimitForModal
         isEnabledStaleNotification: customizedParams.isEnabledStaleNotification,
         isAllReplyShown: customizedParams.isAllReplyShown,

+ 2 - 2
src/server/models/config.js

@@ -111,7 +111,7 @@ module.exports = function(crowi) {
       'customize:isEnabledTimeline' : true,
       'customize:isSavedStatesOfTabChanges' : true,
       'customize:isEnabledAttachTitleHeader' : false,
-      'customize:showPageListLimitNumberForUserPage' : 10,
+      'customize:showPageLimitationM' : 10,
       'customize:isEnabledStaleNotification': false,
       'customize:isAllReplyShown': false,
 
@@ -218,7 +218,7 @@ module.exports = function(crowi) {
         MATHJAX: env.MATHJAX || null,
         NO_CDN: env.NO_CDN || null,
       },
-      pageListLimitForUserPage: crowi.configManager.getConfig('crowi', 'customize:showPageListLimitNumberForUserPage'),
+      pageLimitationM: crowi.configManager.getConfig('crowi', 'customize:showPageLimitationM'),
       // TODO implement for pageListLimitForModal
       isEnabledStaleNotification: crowi.configManager.getConfig('crowi', 'customize:isEnabledStaleNotification'),
       isAclEnabled: crowi.aclService.isAclEnabled(),

+ 5 - 5
src/server/routes/apiv3/customize-setting.js

@@ -37,7 +37,7 @@ const ErrorV3 = require('../../models/vo/error-apiv3');
  *            type: boolean
  *          isEnabledAttachTitleHeader:
  *            type: boolean
- *          pageListLimitForUserPage:
+ *          pageLimitationM:
  *            type: number
  *          isEnabledStaleNotification:
  *            type: boolean
@@ -100,7 +100,7 @@ module.exports = (crowi) => {
       body('isSavedStatesOfTabChanges').isBoolean(),
       body('isEnabledAttachTitleHeader').isBoolean(),
       // TODO implement for pageListLimitForModal
-      body('pageListLimitForUserPage').isInt().isInt({ min: 1, max: 1000 }),
+      body('pageLimitationM').isInt().isInt({ min: 1, max: 1000 }),
       body('isEnabledStaleNotification').isBoolean(),
       body('isAllReplyShown').isBoolean(),
     ],
@@ -152,7 +152,7 @@ module.exports = (crowi) => {
       isEnabledTimeline: await crowi.configManager.getConfig('crowi', 'customize:isEnabledTimeline'),
       isSavedStatesOfTabChanges: await crowi.configManager.getConfig('crowi', 'customize:isSavedStatesOfTabChanges'),
       isEnabledAttachTitleHeader: await crowi.configManager.getConfig('crowi', 'customize:isEnabledAttachTitleHeader'),
-      pageListLimitForUserPage: await crowi.configManager.getConfig('crowi', 'customize:showPageListLimitNumberForUserPage'),
+      pageLimitationM: await crowi.configManager.getConfig('crowi', 'customize:showPageLimitationM'),
       // TODO implement for pageListLimitForModal
       isEnabledStaleNotification: await crowi.configManager.getConfig('crowi', 'customize:isEnabledStaleNotification'),
       isAllReplyShown: await crowi.configManager.getConfig('crowi', 'customize:isAllReplyShown'),
@@ -276,7 +276,7 @@ module.exports = (crowi) => {
       'customize:isSavedStatesOfTabChanges': req.body.isSavedStatesOfTabChanges,
       'customize:isEnabledAttachTitleHeader': req.body.isEnabledAttachTitleHeader,
       // TODO implement for pageListLimitForModal
-      'customize:showPageListLimitForUserPage': req.body.pageListLimitForUserPage,
+      'customize:showPageLimitationM': req.body.pageLimitationM,
       'customize:isEnabledStaleNotification': req.body.isEnabledStaleNotification,
       'customize:isAllReplyShown': req.body.isAllReplyShown,
     };
@@ -288,7 +288,7 @@ module.exports = (crowi) => {
         isSavedStatesOfTabChanges: await crowi.configManager.getConfig('crowi', 'customize:isSavedStatesOfTabChanges'),
         isEnabledAttachTitleHeader: await crowi.configManager.getConfig('crowi', 'customize:isEnabledAttachTitleHeader'),
         // TODO implement for pageListLimitForModal
-        pageListLimitForUserPage: await crowi.configManager.getConfig('crowi', 'customize:showPageListLimitNumberForUserPage'),
+        pageLimitationM: await crowi.configManager.getConfig('crowi', 'customize:showPageLimitationM'),
         isEnabledStaleNotification: await crowi.configManager.getConfig('crowi', 'customize:isEnabledStaleNotification'),
         isAllReplyShown: await crowi.configManager.getConfig('crowi', 'customize:isAllReplyShown'),
       };