Commit 5b9aac47 authored by Karen Konou's avatar Karen Konou

Folder view: refactor to fix dependency loop

parent 3799c0ca
...@@ -108,14 +108,5 @@ folderCpt = here.component "folderCpt" cpt where ...@@ -108,14 +108,5 @@ 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) ""
'use strict';
exports.back = function() {
return function() {
history.back();
}
}
\ No newline at end of file
module Gargantext.Components.FolderView.BackButton where
import Gargantext.Prelude (Unit)
import Effect (Effect)
import Reactix as R
import Reactix.DOM.HTML as H
foreign import back :: Effect Unit
backButton :: R.Element
backButton =
H.button {
className: "btn btn-primary"
, on: {click: back}
} [
H.i { className: "fa fa-arrow-left"} []
]
\ No newline at end of file
...@@ -13,7 +13,7 @@ import Reactix.DOM.HTML as H ...@@ -13,7 +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.Components.FolderView.BackButton (backButton)
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))
...@@ -106,7 +106,7 @@ frameLayoutViewCpt = here.component "frameLayoutView" cpt ...@@ -106,7 +106,7 @@ frameLayoutViewCpt = here.component "frameLayoutView" cpt
, reload , reload
, session } _ = , session } _ =
pure $ H.div{} [ pure $ H.div{} [
FV.backButton backButton
, H.div { className : "frame" , H.div { className : "frame"
, rows: "100%,*" } , rows: "100%,*" }
[ H.iframe { src: hframeUrl nodeType base frame_id [ H.iframe { src: hframeUrl nodeType base frame_id
......
module Gargantext.Components.Table where module Gargantext.Components.Table where
import Gargantext.Prelude
import Data.Array as A import Data.Array as A
import Data.Maybe (Maybe(..)) import Data.Maybe (Maybe(..))
import Data.Sequence as Seq import Data.Sequence as Seq
import Effect (Effect) import Effect (Effect)
import Reactix as R import Gargantext.Components.FolderView.BackButton (backButton)
import Reactix.DOM.HTML as H
import Toestand as T
import Gargantext.Prelude
import Gargantext.Components.FolderView as FV
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(..))
import Gargantext.Utils.Reactix as R2 import Gargantext.Components.Table.Types (ColumnName, OrderBy, OrderByDirection(..), Params, Props, TableContainerProps, columnName)
import Gargantext.Utils.Reactix (effectLink) import Gargantext.Utils.Reactix (effectLink)
import Gargantext.Utils.Reactix as R2
import Reactix as R
import Reactix.DOM.HTML as H
import Toestand as T
here :: R2.Here here :: R2.Here
here = R2.here "Gargantext.Components.Table" here = R2.here "Gargantext.Components.Table"
...@@ -64,7 +63,7 @@ tableHeaderLayoutCpt = here.component "tableHeaderLayout" cpt ...@@ -64,7 +63,7 @@ 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 [FV.backButton] [ R2.row [backButton]
, ,
R2.row R2.row
[ H.div {className: "col-md-3"} [ H.h3 {} [H.text title] ] [ H.div {className: "col-md-3"} [ H.h3 {} [H.text title] ]
......
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