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
cd5c85f2
Commit
cd5c85f2
authored
Mar 08, 2021
by
James Laver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
for seeg
parent
7ee27ee6
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
74 additions
and
66 deletions
+74
-66
Data.purs
src/Gargantext/Components/App/Data.purs
+7
-3
Forest.purs
src/Gargantext/Components/Forest.purs
+6
-7
GraphExplorer.purs
src/Gargantext/Components/GraphExplorer.purs
+4
-4
Router.purs
src/Gargantext/Components/Router.purs
+53
-48
SessionLoader.purs
src/Gargantext/Components/SessionLoader.purs
+4
-4
No files found.
src/Gargantext/Components/App/Data.purs
View file @
cd5c85f2
...
...
@@ -4,6 +4,7 @@ import Data.Set as Set
import Data.Maybe (Maybe(..))
import Toestand as T
import Gargantext.Ends (Backend)
import Gargantext.Sessions as Sessions
import Gargantext.Sessions (OpenNodes, Sessions)
import Gargantext.Routes (AppRoute(Home))
...
...
@@ -11,7 +12,8 @@ import Gargantext.Types (Handed(RightHanded))
import Gargantext.Utils.Toestand as T2
type App =
{ handed :: Handed
{ backend :: Maybe Backend
, handed :: Handed
, forestOpen :: OpenNodes
, reloadRoot :: Int
, reloadForest :: Int
...
...
@@ -23,7 +25,8 @@ type App =
emptyApp :: App
emptyApp =
{ handed: RightHanded
{ backend: Nothing
, handed: RightHanded
, route: Home
, forestOpen: Set.empty
, reloadRoot: T2.newReload
...
...
@@ -34,7 +37,8 @@ emptyApp =
}
type Cursors =
{ handed :: T.Cursor Handed
{ backend :: T.Cursor (Maybe Backend)
, handed :: T.Cursor Handed
, forestOpen :: T.Cursor OpenNodes
, reloadRoot :: T.Cursor Int
, reloadForest :: T.Cursor Int
...
...
src/Gargantext/Components/Forest.purs
View file @
cd5c85f2
...
...
@@ -11,7 +11,7 @@ module Gargantext.Components.Forest
import Data.Array as A
import Data.Maybe (Maybe(..), fromMaybe)
import Data.Set as Set
import Data.Tuple (fst
, snd
)
import Data.Tuple (fst)
import Data.Tuple.Nested ((/\))
import Reactix as R
import Reactix.DOM.HTML as H
...
...
@@ -25,7 +25,7 @@ import Gargantext.Ends (Frontends, Backend)
import Gargantext.Prelude
import Gargantext.Routes (AppRoute)
import Gargantext.Sessions (Session(..), Sessions, OpenNodes, unSessions)
import Gargantext.Types (Handed
(..)
, reverseHanded, switchHanded)
import Gargantext.Types (Handed, reverseHanded, switchHanded)
import Gargantext.Utils.Reactix as R2
import Gargantext.Utils.Toestand as T2
...
...
@@ -42,7 +42,7 @@ type Common =
)
type LayoutProps =
( backend :: T.Cursor
Backend
( backend :: T.Cursor
(Maybe Backend)
, reloadForest :: T.Cursor T2.Reload
, sessions :: T.Cursor Sessions
, showLogin :: T.Cursor Boolean
...
...
@@ -75,8 +75,7 @@ forestCpt = here.component "forest" cpt where
, tasks } _ = do
-- NOTE: this is a hack to reload the forest on demand
tasks' <- GAT.useTasks reloadRoot reloadForest
R.useEffect' $ do
T2.write_ (Just tasks') tasks
R.useEffect' $ T2.write_ (Just tasks') tasks
handed' <- T.useLive T.unequal handed
reloadForest' <- T.useLive T.unequal reloadForest
reloadRoot' <- T.useLive T.unequal reloadRoot
...
...
@@ -108,7 +107,7 @@ forestCpt = here.component "forest" cpt where
, session: s
, tasks } []
plus :: Handed -> T.Cursor Boolean -> T.Cursor
Backend
-> R.Element
plus :: Handed -> T.Cursor Boolean -> T.Cursor
(Maybe Backend)
-> R.Element
plus handed showLogin backend = H.div { className: "row" }
[ H.button { className: buttonClass
, on: { click }
...
...
@@ -122,7 +121,7 @@ plus handed showLogin backend = H.div { className: "row" }
-- [ H.i { className: "material-icons md-36"} [] ]
where
click _ = do
-- _ <- T.
modify (const Nothing)
backend
-- _ <- T.
write Nothing
backend
T2.write_ true showLogin
title = "Add or remove connections to the server(s)."
divClass = "fa fa-universal-access"
...
...
src/Gargantext/Components/GraphExplorer.purs
View file @
cd5c85f2
...
...
@@ -44,8 +44,8 @@ import Gargantext.Utils.Toestand as T2
here :: R2.Here
here = R2.here "Gargantext.Components.GraphExplorer"
type LayoutProps =
(
backend :: T.Cursor Backend
type LayoutProps =
( backend :: T.Cursor (Maybe Backend)
, frontends :: Frontends
, graphId :: GET.GraphId
, handed :: T.Cursor Types.Handed
...
...
@@ -250,8 +250,8 @@ explorerCpt = here.component "explorer" cpt
Sidebar.sidebar (Record.merge props { metaData })
type TreeProps = (
backend :: T.Cursor
Backend
, forestOpen :: T.Cursor OpenNodes
backend :: T.Cursor
(Maybe Backend)
, forestOpen
:: T.Cursor OpenNodes
, frontends :: Frontends
, handed :: T.Cursor Types.Handed
, reload :: T.Cursor T2.Reload
...
...
src/Gargantext/Components/Router.purs
View file @
cd5c85f2
This diff is collapsed.
Click to expand it.
src/Gargantext/Components/SessionLoader.purs
View file @
cd5c85f2
...
...
@@ -15,16 +15,16 @@ import Gargantext.Utils.Reactix as R2
here :: R2.Here
here = R2.here "Gargantext.Components.SessionWrapper"
type Props
sessions
=
type Props =
( sessionId :: SessionId
, sessions ::
s
essions
, sessions ::
T.Cursor S
essions
, provider :: R.Provider Session
, fallback :: R.Element )
sessionWrapper ::
forall s. T.Read s Sessions => R2.Component (Props s)
sessionWrapper ::
R2.Component Props
sessionWrapper = R.createElement sessionWrapperCpt
sessionWrapperCpt ::
forall s. T.Read s Sessions => R.Component (Props s)
sessionWrapperCpt ::
R.Component Props
sessionWrapperCpt = here.component "sessionWrapper" cpt where
cpt { sessionId, sessions, provider, fallback } content =
cp <$> T.useLive T.unequal sessions where
...
...
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