Commit 76d88cea authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[tree] first-level endpoint implemented

parent 11dea9a2
......@@ -85,7 +85,7 @@ forestCpt = R.hooksComponentWithModule thisModule "forest" cpt where
, reload
, root: treeId
, session: s
}
} []
plus :: Handed -> R.Setter Boolean -> R.State (Maybe Backend) -> R.Element
plus handed showLogin backend = H.div { className: handedClass } [
......
This diff is collapsed.
......@@ -56,9 +56,17 @@ type NodeMainSpanProps = (
type IsLeaf = Boolean
nodeMainSpan :: Record NodeMainSpanProps
-> R.Element
nodeMainSpan p = R.createElement nodeMainSpanCpt p []
nodeSpan :: R2.Component NodeMainSpanProps
nodeSpan = R.createElement nodeSpanCpt
nodeSpanCpt :: R.Component NodeMainSpanProps
nodeSpanCpt = R.hooksComponentWithModule thisModule "nodeSpan" cpt
where
cpt props children = do
pure $ H.div {} ([ nodeMainSpan props [] ] <> children)
nodeMainSpan :: R2.Component NodeMainSpanProps
nodeMainSpan = R.createElement nodeMainSpanCpt
nodeMainSpanCpt :: R.Component NodeMainSpanProps
nodeMainSpanCpt = R.hooksComponentWithModule thisModule "nodeMainSpan" cpt
......@@ -155,20 +163,17 @@ nodeMainSpanCpt = R.hooksComponentWithModule thisModule "nodeMainSpan" cpt
, session
}
chevronIcon isLeaf handed' nodeType (open /\ setOpen) =
if isLeaf
then H.div {} []
else
H.a { className: "chevron-icon"
, on: { click: \_ -> setOpen $ not }
}
[ H.i {
className: if open
then "fa fa-chevron-down"
else if handed' == GT.RightHanded
then "fa fa-chevron-right"
else "fa fa-chevron-left"
} [] ]
chevronIcon true handed' nodeType (open /\ setOpen) = H.div {} []
chevronIcon false handed' nodeType (open /\ setOpen) =
H.a { className: "chevron-icon"
, on: { click: \_ -> setOpen $ not }
}
[ H.i { className: if open
then "fa fa-chevron-down"
else if handed' == GT.RightHanded
then "fa fa-chevron-right"
else "fa fa-chevron-left"
} [] ]
folderIcon nodeType (open /\ setOpen) =
H.a { className: "folder-icon"
......
......@@ -172,6 +172,8 @@ sessionPath (R.PostNgramsChartsAsync i) =
sessionPath (R.NodeAPI nt i p) = nodeTypePath nt
<> (maybe "" (\i' -> "/" <> show i') i)
<> (if p == "" then "" else "/" <> p)
sessionPath (R.TreeFirstLevel nId p) = nodeTypePath Tree
<> (maybe "" (\nId' -> "/" <> show nId') nId) <> "/first-level" <> p
sessionPath (R.Search {listId, limit, offset, orderBy} Nothing) =
sessionPath $ R.NodeAPI Corpus Nothing
$ "search?list_id=" <> show listId
......
......@@ -50,6 +50,7 @@ data SessionRoute
| RecomputeNgrams (TabSubType CTabNgramType) Id ListId
| RecomputeListChart ChartType CTabNgramType Id ListId
| NodeAPI NodeType (Maybe Id) String
| TreeFirstLevel (Maybe Id) String
| GraphAPI Id String
| ListsRoute ListId
| ListDocument (Maybe ListId) (Maybe Id)
......
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