Commit e558ac4c authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[tree] sort children properly (by id)

parent 5530fae5
......@@ -337,7 +337,7 @@ toHtmlFirstLevel = R.createElement elCpt
, id: cId
}
) []
) publicizedChildren
) $ sorted publicizedChildren
)
-- childNodesFirstLevel ( Record.merge commonProps
-- { asyncTasks
......@@ -351,6 +351,9 @@ toHtmlFirstLevel = R.createElement elCpt
-- }
-- )
sorted :: Array FTree -> Array FTree
sorted = A.sortWith (\(NTree (LNode {id}) _) -> id)
type ChildNodesProps =
( asyncTasks :: GAT.Reductor
......@@ -420,7 +423,9 @@ childNodeFirstLevelPaint = R.createElement elCpt
elCpt :: R.Component ChildNodeFirstLevelPaintProps
elCpt = R.hooksComponentWithModule thisModule "childNodeFirstLevelPaint" cpt
cpt props@{ asyncTasks, handed, folderOpen: (false /\ _), reload, tree: ctree@(NTree (LNode { id }) _) } _ = do
-- TODO folderOpen is unused
cpt props@{ asyncTasks, handed, reload, tree: ctree@(NTree (LNode { id }) _) } _ = do
pure $ H.ul {} [
toHtmlFirstLevel (Record.merge commonProps { asyncTasks
, handed
......@@ -430,16 +435,6 @@ childNodeFirstLevelPaint = R.createElement elCpt
-- pure $ H.div { } [ H.text $ "[closed] Node id " <> show id ]
where
commonProps = RecordE.pick props :: Record CommonProps
cpt props@{ asyncTasks, handed, folderOpen: (true /\ _), reload, tree: ctree@(NTree (LNode { id }) _) } _ = do
pure $ H.ul {} [
toHtmlFirstLevel (Record.merge commonProps { asyncTasks
, handed
, tree: ctree }
) []
]
-- pure $ H.div { } [ H.text $ "[opened] Node id " <> show id ]
where
commonProps = RecordE.pick props :: Record CommonProps
type PerformActionProps =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment