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
95d4771f
Commit
95d4771f
authored
Dec 14, 2020
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[tree] properly refresh tree after dispatch
parent
e558ac4c
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
226 additions
and
171 deletions
+226
-171
Forest.purs
src/Gargantext/Components/Forest.purs
+5
-4
Tree.purs
src/Gargantext/Components/Forest/Tree.purs
+215
-166
Node.purs
src/Gargantext/Components/Forest/Tree/Node.purs
+6
-1
No files found.
src/Gargantext/Components/Forest.purs
View file @
95d4771f
...
@@ -6,7 +6,7 @@ import Data.Maybe (Maybe(..), fromMaybe)
...
@@ -6,7 +6,7 @@ import Data.Maybe (Maybe(..), fromMaybe)
import Data.Set as Set
import Data.Set as Set
import Data.Tuple (fst, snd)
import Data.Tuple (fst, snd)
import Data.Tuple.Nested ((/\))
import Data.Tuple.Nested ((/\))
import DOM.Simple.Console (log)
import DOM.Simple.Console (log
, log2
)
import Reactix as R
import Reactix as R
import Reactix.DOM.HTML as H
import Reactix.DOM.HTML as H
...
@@ -71,13 +71,14 @@ forestCpt = R.hooksComponentWithModule thisModule "forest" cpt where
...
@@ -71,13 +71,14 @@ forestCpt = R.hooksComponentWithModule thisModule "forest" cpt where
/\ (fst asyncTasks).storage
/\ (fst asyncTasks).storage
/\ handed
/\ handed
)
)
(cpt' openNodes asyncTasks reload showLogin backend)
(cpt' openNodes asyncTasks
appReload
reload showLogin backend)
cpt' openNodes asyncTasks reload showLogin backend (frontends /\ route /\ sessions /\ _ /\ _ /\ _ /\ _ /\ handed) = do
cpt' openNodes asyncTasks
appReload
reload showLogin backend (frontends /\ route /\ sessions /\ _ /\ _ /\ _ /\ _ /\ handed) = do
pure $ R2.row $ [plus handed showLogin backend] <> trees
pure $ R2.row $ [plus handed showLogin backend] <> trees
where
where
trees = tree <$> unSessions sessions
trees = tree <$> unSessions sessions
tree s@(Session {treeId}) =
tree s@(Session {treeId}) =
treeView { asyncTasks
treeView { appReload
, asyncTasks
, frontends
, frontends
, handed
, handed
, mCurrentRoute: Just route
, mCurrentRoute: Just route
...
...
src/Gargantext/Components/Forest/Tree.purs
View file @
95d4771f
This diff is collapsed.
Click to expand it.
src/Gargantext/Components/Forest/Tree/Node.purs
View file @
95d4771f
...
@@ -5,6 +5,7 @@ import Data.Maybe (Maybe(..))
...
@@ -5,6 +5,7 @@ import Data.Maybe (Maybe(..))
import Data.Nullable (null)
import Data.Nullable (null)
import Data.Tuple (snd)
import Data.Tuple (snd)
import Data.Tuple.Nested ((/\))
import Data.Tuple.Nested ((/\))
import Effect (Effect)
import Effect.Aff (Aff, launchAff)
import Effect.Aff (Aff, launchAff)
import Effect.Class (liftEffect)
import Effect.Class (liftEffect)
import React.SyntheticEvent as E
import React.SyntheticEvent as E
...
@@ -39,7 +40,6 @@ import Gargantext.Utils.Reactix as R2
...
@@ -39,7 +40,6 @@ import Gargantext.Utils.Reactix as R2
thisModule :: String
thisModule :: String
thisModule = "Gargantext.Components.Forest.Tree.Node"
thisModule = "Gargantext.Components.Forest.Tree.Node"
-- Main Node
-- Main Node
type NodeMainSpanProps = (
type NodeMainSpanProps = (
appReload :: GT.ReloadS
appReload :: GT.ReloadS
...
@@ -51,6 +51,7 @@ type NodeMainSpanProps = (
...
@@ -51,6 +51,7 @@ type NodeMainSpanProps = (
, mCurrentRoute :: Maybe Routes.AppRoute
, mCurrentRoute :: Maybe Routes.AppRoute
, name :: Name
, name :: Name
, nodeType :: GT.NodeType
, nodeType :: GT.NodeType
, setPopoverRef :: R.Ref (Maybe (Boolean -> Effect Unit))
| CommonProps
| CommonProps
)
)
...
@@ -83,6 +84,7 @@ nodeMainSpanCpt = R.hooksComponentWithModule thisModule "nodeMainSpan" cpt
...
@@ -83,6 +84,7 @@ nodeMainSpanCpt = R.hooksComponentWithModule thisModule "nodeMainSpan" cpt
, name
, name
, nodeType
, nodeType
, session
, session
, setPopoverRef
} _ = do
} _ = do
-- only 1 popup at a time is allowed to be opened
-- only 1 popup at a time is allowed to be opened
droppedFile <- R.useState' (Nothing :: Maybe DroppedFile)
droppedFile <- R.useState' (Nothing :: Maybe DroppedFile)
...
@@ -90,6 +92,9 @@ nodeMainSpanCpt = R.hooksComponentWithModule thisModule "nodeMainSpan" cpt
...
@@ -90,6 +92,9 @@ nodeMainSpanCpt = R.hooksComponentWithModule thisModule "nodeMainSpan" cpt
popoverRef <- R.useRef null
popoverRef <- R.useRef null
R.useEffect' $ do
R.setRef setPopoverRef $ Just $ Popover.setOpen popoverRef
let ordering =
let ordering =
case handed of
case handed of
GT.LeftHanded -> reverse
GT.LeftHanded -> reverse
...
...
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