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
142
Issues
142
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
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
gargantext
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)
...
@@ -19,6 +19,7 @@ import Partial.Unsafe (unsafePartial)
import Reactix as R
import Reactix as R
import Reactix.DOM.HTML as RH
import Reactix.DOM.HTML as RH
import Record as Record
import Record as Record
import Record.Extra as RX
import Toestand as T
import Toestand as T
import Gargantext.AsyncTasks as GAT
import Gargantext.AsyncTasks as GAT
...
@@ -44,41 +45,49 @@ import Gargantext.Utils.Toestand as T2
...
@@ -44,41 +45,49 @@ import Gargantext.Utils.Toestand as T2
here :: R2.Here
here :: R2.Here
here = R2.here "Gargantext.Components.GraphExplorer"
here = R2.here "Gargantext.Components.GraphExplorer"
type
LayoutProps = (
type
BaseProps =
backend :: T.Cursor (Maybe Backend)
(
backend :: T.Cursor (Maybe Backend)
, frontends :: Frontends
, frontends :: Frontends
, graphId :: GET.GraphId
, graphId :: GET.GraphId
, handed :: T.Cursor Types.Handed
, handed :: T.Cursor Types.Handed
, route :: T.Cursor AppRoute
, route :: T.Cursor AppRoute
, session :: R.Context Session
, sessions :: T.Cursor Sessions
, sessions :: T.Cursor Sessions
, showLogin :: T.Cursor Boolean
, 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 =
type Props =
( graph :: SigmaxT.SGraph
( graph :: SigmaxT.SGraph
, graphVersion :: GUR.ReloadS
, graphVersion :: GUR.ReloadS
, hyperdataGraph :: GET.HyperdataGraph
, hyperdataGraph :: GET.HyperdataGraph
, mMetaData :: Maybe GET.MetaData
, mMetaData :: Maybe GET.MetaData
, session :: Session
| LayoutProps
| LayoutProps
)
)
--------------------------------------------------------------
--------------------------------------------------------------
explorerLayout
:: Record LayoutProps -> R.Element
explorerLayout
Loader :: R2.Component LayoutLoaderProps
explorerLayout
props = R.createElement explorerLayout
Cpt props []
explorerLayout
Loader props = R.createElement explorerLayoutLoader
Cpt props []
explorerLayout
Cpt :: R.Component Layout
Props
explorerLayout
LoaderCpt :: R.Component LayoutLoader
Props
explorerLayout
Cpt = here.component "explorerLayout
" cpt where
explorerLayout
LoaderCpt = here.component "explorerLayoutLoader
" cpt where
cpt props _ = do
cpt props _ = do
graphVersion <- GUR.new
graphVersion <- GUR.new
session <- R.useContext props.session -- todo: ugh, props fiddling
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
explorerLayoutCpt :: R.Component LayoutProps
explorerLayoutView graphVersion p = R.createElement el p [] where
explorerLayoutCpt = here.component "explorerLayout" cpt where
el = here.component "explorerLayoutView" cpt
cpt props@{ graphId, session, graphVersion } _ = do
cpt props@{ graphId, session } _ = do
useLoader graphId (getNodes session graphVersion) handler
useLoader graphId (getNodes session graphVersion) handler
where
where
handler loaded =
handler loaded =
...
...
src/Gargantext/Components/Router.purs
View file @
48f83762
...
@@ -234,14 +234,8 @@ graphExplorer = R.createElement graphExplorerCpt
...
@@ -234,14 +234,8 @@ graphExplorer = R.createElement graphExplorerCpt
graphExplorerCpt :: R.Component SessionNodeProps
graphExplorerCpt :: R.Component SessionNodeProps
graphExplorerCpt = here.component "graphExplorer" cpt where
graphExplorerCpt = here.component "graphExplorer" cpt where
cpt props@{ cursors: { backend
cpt props@{ cursors: { backend, handed, route, sessions, showLogin }
, handed
, nodeId, session, tasks } _ = do
, route
, sessions
, showLogin }
, nodeId
, session
, tasks } _ = do
let sessionProps = RE.pick props :: Record SessionProps
let sessionProps = RE.pick props :: Record SessionProps
pure $ authed sessionProps $
pure $ authed sessionProps $
simpleLayout { handed }
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