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
48f83762
Commit
48f83762
authored
Mar 08, 2021
by
James Laver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wowzer this record error...
parent
bbb3350a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
22 deletions
+25
-22
GraphExplorer.purs
src/Gargantext/Components/GraphExplorer.purs
+23
-14
Router.purs
src/Gargantext/Components/Router.purs
+2
-8
No files found.
src/Gargantext/Components/GraphExplorer.purs
View file @
48f83762
...
...
@@ -19,6 +19,7 @@ import Partial.Unsafe (unsafePartial)
import Reactix as R
import Reactix.DOM.HTML as RH
import Record as Record
import Record.Extra as RX
import Toestand as T
import Gargantext.AsyncTasks as GAT
...
...
@@ -44,41 +45,49 @@ import Gargantext.Utils.Toestand as T2
here :: R2.Here
here = R2.here "Gargantext.Components.GraphExplorer"
type
LayoutProps = (
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
, session :: R.Context Session
, 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 Props =
( graph :: SigmaxT.SGraph
, graphVersion :: GUR.ReloadS
, hyperdataGraph :: GET.HyperdataGraph
, mMetaData :: Maybe GET.MetaData
, session :: Session
| LayoutProps
)
--------------------------------------------------------------
explorerLayout
:: Record LayoutProps -> R.Element
explorerLayout
props = R.createElement explorerLayout
Cpt props []
explorerLayout
Loader :: R2.Component LayoutLoaderProps
explorerLayout
Loader props = R.createElement explorerLayoutLoader
Cpt props []
explorerLayout
Cpt :: R.Component Layout
Props
explorerLayout
Cpt = here.component "explorerLayout
" cpt where
explorerLayout
LoaderCpt :: R.Component LayoutLoader
Props
explorerLayout
LoaderCpt = here.component "explorerLayoutLoader
" cpt where
cpt props _ = do
graphVersion <- GUR.new
session <- R.useContext props.session -- todo: ugh, props fiddling
pure $ explorerLayoutView graphVersion props
let base = RX.pick props :: Record BaseProps
let props' = Record.merge base { graphVersion, session }
pure $ explorerLayout props'
explorerLayout :: R2.Component LayoutProps
explorerLayout props = R.createElement explorerLayoutCpt props []
explorerLayoutView :: GUR.ReloadS -> Record LayoutProps -> R.Element
explorerLayoutView graphVersion p = R.createElement el p [] where
el = here.component "explorerLayoutView" cpt
cpt props@{ graphId, session } _ = do
explorerLayoutCpt :: R.Component LayoutProps
explorerLayoutCpt = here.component "explorerLayout" cpt where
cpt props@{ graphId, session, graphVersion } _ = do
useLoader graphId (getNodes session graphVersion) handler
where
handler loaded =
...
...
src/Gargantext/Components/Router.purs
View file @
48f83762
...
...
@@ -234,14 +234,8 @@ graphExplorer = R.createElement graphExplorerCpt
graphExplorerCpt :: R.Component SessionNodeProps
graphExplorerCpt = here.component "graphExplorer" cpt where
cpt props@{ cursors: { backend
, handed
, route
, sessions
, showLogin }
, nodeId
, session
, tasks } _ = do
cpt props@{ cursors: { backend, handed, route, sessions, showLogin }
, nodeId, session, tasks } _ = do
let sessionProps = RE.pick props :: Record SessionProps
pure $ authed sessionProps $
simpleLayout { handed }
...
...
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