2
0
Эх сурвалжийг харах

fix: sort visualize tree (#6110)

Co-authored-by: k k <kleangseu@yahoo.com>
Leangseu Kim 2 жил өмнө
parent
commit
26dcc007e7

+ 1 - 1
client/components/admin/admin-pages-visualize.vue

@@ -104,7 +104,7 @@ export default {
         const truncatePath = path => _.take(path.split('/'), depth).join('/')
         const truncatePath = path => _.take(path.split('/'), depth).join('/')
         const descendantsByChild =
         const descendantsByChild =
           Object.entries(_.groupBy(descendants, page => truncatePath(page.path)))
           Object.entries(_.groupBy(descendants, page => truncatePath(page.path)))
-            .map(([childPath, descendantsGroup]) => [getPage(childPath), descendantsGroup])
+            .map(([childPath, descendantsGroup]) => [getPage(childPath), _.sortBy(descendantsGroup, child => child.path)])
             .map(([child, descendantsGroup]) =>
             .map(([child, descendantsGroup]) =>
               [child, _.filter(descendantsGroup, d => d.path !== child.path)])
               [child, _.filter(descendantsGroup, d => d.path !== child.path)])
         return {
         return {