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
142
Issues
142
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
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
gargantext
purescript-gargantext
Commits
754b9eb2
Commit
754b9eb2
authored
Sep 08, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ERGO] Tree.Node is not leaf then chevron
parent
305410c7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
17 deletions
+27
-17
Tree.purs
src/Gargantext/Components/Forest/Tree.purs
+6
-2
Node.purs
src/Gargantext/Components/Forest/Tree/Node.purs
+21
-15
No files found.
src/Gargantext/Components/Forest/Tree.purs
View file @
754b9eb2
...
...
@@ -31,7 +31,7 @@ import Gargantext.Components.Forest.Tree.Node.Tools.FTree (FTree, LNode(..), NTr
import Gargantext.Components.Forest.Tree.Node.Tools.Task (Tasks, tasksStruct)
import Gargantext.Ends (Frontends)
import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Prelude (Unit, bind, discard, map, pure, void, ($), (+), (<>), (==))
import Gargantext.Prelude (Unit, bind, discard, map, pure, void, ($), (+), (<>), (==)
, (<<<), not
)
import Gargantext.Routes (AppRoute)
import Gargantext.Routes as GR
import Gargantext.Sessions (OpenNodes, Session, mkNodeId, get)
...
...
@@ -200,7 +200,8 @@ toHtml p@{ asyncTasks
let withId (NTree (LNode {id: id'}) _) = id'
pure $ H.li {} $
[ nodeMainSpan { id
[ nodeMainSpan (isLeaf ary)
{ id
, dispatch: pAction
, folderOpen
, frontends
...
...
@@ -223,6 +224,9 @@ toHtml p@{ asyncTasks
}
)
isLeaf :: Array FTree -> Boolean
isLeaf = not <<< A.null
type ChildNodesProps =
( asyncTasks :: R.State GAT.Storage
, children :: Array FTree
...
...
src/Gargantext/Components/Forest/Tree/Node.purs
View file @
754b9eb2
...
...
@@ -49,9 +49,12 @@ type NodeMainSpanProps =
| CommonProps
)
nodeMainSpan :: Record NodeMainSpanProps
-> R.Element
nodeMainSpan p@{ dispatch, folderOpen, frontends, handed, session } = R.createElement el p []
type IsLeaf = Boolean
nodeMainSpan :: IsLeaf
-> Record NodeMainSpanProps
-> R.Element
nodeMainSpan isLeaf p@{ dispatch, folderOpen, frontends, handed, session } = R.createElement el p []
where
el = R2.hooksComponent thisModule "nodeMainSpan" cpt
cpt props@{id, mCurrentRoute, name, nodeType, tasks: { onTaskFinish, tasks }} _ = do
...
...
@@ -69,7 +72,7 @@ nodeMainSpan p@{ dispatch, folderOpen, frontends, handed, session } = R.createEl
pure $ H.span (dropProps droppedFile isDragOver)
$ ordering
[ folderIcon nodeType folderOpen
, chevronIcon handed nodeType folderOpen
, chevronIcon
isLeaf
handed nodeType folderOpen
, nodeLink { frontends
, id
, isSelected: mCurrentRoute
...
...
@@ -123,17 +126,20 @@ nodeMainSpan p@{ dispatch, folderOpen, frontends, handed, session } = R.createEl
then show session
else name
chevronIcon handed' nodeType folderOpen'@(open /\ _) =
H.a { className: "chevron-icon"
, onClick: R2.effToggler folderOpen'
}
[ 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 isLeaf handed' nodeType folderOpen'@(open /\ _) =
if isLeaf
then
H.a { className: "chevron-icon"
, onClick: R2.effToggler folderOpen'
}
[ 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"
} [] ]
else H.div {} []
folderIcon nodeType folderOpen'@(open /\ _) =
H.a { className: "folder-icon"
...
...
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