فهرست منبع

fix #122: Bug: Child pages under `/trash` are not shown

Yuki Takei 8 سال پیش
والد
کامیت
2611ab1c6c
1فایلهای تغییر یافته به همراه17 افزوده شده و 0 حذف شده
  1. 17 0
      lib/routes/page.js

+ 17 - 0
lib/routes/page.js

@@ -89,6 +89,22 @@ module.exports = function(crowi, app) {
       return actions.pageShow(req, res);
     }
   }
+  /**
+   * switch action by behaviorType
+   */
+  actions.deletedPageListShowWrapper = function(req, res) {
+    const behaviorType = Config.behaviorType(config);
+
+    if ('crowi-plus' === behaviorType) {
+      const path = '/trash' + getPathFromRequest(req);
+      return res.redirect(path);
+    }
+    // official Crowi behavior for '/trash/*'
+    else {
+      return actions.deletedPageListShow(req, res);
+    }
+  }
+
 
   actions.pageListShow = function(req, res) {
     var path = getPathFromRequest(req);
@@ -173,6 +189,7 @@ module.exports = function(crowi, app) {
       offset: offset,
       limit : limit + 1,
       isPopulateRevisionBody: Config.isEnabledTimeline(config),
+      includeDeletedPage: path.startsWith('/trash/'),
     };
 
     var renderVars = {