Commit 257ef76a authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[tree] add "key" prop refresh to corpusLayout

This fixes issue of not refreshing when switching dashboard views
between folders.
parent a9618110
......@@ -58,11 +58,11 @@ appCpt = R.hooksComponent "G.C.App.app" cpt where
Home -> forested $ homeLayout LL_EN
Login -> login { sessions, backends, visible: showLogin }
--Folder sid _ -> withSession sid $ \_ -> forested (folder {})
Folder sid nodeId -> withSession sid $ \session -> forested $ corpusLayout { nodeId, session }
FolderPrivate sid nodeId -> withSession sid $ \session -> forested $ corpusLayout { nodeId, session }
FolderPublic sid nodeId -> withSession sid $ \session -> forested $ corpusLayout { nodeId, session }
FolderShared sid nodeId -> withSession sid $ \session -> forested $ corpusLayout { nodeId, session }
Corpus sid nodeId -> withSession sid $ \session -> forested $ corpusLayout { nodeId, session }
Folder sid nodeId -> withSession sid $ \session -> forested $ corpusLayout { key: show nodeId, nodeId, session }
FolderPrivate sid nodeId -> withSession sid $ \session -> forested $ corpusLayout { key: show nodeId, nodeId, session }
FolderPublic sid nodeId -> withSession sid $ \session -> forested $ corpusLayout { key: show nodeId, nodeId, session }
FolderShared sid nodeId -> withSession sid $ \session -> forested $ corpusLayout { key: show nodeId, nodeId, session }
Corpus sid nodeId -> withSession sid $ \session -> forested $ corpusLayout { key: show nodeId, nodeId, session }
Texts sid nodeId -> withSession sid $ \session -> forested $ textsLayout { nodeId, session, frontends }
Lists sid nodeId -> withSession sid $ \session -> forested $ listsLayout { nodeId, session }
Dashboard sid nodeId -> withSession sid $ \session -> forested $ dashboardLayout { nodeId, session }
......
......@@ -36,10 +36,16 @@ type Props = (
type Reload = R.State Int
corpusLayout :: Record Props -> R.Element
type KeyProps =
(
key :: String
| Props
)
corpusLayout :: Record KeyProps -> R.Element
corpusLayout props = R.createElement corpusLayoutCpt props []
corpusLayoutCpt :: R.Component Props
corpusLayoutCpt :: R.Component KeyProps
corpusLayoutCpt = R.hooksComponent "G.C.N.C.corpusLayout" cpt
where
cpt {nodeId, session} _ = do
......
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