Commit 7016c787 authored by James Laver's avatar James Laver

fix links in tree

parent 00acf894
...@@ -26,7 +26,7 @@ import Gargantext.Hooks.Loader (useLoader) ...@@ -26,7 +26,7 @@ import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Components.Search.Types (Category(..), CategoryQuery(..), favCategory, decodeCategory, putCategories) import Gargantext.Components.Search.Types (Category(..), CategoryQuery(..), favCategory, decodeCategory, putCategories)
import Gargantext.Components.Table as T import Gargantext.Components.Table as T
import Gargantext.Routes (SessionRoute(Search,NodeAPI)) import Gargantext.Routes (SessionRoute(Search,NodeAPI))
import Gargantext.Sessions (Session) import Gargantext.Sessions (Session, sessionId)
import Gargantext.Types (NodeType(..), OrderBy(..), NodePath(..)) import Gargantext.Types (NodeType(..), OrderBy(..), NodePath(..))
import Gargantext.Utils (toggleSet) import Gargantext.Utils (toggleSet)
import Gargantext.Utils.DecodeMaybe ((.|)) import Gargantext.Utils.DecodeMaybe ((.|))
...@@ -289,7 +289,7 @@ pageCpt = R.staticComponent "G.C.FacetsTable.Page" cpt ...@@ -289,7 +289,7 @@ pageCpt = R.staticComponent "G.C.FacetsTable.Page" cpt
isDeleted (DocumentsView {id}) = Set.member id (fst deletions).deleted isDeleted (DocumentsView {id}) = Set.member id (fst deletions).deleted
pairUrl (Pair {id,label}) pairUrl (Pair {id,label})
| id > 1 = H.a { href, target: "blank" } [ H.text label ] | id > 1 = H.a { href, target: "blank" } [ H.text label ]
where href = url session $ NodePath NodeContact (Just id) where href = url session $ NodePath (sessionId session) NodeContact (Just id)
| otherwise = H.text label | otherwise = H.text label
comma = H.span {} [ H.text ", " ] comma = H.span {} [ H.text ", " ]
rows = row <$> filter (not <<< isDeleted) documents rows = row <$> filter (not <<< isDeleted) documents
......
...@@ -31,7 +31,7 @@ import Gargantext.Ends (Frontends, url) ...@@ -31,7 +31,7 @@ import Gargantext.Ends (Frontends, url)
import Gargantext.Hooks.Loader (useLoader) import Gargantext.Hooks.Loader (useLoader)
import Gargantext.Routes as Routes import Gargantext.Routes as Routes
import Gargantext.Routes (AppRoute, SessionRoute(..)) import Gargantext.Routes (AppRoute, SessionRoute(..))
import Gargantext.Sessions (Session) import Gargantext.Sessions (Session, sessionId)
import Gargantext.Types (class ToQuery, toQuery, NodeType(..), NodePath(..), readNodeType) import Gargantext.Types (class ToQuery, toQuery, NodeType(..), NodePath(..), readNodeType)
import Gargantext.Utils (id) import Gargantext.Utils (id)
import Gargantext.Utils.Reactix as R2 import Gargantext.Utils.Reactix as R2
...@@ -228,7 +228,7 @@ nodeMainSpan d p folderOpen session frontends = R.createElement el p [] ...@@ -228,7 +228,7 @@ nodeMainSpan d p folderOpen session frontends = R.createElement el p []
pure $ H.span (dropProps droppedFile isDragOver) pure $ H.span (dropProps droppedFile isDragOver)
[ folderIcon folderOpen [ folderIcon folderOpen
, H.a { href: (url frontends (NodePath nodeType (Just id))) , H.a { href: (url frontends (NodePath (sessionId session) nodeType (Just id)))
, style: {marginLeft: "22px"} , style: {marginLeft: "22px"}
} }
[ nodeText {isSelected: (mCorpusId mCurrentRoute) == (Just id), name:name'} ] [ nodeText {isSelected: (mCorpusId mCurrentRoute) == (Just id), name:name'} ]
......
...@@ -9,7 +9,7 @@ import Effect.Aff (Aff) ...@@ -9,7 +9,7 @@ import Effect.Aff (Aff)
import Gargantext.Components.Table as T import Gargantext.Components.Table as T
import Gargantext.Ends (url) import Gargantext.Ends (url)
import Gargantext.Routes (SessionRoute(..)) import Gargantext.Routes (SessionRoute(..))
import Gargantext.Sessions (Session) import Gargantext.Sessions (Session, sessionId)
import Gargantext.Types (NodePath(..), NodeType(..)) import Gargantext.Types (NodePath(..), NodeType(..))
import Gargantext.Config.REST (get) import Gargantext.Config.REST (get)
import Gargantext.Hooks.Loader (useLoader) import Gargantext.Hooks.Loader (useLoader)
...@@ -113,7 +113,7 @@ contactCells :: Session -> Maybe Contact -> Array R.Element ...@@ -113,7 +113,7 @@ contactCells :: Session -> Maybe Contact -> Array R.Element
contactCells session = maybe [] render contactCells session = maybe [] render
where where
render (Contact { id, hyperdata : (HyperdataContact contact@{who: who, ou:ou} ) }) = render (Contact { id, hyperdata : (HyperdataContact contact@{who: who, ou:ou} ) }) =
let nodepath = NodePath NodeContact (Just id) let nodepath = NodePath (sessionId session) NodeContact (Just id)
href = url session nodepath in href = url session nodepath in
[ H.text "" [ H.text ""
, H.a { href, target: "blank" } [ H.text $ maybe "name" identity contact.title ] , H.a { href, target: "blank" } [ H.text $ maybe "name" identity contact.title ]
......
...@@ -252,10 +252,10 @@ type ChartOpts = ...@@ -252,10 +252,10 @@ type ChartOpts =
-- , limit :: Maybe Limit -- , limit :: Maybe Limit
} }
data NodePath = NodePath NodeType (Maybe Id) data NodePath = NodePath SessionId NodeType (Maybe Id)
nodePath :: NodePath -> String nodePath :: NodePath -> String
nodePath (NodePath t i) = nodeTypePath t <> id nodePath (NodePath s t i) = nodeTypePath t <> "/" <> show s <> id
where id = maybe "" (\j -> "/" <> show j) i where id = maybe "" (\j -> "/" <> show j) i
data ChartType = Histo | Scatter | ChartPie | ChartTree data ChartType = Histo | Scatter | ChartPie | ChartTree
......
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