Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Grégoire Locqueville
purescript-gargantext
Commits
e2a6b681
Commit
e2a6b681
authored
Oct 02, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] Forest icon and session shown to NodeUser/root of Tree.
parent
8e0b5f8d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
11 deletions
+17
-11
Forest.purs
src/Gargantext/Components/Forest.purs
+8
-5
Tree.purs
src/Gargantext/Components/Tree.purs
+9
-6
No files found.
src/Gargantext/Components/Forest.purs
View file @
e2a6b681
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)
src/Gargantext/Components/Tree.purs
View file @
e2a6b681
...
...
@@ -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 _
...
...
@@ -193,7 +194,7 @@ toHtml reload treeState@({tree: (NTree (LNode {id, name, nodeType}) ary)} /\ _)
pAction = performAction session reload treeState
cpt props _ = do
folderOpen <- R.useState' true
let withId (NTree (LNode {id: id'}) _) = id'
pure $ H.ul {}
...
...
@@ -204,9 +205,9 @@ toHtml reload treeState@({tree: (NTree (LNode {id, name, nodeType}) ary)} /\ _)
]
type NodeMainSpanProps =
( id :: ID
, name :: Name
, nodeType :: NodeType
( id
:: ID
, name
:: Name
, nodeType
:: NodeType
, mCurrentRoute :: Maybe AppRoute
)
...
...
@@ -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} [] ]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment