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
905f19ed
Commit
905f19ed
authored
Mar 11, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[toestand] fixed tree state saving
parent
4f0eb144
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
13 deletions
+24
-13
Forest.purs
src/Gargantext/Components/Forest.purs
+1
-1
GraphExplorer.purs
src/Gargantext/Components/GraphExplorer.purs
+3
-0
User.purs
src/Gargantext/Components/Nodes/Annuaire/User.purs
+7
-7
Router.purs
src/Gargantext/Components/Router.purs
+10
-3
SessionLoader.purs
src/Gargantext/Components/SessionLoader.purs
+3
-2
No files found.
src/Gargantext/Components/Forest.purs
View file @
905f19ed
...
@@ -123,7 +123,7 @@ plus handed showLogin backend = H.div { className: "row" }
...
@@ -123,7 +123,7 @@ plus handed showLogin backend = H.div { className: "row" }
title = "Add or remove connections to the server(s)."
title = "Add or remove connections to the server(s)."
divClass = "fa fa-universal-access"
divClass = "fa fa-universal-access"
buttonClass =
buttonClass =
"btn btn-primary col-5 " <> switchHanded "m
l-1 mr-auto" "mr-1 ml
-auto" handed
"btn btn-primary col-5 " <> switchHanded "m
r-1 ml-auto" "ml-1 mr
-auto" handed
forestLayout :: R2.Component Props
forestLayout :: R2.Component Props
...
...
src/Gargantext/Components/GraphExplorer.purs
View file @
905f19ed
...
@@ -141,6 +141,9 @@ explorerCpt = here.component "explorer" cpt
...
@@ -141,6 +141,9 @@ explorerCpt = here.component "explorer" cpt
multiSelectEnabledRef <- R.useRef multiSelectEnabled'
multiSelectEnabledRef <- R.useRef multiSelectEnabled'
forestOpen <- T.useBox $ Set.empty
forestOpen <- T.useBox $ Set.empty
R.useEffectOnce' $ do
R2.loadLocalStorageState R2.openNodesKey forestOpen
T.listen (R2.listenLocalStorageState R2.openNodesKey) forestOpen
R.useEffect' $ do
R.useEffect' $ do
let readData = R.readRef dataRef
let readData = R.readRef dataRef
...
...
src/Gargantext/Components/Nodes/Annuaire/User.purs
View file @
905f19ed
...
@@ -161,23 +161,23 @@ type KeyLayoutProps = (
...
@@ -161,23 +161,23 @@ type KeyLayoutProps = (
| LayoutProps
| LayoutProps
)
)
userLayout :: R
ecord LayoutProps -> R.Element
userLayout :: R
2.Component LayoutProps
userLayout
props = R.createElement userLayoutCpt props []
userLayout
= R.createElement userLayoutCpt
userLayoutCpt :: R.Component LayoutProps
userLayoutCpt :: R.Component LayoutProps
userLayoutCpt = here.component "userLayout" cpt
userLayoutCpt = here.component "userLayout" cpt
where
where
cpt {
reloadRoot, tasks, frontends, nodeId, session, reloadForest
} _ = do
cpt {
frontends, nodeId, reloadForest, reloadRoot, session, tasks
} _ = do
let sid = sessionId session
let sid = sessionId session
pure $ userLayoutWithKey {
pure $ userLayoutWithKey {
reloadRoot
frontends
, tasks
, frontends
, key: show sid <> "-" <> show nodeId
, key: show sid <> "-" <> show nodeId
, nodeId
, nodeId
, session
, reloadForest
, reloadForest
, reloadRoot
, session
, tasks
}
}
userLayoutWithKey :: Record KeyLayoutProps -> R.Element
userLayoutWithKey :: Record KeyLayoutProps -> R.Element
...
...
src/Gargantext/Components/Router.purs
View file @
905f19ed
...
@@ -2,6 +2,7 @@ module Gargantext.Components.Router (router) where
...
@@ -2,6 +2,7 @@ module Gargantext.Components.Router (router) where
import Data.Array (fromFoldable)
import Data.Array (fromFoldable)
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..))
import DOM.Simple.Console (log2)
import Reactix as R
import Reactix as R
import Reactix.DOM.HTML as H
import Reactix.DOM.HTML as H
import Record as Record
import Record as Record
...
@@ -113,9 +114,13 @@ forestedCpt = here.component "forested" cpt
...
@@ -113,9 +114,13 @@ forestedCpt = here.component "forested" cpt
authed :: Record SessionProps -> R.Element -> R.Element
authed :: Record SessionProps -> R.Element -> R.Element
authed props@{ boxes: { sessions }, session, sessionId, tasks } content =
authed props@{ boxes: { sessions }, session, sessionId, tasks } content =
sessionWrapper { fallback: home homeProps [], context: session, sessionId, sessions }
sessionWrapper { fallback: home homeProps []
[ content, footer { } [] ]
, context: session
, render
, sessionId
, sessions } []
where
where
render _ = [ content, footer {} [] ]
homeProps = RE.pick props :: Record Props
homeProps = RE.pick props :: Record Props
annuaire :: R2.Component SessionNodeProps
annuaire :: R2.Component SessionNodeProps
...
@@ -343,6 +348,8 @@ userCpt = here.component "user" cpt where
...
@@ -343,6 +348,8 @@ userCpt = here.component "user" cpt where
, tasks } _ = do
, tasks } _ = do
let sessionProps = RE.pick props :: Record SessionProps
let sessionProps = RE.pick props :: Record SessionProps
session' <- R.useContext session
session' <- R.useContext session
R.useEffect' $ do
log2 "[user] session'" session'
pure $ authed sessionProps $
pure $ authed sessionProps $
forested { boxes, tasks }
forested { boxes, tasks }
[ userLayout { frontends
[ userLayout { frontends
...
@@ -350,7 +357,7 @@ userCpt = here.component "user" cpt where
...
@@ -350,7 +357,7 @@ userCpt = here.component "user" cpt where
, reloadForest
, reloadForest
, reloadRoot
, reloadRoot
, session: session'
, session: session'
, tasks } ]
, tasks }
[]
]
where frontends = defaultFrontends
where frontends = defaultFrontends
type ContactProps = ( annuaireId :: NodeID | SessionNodeProps )
type ContactProps = ( annuaireId :: NodeID | SessionNodeProps )
...
...
src/Gargantext/Components/SessionLoader.purs
View file @
905f19ed
...
@@ -22,6 +22,7 @@ type Props =
...
@@ -22,6 +22,7 @@ type Props =
(
(
fallback :: R.Element
fallback :: R.Element
, context :: R.Context Session
, context :: R.Context Session
, render :: Unit -> Array R.Element
, sessionId :: SessionId
, sessionId :: SessionId
, sessions :: T.Box Sessions
, sessions :: T.Box Sessions
)
)
...
@@ -31,10 +32,10 @@ sessionWrapper = R.createElement sessionWrapperCpt
...
@@ -31,10 +32,10 @@ sessionWrapper = R.createElement sessionWrapperCpt
sessionWrapperCpt :: R.Component Props
sessionWrapperCpt :: R.Component Props
sessionWrapperCpt = here.component "sessionWrapper" cpt where
sessionWrapperCpt = here.component "sessionWrapper" cpt where
cpt { fallback, context,
sessionId, sessions } content
= do
cpt { fallback, context,
render, sessionId, sessions } _
= do
sessions' <- T.useLive T.unequal sessions
sessions' <- T.useLive T.unequal sessions
pure $ cp sessions'
pure $ cp sessions'
where
where
cp sessions' = c $ Sessions.lookup sessionId sessions' where
cp sessions' = c $ Sessions.lookup sessionId sessions' where
c (Just session) = (R.provideContext context session
content
)
c (Just session) = (R.provideContext context session
(render unit)
)
c Nothing = fallback
c Nothing = fallback
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