fix: sort visualize tree (#6110)
Co-authored-by: k k <kleangseu@yahoo.com>
This commit is contained in:
parent
bba1d1b574
commit
26dcc007e7
@ -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…
Reference in New Issue
Block a user