chore: Update IndexedNode
to always have a parentId
property
#462
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
parentId
property toIndexedNode
sortFlow()
logic to match PlanX graph structureWhy?
sortFlow()
returns an optionalparentId
, despite all nodes having a parent (apart from the root node). It's more accurate to give all nodes a parent. This makes things a bit easier when constructing a path (upcoming PR)sortFlow()
doesn't quite match our graph structure. When reaching the next child of the root node, the current parentId is maintained instead of falling back to the root. This worked well for treating the graph as a linear structure to split it up be portal names (pseudo sections), but doesn't work in terms of actually describing the hierarchy of the graph (required to build a valid PlanX URL).root.edges[0]
→root.edges[1]
→root.edges[2]
→ etcNote: This should not impact any current functionality.
sortFlow()
andfindNextNodeOfType()
are not used anywhere in PlanX currently.Example
root.edges[1]
will be set to the very final node ofroot.edges[0]
(previous node)root.edges[1]
will be set to "_root" (parent node)