Refactored the way to access particular node in data. Originally data is an INode[] with sequential numbers as data indexes and node ids and node access was implemented as data[id]. Now data is still INode[] but supports non-sequential ids and node access is implemented with getTreeParent and getTreeNode helpers.
Node ids now supports numbers and strings.
Added additional validation for data: INode[] to now allow rendering of broken data. For example: two nodes are market as root nodes (parent: null), or there are duplicates in node's children, etc.
Types and reducer was moved in separate files to improve readability.
What was doen in this PR:
INode[]
with sequential numbers as data indexes and node ids and node access was implemented asdata[id]
. Now data is stillINode[]
but supports non-sequential ids and node access is implemented withgetTreeParent
andgetTreeNode
helpers.data: INode[]
to now allow rendering of broken data. For example: two nodes are market as root nodes (parent: null
), or there are duplicates in node's children, etc.Reference: UIEN-3971, UIEN-3972