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 ...@@ -112,7 +112,7 @@ forestedCpt = here.component "forested" cpt
, showLogin , showLogin
, tasks } children , 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 = authed props@{ boxes: { sessions }, session, sessionId, tasks } content =
sessionWrapper { fallback: home homeProps [] sessionWrapper { fallback: home homeProps []
, context: session , context: session
...@@ -120,7 +120,7 @@ authed props@{ boxes: { sessions }, session, sessionId, tasks } content = ...@@ -120,7 +120,7 @@ authed props@{ boxes: { sessions }, session, sessionId, tasks } content =
, sessionId , sessionId
, sessions } [] , sessions } []
where where
render _ = [ content, footer {} [] ] render _ = [ content unit, footer {} [] ]
homeProps = RE.pick props :: Record Props homeProps = RE.pick props :: Record Props
annuaire :: R2.Component SessionNodeProps annuaire :: R2.Component SessionNodeProps
...@@ -130,7 +130,7 @@ annuaireCpt :: R.Component SessionNodeProps ...@@ -130,7 +130,7 @@ annuaireCpt :: R.Component SessionNodeProps
annuaireCpt = here.component "annuaire" cpt where annuaireCpt = here.component "annuaire" cpt where
cpt props@{ boxes, nodeId, session, sessionId, tasks } _ = do cpt props@{ boxes, nodeId, session, sessionId, tasks } _ = do
let sessionProps = RE.pick props :: Record SessionProps let sessionProps = RE.pick props :: Record SessionProps
pure $ authed sessionProps $ pure $ authed sessionProps $ \_ ->
forested { boxes, tasks } [ annuaireLayout { frontends, nodeId, session } ] forested { boxes, tasks } [ annuaireLayout { frontends, nodeId, session } ]
where frontends = defaultFrontends where frontends = defaultFrontends
...@@ -141,7 +141,7 @@ corpusCpt :: R.Component SessionNodeProps ...@@ -141,7 +141,7 @@ corpusCpt :: R.Component SessionNodeProps
corpusCpt = here.component "corpus" cpt where corpusCpt = here.component "corpus" cpt where
cpt props@{ boxes, nodeId, session, tasks } _ = do cpt props@{ boxes, nodeId, session, tasks } _ = do
let sessionProps = RE.pick props :: Record SessionProps let sessionProps = RE.pick props :: Record SessionProps
pure $ authed sessionProps $ pure $ authed sessionProps $ \_ ->
forested { boxes, tasks } [ corpusLayout { nodeId, session } ] forested { boxes, tasks } [ corpusLayout { nodeId, session } ]
type CorpusDocumentProps = type CorpusDocumentProps =
...@@ -158,7 +158,7 @@ corpusDocumentCpt = here.component "corpusDocument" cpt ...@@ -158,7 +158,7 @@ corpusDocumentCpt = here.component "corpusDocument" cpt
where where
cpt props@{ boxes, corpusId: corpusId', listId, nodeId, session, sessionId, tasks } _ = do cpt props@{ boxes, corpusId: corpusId', listId, nodeId, session, sessionId, tasks } _ = do
let sessionProps = RE.pick props :: Record SessionProps let sessionProps = RE.pick props :: Record SessionProps
pure $ authed sessionProps $ pure $ authed sessionProps $ \_ ->
forested { boxes, tasks } forested { boxes, tasks }
[ documentMainLayout { mCorpusId: corpusId, listId: listId, nodeId, session } [] ] [ documentMainLayout { mCorpusId: corpusId, listId: listId, nodeId, session } [] ]
where corpusId = Just corpusId' where corpusId = Just corpusId'
...@@ -171,7 +171,7 @@ dashboardCpt = here.component "dashboard" cpt ...@@ -171,7 +171,7 @@ dashboardCpt = here.component "dashboard" cpt
where where
cpt props@{ boxes, nodeId, session, tasks } _ = do cpt props@{ boxes, nodeId, session, tasks } _ = do
let sessionProps = RE.pick props :: Record SessionProps let sessionProps = RE.pick props :: Record SessionProps
pure $ authed sessionProps $ pure $ authed sessionProps $ \_ ->
forested { boxes, tasks } [ dashboardLayout { nodeId, session } [] ] forested { boxes, tasks } [ dashboardLayout { nodeId, session } [] ]
type DocumentProps = ( listId :: ListId | SessionNodeProps ) type DocumentProps = ( listId :: ListId | SessionNodeProps )
...@@ -183,7 +183,7 @@ documentCpt :: R.Component DocumentProps ...@@ -183,7 +183,7 @@ documentCpt :: R.Component DocumentProps
documentCpt = here.component "document" cpt where documentCpt = here.component "document" cpt where
cpt props@{ listId, nodeId, session, sessionId, tasks, boxes } _ = do cpt props@{ listId, nodeId, session, sessionId, tasks, boxes } _ = do
let sessionProps = RE.pick props :: Record SessionProps let sessionProps = RE.pick props :: Record SessionProps
pure $ authed sessionProps $ pure $ authed sessionProps $ \_ ->
forested { boxes, tasks } forested { boxes, tasks }
[ documentMainLayout { listId, nodeId, mCorpusId, session } [] ] [ documentMainLayout { listId, nodeId, mCorpusId, session } [] ]
where mCorpusId = Nothing where mCorpusId = Nothing
...@@ -215,7 +215,7 @@ listsCpt = here.component "lists" cpt where ...@@ -215,7 +215,7 @@ listsCpt = here.component "lists" cpt where
, tasks } _ = do , tasks } _ = do
let sessionProps = RE.pick props :: Record SessionProps let sessionProps = RE.pick props :: Record SessionProps
session' <- R.useContext session session' <- R.useContext session
pure $ authed sessionProps $ pure $ authed sessionProps $ \_ ->
Lists.listsWithForest Lists.listsWithForest
{ forestProps: { backend { forestProps: { backend
, forestOpen , forestOpen
...@@ -253,7 +253,7 @@ graphExplorerCpt = here.component "graphExplorer" cpt where ...@@ -253,7 +253,7 @@ graphExplorerCpt = here.component "graphExplorer" cpt where
, session , session
, tasks } _ = do , 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 }
[ explorerLayoutLoader { backend [ explorerLayoutLoader { backend
, frontends , frontends
...@@ -273,7 +273,7 @@ routeFileCpt :: R.Component SessionNodeProps ...@@ -273,7 +273,7 @@ routeFileCpt :: R.Component SessionNodeProps
routeFileCpt = here.component "routeFile" cpt where routeFileCpt = here.component "routeFile" cpt where
cpt props@{ nodeId, session, sessionId, boxes, tasks } _ = do cpt props@{ nodeId, session, sessionId, boxes, tasks } _ = do
let sessionProps = RE.pick props :: Record SessionProps let sessionProps = RE.pick props :: Record SessionProps
pure $ authed sessionProps $ pure $ authed sessionProps $ \_ ->
forested { boxes, tasks } [ fileLayout { nodeId, session } ] forested { boxes, tasks } [ fileLayout { nodeId, session } ]
type RouteFrameProps = ( type RouteFrameProps = (
...@@ -288,7 +288,8 @@ routeFrameCpt :: R.Component RouteFrameProps ...@@ -288,7 +288,8 @@ routeFrameCpt :: R.Component RouteFrameProps
routeFrameCpt = here.component "routeFrame" cpt where routeFrameCpt = here.component "routeFrame" cpt where
cpt props@{ nodeId, nodeType, session, sessionId, boxes, tasks } _ = do cpt props@{ nodeId, nodeType, session, sessionId, boxes, tasks } _ = do
let sessionProps = RE.pick props :: Record SessionProps 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 :: R2.Component SessionNodeProps
team = R.createElement teamCpt team = R.createElement teamCpt
...@@ -297,7 +298,8 @@ teamCpt :: R.Component SessionNodeProps ...@@ -297,7 +298,8 @@ teamCpt :: R.Component SessionNodeProps
teamCpt = here.component "team" cpt where teamCpt = here.component "team" cpt where
cpt props@{ nodeId, session, sessionId, boxes, tasks } _ = do cpt props@{ nodeId, session, sessionId, boxes, tasks } _ = do
let sessionProps = RE.pick props :: Record SessionProps 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 :: R2.Component SessionNodeProps
texts = R.createElement textsCpt texts = R.createElement textsCpt
...@@ -319,7 +321,7 @@ textsCpt = here.component "texts" cpt ...@@ -319,7 +321,7 @@ textsCpt = here.component "texts" cpt
, tasks } _ = do , tasks } _ = do
let sessionProps = RE.pick props :: Record SessionProps let sessionProps = RE.pick props :: Record SessionProps
session' <- R.useContext session session' <- R.useContext session
pure $ authed sessionProps $ pure $ authed sessionProps $ \_ ->
Texts.textsWithForest Texts.textsWithForest
{ forestProps: { backend { forestProps: { backend
, forestOpen , forestOpen
...@@ -350,7 +352,7 @@ userCpt = here.component "user" cpt where ...@@ -350,7 +352,7 @@ userCpt = here.component "user" cpt where
session' <- R.useContext session session' <- R.useContext session
R.useEffect' $ do R.useEffect' $ do
log2 "[user] session'" session' log2 "[user] session'" session'
pure $ authed sessionProps $ pure $ authed sessionProps $ \_ ->
forested { boxes, tasks } forested { boxes, tasks }
[ userLayout { frontends [ userLayout { frontends
, nodeId , nodeId
...@@ -371,7 +373,7 @@ contactCpt = here.component "contact" cpt where ...@@ -371,7 +373,7 @@ contactCpt = here.component "contact" cpt where
, boxes: { reloadForest, reloadRoot } } _ = do , boxes: { reloadForest, reloadRoot } } _ = do
let sessionProps = RE.pick props :: Record SessionProps let sessionProps = RE.pick props :: Record SessionProps
let forestedProps = RE.pick props :: Record Props let forestedProps = RE.pick props :: Record Props
pure $ authed sessionProps $ pure $ authed sessionProps $ \_ ->
forested forestedProps forested forestedProps
[ contactLayout { annuaireId, frontends, nodeId, reloadForest, reloadRoot, session, tasks } [] ] [ contactLayout { annuaireId, frontends, nodeId, reloadForest, reloadRoot, session, tasks } [] ]
where frontends = defaultFrontends 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