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
6d0d0db7
Commit
6d0d0db7
authored
Mar 09, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[toestand] more refactoring fixes
parent
48f83762
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
98 additions
and
68 deletions
+98
-68
App.purs
src/Gargantext/Components/App.purs
+5
-2
GraphExplorer.purs
src/Gargantext/Components/GraphExplorer.purs
+22
-16
Router.purs
src/Gargantext/Components/Router.purs
+71
-50
No files found.
src/Gargantext/Components/App.purs
View file @
6d0d0db7
module Gargantext.Components.App (app) where
import Data.Maybe (Maybe(..))
import Prelude
import Reactix as R
import Toestand as T
import Gargantext.Components.App.Data (emptyApp)
import Gargantext.Components.Router (router)
import Gargantext.Hooks (useHashRouter)
import Gargantext.Router as Router
import Gargantext.Sessions as Sessions
import Reactix as R
import Toestand as T
import Gargantext.Utils.Reactix as R2
here :: R2.Here
here = R2.here "Gargantext.Components.App"
...
...
src/Gargantext/Components/GraphExplorer.purs
View file @
6d0d0db7
...
...
@@ -45,33 +45,36 @@ import Gargantext.Utils.Toestand as T2
here :: R2.Here
here = R2.here "Gargantext.Components.GraphExplorer"
type BaseProps =
(
backend :: T.Cursor (Maybe Backend)
type BaseProps =
(
backend :: T.Cursor (Maybe Backend)
, frontends :: Frontends
, graphId :: GET.GraphId
, handed :: T.Cursor Types.Handed
, route :: T.Cursor AppRoute
, sessions :: T.Cursor Sessions
, showLogin :: T.Cursor Boolean
, tasks :: T.Cursor (Maybe GAT.Reductor) )
, tasks :: T.Cursor (Maybe GAT.Reductor)
)
type LayoutLoaderProps = ( session :: R.Context Session | BaseProps )
type LayoutProps = ( session :: Session, graphVersion :: GUR.ReloadS | BaseProps )
type LayoutProps = (
graphVersion :: GUR.ReloadS
, session :: Session
| BaseProps
)
type Props =
( graph :: SigmaxT.SGraph
, graphVersion :: GUR.ReloadS
type Props = (
graph :: SigmaxT.SGraph
, hyperdataGraph :: GET.HyperdataGraph
, mMetaData :: Maybe GET.MetaData
, session :: Session
| LayoutProps
)
--------------------------------------------------------------
explorerLayoutLoader :: R2.Component LayoutLoaderProps
explorerLayoutLoader
props = R.createElement explorerLayoutLoaderCpt props []
explorerLayoutLoader
= R.createElement explorerLayoutLoaderCpt
explorerLayoutLoaderCpt :: R.Component LayoutLoaderProps
explorerLayoutLoaderCpt = here.component "explorerLayoutLoader" cpt where
...
...
@@ -80,25 +83,28 @@ explorerLayoutLoaderCpt = here.component "explorerLayoutLoader" cpt where
session <- R.useContext props.session -- todo: ugh, props fiddling
let base = RX.pick props :: Record BaseProps
let props' = Record.merge base { graphVersion, session }
pure $ explorerLayout props'
pure $ explorerLayout props'
[]
explorerLayout :: R2.Component LayoutProps
explorerLayout
props = R.createElement explorerLayoutCpt props []
explorerLayout
= R.createElement explorerLayoutCpt
explorerLayoutCpt :: R.Component LayoutProps
explorerLayoutCpt = here.component "explorerLayout" cpt where
cpt props@{ graphId, session, graphVersion } _ = do
cpt props@{ backend
, graphId
, graphVersion
, session } _ = do
useLoader graphId (getNodes session graphVersion) handler
where
handler loaded =
explorer (Record.merge props { graph, graphVersion, hyperdataGraph: loaded, mMetaData })
handler loaded =
explorer (Record.merge props { graph, hyperdataGraph: loaded, mMetaData }) []
--
explorer (Record.merge props { graph, graphVersion, hyperdataGraph: loaded, mMetaData })
where
GET.HyperdataGraph { graph: hyperdataGraph } = loaded
Tuple mMetaData graph = convert hyperdataGraph
--------------------------------------------------------------
explorer :: R
ecord Props -> R.Element
explorer
props = R.createElement explorerCpt props []
explorer :: R
2.Component Props
explorer
= R.createElement explorerCpt
explorerCpt :: R.Component Props
explorerCpt = here.component "explorer" cpt
...
...
src/Gargantext/Components/Router.purs
View file @
6d0d0db7
This diff is collapsed.
Click to expand it.
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