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
971366ab
Commit
971366ab
authored
Jun 12, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[REFACT] reading before action
parent
e98216c2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
22 deletions
+28
-22
Tree.purs
src/Gargantext/Components/Forest/Tree.purs
+12
-16
Box.purs
src/Gargantext/Components/Forest/Tree/Node/Box.purs
+16
-6
No files found.
src/Gargantext/Components/Forest/Tree.purs
View file @
971366ab
...
...
@@ -129,8 +129,7 @@ loadedTreeView p = R.createElement loadedTreeViewCpt p []
------------------------------------------------------------------------
type ToHtmlProps =
(
asyncTasks :: R.State GAT.Storage
( asyncTasks :: R.State GAT.Storage
, tasks :: Record Tasks
, tree :: FTree
| CommonProps
...
...
@@ -231,11 +230,9 @@ performAction DeleteNode p@{ openNodes: (_ /\ setOpenNodes)
} =
do
void $ deleteNode session id
liftEffect do
setOpenNodes (Set.delete (mkNodeId session id))
liftEffect $ setOpenNodes (Set.delete (mkNodeId session id))
performAction RefreshTree p
-------
performAction (DoSearch task) { reload: (_ /\ setReload)
, session
...
...
@@ -285,8 +282,7 @@ performAction (AddNode name nodeType) p@{ openNodes: (_ /\ setOpenNodes)
} =
do
task <- addNode session id $ AddNodeValue {name, nodeType}
liftEffect do
setOpenNodes (Set.insert (mkNodeId session id))
liftEffect $ setOpenNodes (Set.insert (mkNodeId session id))
performAction RefreshTree p
-------
...
...
src/Gargantext/Components/Forest/Tree/Node/Box.purs
View file @
971366ab
...
...
@@ -94,7 +94,10 @@ nodeMainSpan p@{ dispatch, folderOpen, frontends, session } = R.createElement el
, barType: Pie
, corpusId: id
, onFinish: const $ onTaskFinish t
, session }) tasks)
, session
}
) tasks
)
]
where
SettingsBox {show: showBox} = settingsBox nodeType
...
...
@@ -143,7 +146,7 @@ nodeMainSpan p@{ dispatch, folderOpen, frontends, session } = R.createElement el
$ Just
$ DroppedFile { contents: (UploadFileContents contents)
, fileType: Just CSV
, lang: Just EN
, lang
: Just EN
}
onDragOverHandler (_ /\ setIsDragOver) e = do
-- prevent redirection when file is dropped
...
...
@@ -227,7 +230,8 @@ nodeActionsCpt = R.hooksComponent "G.C.F.T.N.B.nodeActions" cpt
, nodeId: corpusId
, nodeType: GT.TabNgramType GT.CTabTerms
, session
, triggerRefresh: triggerRefresh refreshTree }
, triggerRefresh: triggerRefresh refreshTree
}
cpt _ _ = do
pure $ H.div {} []
...
...
@@ -363,9 +367,15 @@ nodePopupCpt = R.hooksComponent "G.C.F.T.N.B.nodePopupView" cpt
H.div {className: "panel-body flex-space-between"}
[ H.p { "style": {"margin":"10px"}} []
, H.div { className: "flex-center"}
[buttonClick {action: doc, state: nodePopupState}]
[ buttonClick { action: doc
, state: nodePopupState
}
]
, H.div {className: "flex-center"}
$ map (\t -> buttonClick {action: t, state: nodePopupState}) buttons
$ map (\t -> buttonClick { action: t
, state : nodePopupState
}
) buttons
]
where
SettingsBox {edit, doc, buttons} = settingsBox nodeType
...
...
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