Commit 514025ca authored by Karen Konou's avatar Karen Konou

Folder View: add back button to most nodes

parent 8543cfe2
...@@ -102,5 +102,14 @@ folderCpt = here.component "folderCpt" cpt where ...@@ -102,5 +102,14 @@ folderCpt = here.component "folderCpt" cpt where
getFolderPath :: NodeType -> SessionId -> Int -> String getFolderPath :: NodeType -> SessionId -> Int -> String
getFolderPath nodeType sid nodeId = appPath $ fromMaybe Home $ nodeTypeAppRoute nodeType sid nodeId getFolderPath nodeType sid nodeId = appPath $ fromMaybe Home $ nodeTypeAppRoute nodeType sid nodeId
backButton :: R.Element
backButton =
H.button {
className: "btn btn-primary"
, on: {click: back}
} [
H.i { className: "fa fa-arrow-left"} []
]
loadFolders :: Record Props -> Aff FTree loadFolders :: Record Props -> Aff FTree
loadFolders {nodeId, session} = get session $ TreeFirstLevel (Just nodeId) "" loadFolders {nodeId, session} = get session $ TreeFirstLevel (Just nodeId) ""
...@@ -13,6 +13,7 @@ import Reactix.DOM.HTML as H ...@@ -13,6 +13,7 @@ import Reactix.DOM.HTML as H
import Toestand as T import Toestand as T
import Gargantext.Components.Node (NodePoly(..)) import Gargantext.Components.Node (NodePoly(..))
import Gargantext.Components.FolderView as FV
import Gargantext.Hooks.Loader (useLoader) import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Prelude import Gargantext.Prelude
import Gargantext.Routes (SessionRoute(NodeAPI)) import Gargantext.Routes (SessionRoute(NodeAPI))
...@@ -104,13 +105,16 @@ frameLayoutViewCpt = here.component "frameLayoutView" cpt ...@@ -104,13 +105,16 @@ frameLayoutViewCpt = here.component "frameLayoutView" cpt
, nodeType , nodeType
, reload , reload
, session } _ = , session } _ =
pure $ H.div { className : "frame" pure $ H.div{} [
, rows: "100%,*" } FV.backButton
[ H.iframe { src: hframeUrl nodeType base frame_id , H.div { className : "frame"
, width: "100%" , rows: "100%,*" }
, height: "100%" [ H.iframe { src: hframeUrl nodeType base frame_id
} [] , width: "100%"
] , height: "100%"
} []
]
]
type LoadProps = ( nodeId :: Int type LoadProps = ( nodeId :: Int
, session :: Session ) , session :: Session )
......
...@@ -10,6 +10,7 @@ import Toestand as T ...@@ -10,6 +10,7 @@ import Toestand as T
import Gargantext.Prelude import Gargantext.Prelude
import Gargantext.Components.FolderView as FV
import Gargantext.Components.Table.Types (ColumnName, OrderBy, OrderByDirection(..), Params, Props, TableContainerProps, columnName) import Gargantext.Components.Table.Types (ColumnName, OrderBy, OrderByDirection(..), Params, Props, TableContainerProps, columnName)
import Gargantext.Components.Nodes.Lists.Types as NT import Gargantext.Components.Nodes.Lists.Types as NT
import Gargantext.Components.Search (SearchType(..)) import Gargantext.Components.Search (SearchType(..))
...@@ -63,7 +64,9 @@ tableHeaderLayoutCpt = here.component "tableHeaderLayout" cpt ...@@ -63,7 +64,9 @@ tableHeaderLayoutCpt = here.component "tableHeaderLayout" cpt
cacheState' <- T.useLive T.unequal cacheState cacheState' <- T.useLive T.unequal cacheState
pure $ R.fragment pure $ R.fragment
[ R2.row [ R2.row [FV.backButton]
,
R2.row
[ H.div {className: "col-md-3"} [ H.h3 {} [H.text title] ] [ H.div {className: "col-md-3"} [ H.h3 {} [H.text title] ]
, H.div {className: "col-md-9"} , H.div {className: "col-md-9"}
[ H.hr {style: {height: "2px", backgroundColor: "black"}} ] [ H.hr {style: {height: "2px", backgroundColor: "black"}} ]
......
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