Commit e2a6b681 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FIX] Forest icon and session shown to NodeUser/root of Tree.

parent 8e0b5f8d
module Gargantext.Components.Forest where
import Prelude (const, show)
import Prelude (const)
import Data.Maybe (Maybe(..))
import Reactix as R
import Reactix.DOM.HTML as H
......@@ -14,7 +14,8 @@ type Props =
( sessions :: Sessions
, route :: AppRoute
, frontends :: Frontends
, showLogin :: R2.Setter Boolean )
, showLogin :: R2.Setter Boolean
)
forest :: Record Props -> R.Element
forest props = R.createElement forestCpt props []
......@@ -29,15 +30,17 @@ forestCpt = R.staticComponent "G.C.Forest.forest" cpt where
Nothing -> R.fragment []
Just s@(Session {treeId}) ->
R.fragment
[ H.text (show s)
, treeView { root: treeId
[ treeView { root: treeId
, frontends
, mCurrentRoute: Just route
, session: s }
]
plus :: R2.Setter Boolean -> R.Element
plus showLogin = H.button {on: {click}} [ H.text "+" ]
plus showLogin = H.button {on: {click}}
[ H.i { className: "glyphicon glyphicon-log-in"}
[]
]
where
click _ = do
showLogin (const true)
......@@ -70,7 +70,8 @@ filterNTree p (NTree x ary) =
newtype LNode = LNode { id :: ID
, name :: Name
, nodeType :: NodeType}
, nodeType :: NodeType
}
derive instance newtypeLNode :: Newtype LNode _
......@@ -230,12 +231,14 @@ nodeMainSpan d p folderOpen session frontends = R.createElement el p []
, H.a { href: (url frontends (NodePath nodeType (Just id)))
, style: {marginLeft: "22px"}
}
[ nodeText {isSelected: (mCorpusId mCurrentRoute) == (Just id), name} ]
[ nodeText {isSelected: (mCorpusId mCurrentRoute) == (Just id), name:name'} ]
, popOverIcon popupOpen
, nodePopupView d {id, name} popupOpen
, createNodeView d {id, name} popupOpen
, fileTypeView d {id} droppedFile isDragOver
]
where
name' = if nodeType == NodeUser then show session else name
folderIcon folderOpen'@(open /\ _) =
H.a {onClick: R2.effToggler folderOpen'}
[ H.i {className: fldr open} [] ]
......
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