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
7ee27ee6
Commit
7ee27ee6
authored
Mar 05, 2021
by
James Laver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove views from router
parent
1b753ff9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
30 deletions
+26
-30
Router.purs
src/Gargantext/Components/Router.purs
+26
-30
No files found.
src/Gargantext/Components/Router.purs
View file @
7ee27ee6
...
@@ -41,7 +41,6 @@ here = R2.here "Gargantext.Components.Router"
...
@@ -41,7 +41,6 @@ here = R2.here "Gargantext.Components.Router"
type Props = (
type Props = (
cursors :: Cursors
cursors :: Cursors
, tasks :: T.Cursor (Maybe GAT.Reductor)
, tasks :: T.Cursor (Maybe GAT.Reductor)
, views :: App.Views
)
)
router :: R2.Leaf Props
router :: R2.Leaf Props
...
@@ -49,11 +48,11 @@ router props = R.createElement routerCpt props []
...
@@ -49,11 +48,11 @@ router props = R.createElement routerCpt props []
routerCpt :: R.Component Props
routerCpt :: R.Component Props
routerCpt = here.component "root" cpt where
routerCpt = here.component "root" cpt where
cpt props@{ cursors,
vie
ws, tasks } _ = do
cpt props@{ cursors, ws, tasks } _ = do
let session = R.createContext (unsafeCoerce {})
let session = R.createContext (unsafeCoerce {})
showLogin <- T.useLive T.unequal
view
s.showLogin
showLogin <- T.useLive T.unequal
cursor
s.showLogin
route <- T.useLive (T.changed notEq)
view
s.route
route <- T.useLive (T.changed notEq)
cursor
s.route
if showLogin then login' cursors
views
if showLogin then login' cursors
else case route of
else case route of
GR.Annuaire s n -> annuaire props s n
GR.Annuaire s n -> annuaire props s n
GR.Corpus s n -> corpus props s n
GR.Corpus s n -> corpus props s n
...
@@ -78,58 +77,56 @@ routerCpt = here.component "root" cpt where
...
@@ -78,58 +77,56 @@ routerCpt = here.component "root" cpt where
GR.ContactPage s a n -> contact props s a n
GR.ContactPage s a n -> contact props s a n
forested :: Record Props -> Array R.Element -> R.Element
forested :: Record Props -> Array R.Element -> R.Element
forested { tasks, views: { route, handed, sessions }
forested { tasks, cursors: { route, handed, sessions, backend, reloadForest, reloadRoot, showLogin } } =
, cursors: { backend, reloadForest, reloadRoot, showLogin } } =
forestLayout
forestLayout
{ tasks, frontends, route, handed, sessions
{ tasks, frontends, route, handed, sessions
, backend, reloadForest, reloadRoot, showLogin
, backend, reloadForest, reloadRoot, showLogin
} where frontends = defaultFrontends
} where frontends = defaultFrontends
authed :: Record Props -> SessionId -> R.Element -> R.Element
authed :: Record Props -> SessionId -> R.Element -> R.Element
authed props@{ cursors: { session }, views: views@{ sessions }
authed props@{ cursors: { session, sessions } , tasks } sessionId content =
, tasks } sessionId content =
sessionWrapper { sessionId, session, sessions, fallback: home props }
sessionWrapper { sessionId, session, sessions, fallback: home props }
[ content, footer { session
: views.session
} ]
[ content, footer { session } ]
annuaire :: Record Props -> SessionId -> NodeID -> R.Element
annuaire :: Record Props -> SessionId -> NodeID -> R.Element
annuaire props@{ tasks, cursors
, views
: { session } } sessionId nodeId =
annuaire props@{ tasks, cursors: { session } } sessionId nodeId =
authed props sessionId $
authed props sessionId $
forested props [ annuaireLayout { nodeId, frontends, session } ]
forested props [ annuaireLayout { nodeId, frontends, session } ]
where frontends = defaultFrontends
where frontends = defaultFrontends
corpus :: Record Props -> SessionId -> NodeID -> R.Element
corpus :: Record Props -> SessionId -> NodeID -> R.Element
corpus props@{ tasks, cursors
, views
} sessionId nodeId =
corpus props@{ tasks, cursors
: session
} sessionId nodeId =
authed props sessionId $
authed props sessionId $
forested props
forested props
[ corpusLayout { nodeId, session
: views.session
} ]
[ corpusLayout { nodeId, session } ]
corpusDocument :: Record Props -> SessionId -> CorpusId -> ListId -> NodeID -> R.Element
corpusDocument :: Record Props -> SessionId -> CorpusId -> ListId -> NodeID -> R.Element
corpusDocument props@{ tasks, cursors
, views
} sessionId corpusId' listId nodeId =
corpusDocument props@{ tasks, cursors
: session
} sessionId corpusId' listId nodeId =
authed props sessionId $
authed props sessionId $
forested props
forested props
[ documentMainLayout { listId, nodeId, corpusId, sessionId, session
: views.session
} [] ]
[ documentMainLayout { listId, nodeId, corpusId, sessionId, session } [] ]
where corpusId = Just corpusId'
where corpusId = Just corpusId'
dashboard :: Record Props -> SessionId -> NodeID -> R.Element
dashboard :: Record Props -> SessionId -> NodeID -> R.Element
dashboard props@{ tasks, cursors
, views
: { session } } sessionId nodeId =
dashboard props@{ tasks, cursors: { session } } sessionId nodeId =
authed props sessionId $
authed props sessionId $
forested props [ dashboardLayout { nodeId, session } [] ]
forested props [ dashboardLayout { nodeId, session } [] ]
document :: Record Props -> SessionId -> ListId -> NodeID -> R.Element
document :: Record Props -> SessionId -> ListId -> NodeID -> R.Element
document props@{ tasks, cursors
, views
: { session } } sessionId listId nodeId =
document props@{ tasks, cursors: { session } } sessionId listId nodeId =
authed props sessionId $
authed props sessionId $
forested props
forested props
[ documentMainLayout { listId, nodeId, corpusId, session } [] ]
[ documentMainLayout { listId, nodeId, corpusId, session } [] ]
where corpusId = Nothing
where corpusId = Nothing
home :: Record Props -> R.Element
home :: Record Props -> R.Element
home props@{ cursors: { backend, showLogin
}, views: {
sessions } } =
home props@{ cursors: { backend, showLogin
,
sessions } } =
forested props [ homeLayout { sessions, backend, showLogin, lang: LL_EN } ]
forested props [ homeLayout { sessions, backend, showLogin, lang: LL_EN } ]
lists :: Record Props -> SessionId -> NodeID -> R.Element
lists :: Record Props -> SessionId -> NodeID -> R.Element
lists props@{
task
s
lists props@{
cursors: { backend, route, handed, session
s
, cursors: {
reloadForest, reloadRoot, session, showLogin }
,
reloadForest, reloadRoot, session, showLogin }
,
views: { backend, route, handed, sessions }
} sessionId nodeId =
,
tasks
} sessionId nodeId =
authed props sessionId $
authed props sessionId $
Lists.listsWithForest
Lists.listsWithForest
{ forestProps: { backend
{ forestProps: { backend
...
@@ -151,8 +148,8 @@ login' { backend, sessions, showLogin: visible } =
...
@@ -151,8 +148,8 @@ login' { backend, sessions, showLogin: visible } =
, backends: fromFoldable defaultBackends }
, backends: fromFoldable defaultBackends }
graphExplorer :: Record Props -> SessionId -> Int -> R.Element
graphExplorer :: Record Props -> SessionId -> Int -> R.Element
graphExplorer props@{ views: { backend, route, handed, session, sessions }
graphExplorer props@{ views: { backend, route, handed, session, sessions
, showLogin
}
, tasks
, cursors: { showLogin }
} sessionId graphId =
, tasks } sessionId graphId =
authed props sessionId $
authed props sessionId $
simpleLayout { handed }
simpleLayout { handed }
[ explorerLayout { tasks, graphId, backend, route, frontends
[ explorerLayout { tasks, graphId, backend, route, frontends
...
@@ -160,20 +157,19 @@ graphExplorer props@{ views: { backend, route, handed, session, sessions }
...
@@ -160,20 +157,19 @@ graphExplorer props@{ views: { backend, route, handed, session, sessions }
where frontends = defaultFrontends
where frontends = defaultFrontends
routeFile :: Record Props -> SessionId -> NodeID -> R.Element
routeFile :: Record Props -> SessionId -> NodeID -> R.Element
routeFile props@{
view
s: { session } } sessionId nodeId =
routeFile props@{
cursor
s: { session } } sessionId nodeId =
authed props sessionId $ forested props [ fileLayout { nodeId, session } ]
authed props sessionId $ forested props [ fileLayout { nodeId, session } ]
routeFrame :: Record Props -> SessionId -> NodeID -> NodeType -> R.Element
routeFrame :: Record Props -> SessionId -> NodeID -> NodeType -> R.Element
routeFrame props@{
view
s: { session } } sessionId nodeId nodeType =
routeFrame props@{
cursor
s: { session } } sessionId nodeId nodeType =
authed props sessionId $ forested props [ frameLayout { nodeId, nodeType, session } ]
authed props sessionId $ forested props [ frameLayout { nodeId, nodeType, session } ]
team :: Record Props -> SessionId -> NodeID -> R.Element
team :: Record Props -> SessionId -> NodeID -> R.Element
team props@{ tasks, cursors
, views
: { session } } sessionId nodeId =
team props@{ tasks, cursors: { session } } sessionId nodeId =
authed props sessionId $ forested props [ corpusLayout { nodeId, session } ]
authed props sessionId $ forested props [ corpusLayout { nodeId, session } ]
texts :: Record Props -> SessionId -> NodeID -> R.Element
texts :: Record Props -> SessionId -> NodeID -> R.Element
texts props@{ cursors: { backend, reloadForest, reloadRoot, showLogin }
texts props@{ cursors: { backend, reloadForest, reloadRoot, showLogin, route, handed, session, sessions }
, views: { route, handed, session, sessions }
, tasks } sessionId nodeId =
, tasks } sessionId nodeId =
authed props sessionId $
authed props sessionId $
Texts.textsWithForest
Texts.textsWithForest
...
@@ -183,10 +179,10 @@ texts props@{ cursors: { backend, reloadForest, reloadRoot, showLogin }
...
@@ -183,10 +179,10 @@ texts props@{ cursors: { backend, reloadForest, reloadRoot, showLogin }
[] where frontends = defaultFrontends
[] where frontends = defaultFrontends
user :: Record Props -> SessionId -> NodeID -> R.Element
user :: Record Props -> SessionId -> NodeID -> R.Element
user props@{ cursors: { reloadRoot
}, tasks, view
s } sessionId nodeId =
user props@{ cursors: { reloadRoot
, session }, task
s } sessionId nodeId =
authed props sessionId $
authed props sessionId $
forested props
forested props
[ userLayout { tasks, nodeId, session
: views.session
, reloadRoot, frontends } ]
[ userLayout { tasks, nodeId, session, reloadRoot, frontends } ]
where frontends = defaultFrontends
where frontends = defaultFrontends
contact :: Record Props -> SessionId -> NodeID -> R.Element
contact :: Record Props -> SessionId -> NodeID -> R.Element
...
...
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