fix: sort visualize tree (#6110)

Co-authored-by: k k <kleangseu@yahoo.com>
pull/6185/head
Leangseu Kim 2 years ago committed by GitHub
parent bba1d1b574
commit 26dcc007e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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 {

Loading…
Cancel
Save