Commit e5eabd49 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[toestand] attempt to fix user cpt rendering

parent 905f19ed
......@@ -112,7 +112,7 @@ forestedCpt = here.component "forested" cpt
, showLogin
, tasks } children
authed :: Record SessionProps -> R.Element -> R.Element
authed :: Record SessionProps -> (Unit -> R.Element) -> R.Element
authed props@{ boxes: { sessions }, session, sessionId, tasks } content =
sessionWrapper { fallback: home homeProps []
, context: session
......@@ -120,7 +120,7 @@ authed props@{ boxes: { sessions }, session, sessionId, tasks } content =
, sessionId
, sessions } []
where
render _ = [ content, footer {} [] ]
render _ = [ content unit, footer {} [] ]
homeProps = RE.pick props :: Record Props
annuaire :: R2.Component SessionNodeProps
......@@ -130,7 +130,7 @@ annuaireCpt :: R.Component SessionNodeProps
annuaireCpt = here.component "annuaire" cpt where
cpt props@{ boxes, nodeId, session, sessionId, tasks } _ = do
let sessionProps = RE.pick props :: Record SessionProps
pure $ authed sessionProps $
pure $ authed sessionProps $ \_ ->
forested { boxes, tasks } [ annuaireLayout { frontends, nodeId, session } ]
where frontends = defaultFrontends
......@@ -141,7 +141,7 @@ corpusCpt :: R.Component SessionNodeProps
corpusCpt = here.component "corpus" cpt where
cpt props@{ boxes, nodeId, session, tasks } _ = do
let sessionProps = RE.pick props :: Record SessionProps
pure $ authed sessionProps $
pure $ authed sessionProps $ \_ ->
forested { boxes, tasks } [ corpusLayout { nodeId, session } ]
type CorpusDocumentProps =
......@@ -158,7 +158,7 @@ corpusDocumentCpt = here.component "corpusDocument" cpt
where
cpt props@{ boxes, corpusId: corpusId', listId, nodeId, session, sessionId, tasks } _ = do
let sessionProps = RE.pick props :: Record SessionProps
pure $ authed sessionProps $
pure $ authed sessionProps $ \_ ->
forested { boxes, tasks }
[ documentMainLayout { mCorpusId: corpusId, listId: listId, nodeId, session } [] ]
where corpusId = Just corpusId'
......@@ -171,7 +171,7 @@ dashboardCpt = here.component "dashboard" cpt
where
cpt props@{ boxes, nodeId, session, tasks } _ = do
let sessionProps = RE.pick props :: Record SessionProps
pure $ authed sessionProps $
pure $ authed sessionProps $ \_ ->
forested { boxes, tasks } [ dashboardLayout { nodeId, session } [] ]
type DocumentProps = ( listId :: ListId | SessionNodeProps )
......@@ -183,7 +183,7 @@ documentCpt :: R.Component DocumentProps
documentCpt = here.component "document" cpt where
cpt props@{ listId, nodeId, session, sessionId, tasks, boxes } _ = do
let sessionProps = RE.pick props :: Record SessionProps
pure $ authed sessionProps $
pure $ authed sessionProps $ \_ ->
forested { boxes, tasks }
[ documentMainLayout { listId, nodeId, mCorpusId, session } [] ]
where mCorpusId = Nothing
......@@ -215,7 +215,7 @@ listsCpt = here.component "lists" cpt where
, tasks } _ = do
let sessionProps = RE.pick props :: Record SessionProps
session' <- R.useContext session
pure $ authed sessionProps $
pure $ authed sessionProps $ \_ ->
Lists.listsWithForest
{ forestProps: { backend
, forestOpen
......@@ -253,7 +253,7 @@ graphExplorerCpt = here.component "graphExplorer" cpt where
, session
, tasks } _ = do
let sessionProps = RE.pick props :: Record SessionProps
pure $ authed sessionProps $
pure $ authed sessionProps $ \_ ->
simpleLayout { handed }
[ explorerLayoutLoader { backend
, frontends
......@@ -273,7 +273,7 @@ routeFileCpt :: R.Component SessionNodeProps
routeFileCpt = here.component "routeFile" cpt where
cpt props@{ nodeId, session, sessionId, boxes, tasks } _ = do
let sessionProps = RE.pick props :: Record SessionProps
pure $ authed sessionProps $
pure $ authed sessionProps $ \_ ->
forested { boxes, tasks } [ fileLayout { nodeId, session } ]
type RouteFrameProps = (
......@@ -288,7 +288,8 @@ routeFrameCpt :: R.Component RouteFrameProps
routeFrameCpt = here.component "routeFrame" cpt where
cpt props@{ nodeId, nodeType, session, sessionId, boxes, tasks } _ = do
let sessionProps = RE.pick props :: Record SessionProps
pure $ authed sessionProps $ forested { boxes, tasks } [ frameLayout { nodeId, nodeType, session } ]
pure $ authed sessionProps $ \_ ->
forested { boxes, tasks } [ frameLayout { nodeId, nodeType, session } ]
team :: R2.Component SessionNodeProps
team = R.createElement teamCpt
......@@ -297,7 +298,8 @@ teamCpt :: R.Component SessionNodeProps
teamCpt = here.component "team" cpt where
cpt props@{ nodeId, session, sessionId, boxes, tasks } _ = do
let sessionProps = RE.pick props :: Record SessionProps
pure $ authed sessionProps $ forested { boxes, tasks } [ corpusLayout { nodeId, session } ]
pure $ authed sessionProps $ \_ ->
forested { boxes, tasks } [ corpusLayout { nodeId, session } ]
texts :: R2.Component SessionNodeProps
texts = R.createElement textsCpt
......@@ -319,7 +321,7 @@ textsCpt = here.component "texts" cpt
, tasks } _ = do
let sessionProps = RE.pick props :: Record SessionProps
session' <- R.useContext session
pure $ authed sessionProps $
pure $ authed sessionProps $ \_ ->
Texts.textsWithForest
{ forestProps: { backend
, forestOpen
......@@ -350,7 +352,7 @@ userCpt = here.component "user" cpt where
session' <- R.useContext session
R.useEffect' $ do
log2 "[user] session'" session'
pure $ authed sessionProps $
pure $ authed sessionProps $ \_ ->
forested { boxes, tasks }
[ userLayout { frontends
, nodeId
......@@ -371,7 +373,7 @@ contactCpt = here.component "contact" cpt where
, boxes: { reloadForest, reloadRoot } } _ = do
let sessionProps = RE.pick props :: Record SessionProps
let forestedProps = RE.pick props :: Record Props
pure $ authed sessionProps $
pure $ authed sessionProps $ \_ ->
forested forestedProps
[ contactLayout { annuaireId, frontends, nodeId, reloadForest, reloadRoot, session, tasks } [] ]
where frontends = defaultFrontends
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment