Commit 23bce02c authored by Alexandre Delanoë's avatar Alexandre Delanoë

Merge branch 'dev-tree-reload' of...

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