Commit 02c869e6 authored by James Laver's avatar James Laver

nail double /

parent 50dfb748
...@@ -27,7 +27,7 @@ import Web.File.FileList (FileList, item) ...@@ -27,7 +27,7 @@ import Web.File.FileList (FileList, item)
import Web.File.FileReader.Aff (readAsText) import Web.File.FileReader.Aff (readAsText)
import Gargantext.Config.REST (get, put, post, postWwwUrlencoded, delete) import Gargantext.Config.REST (get, put, post, postWwwUrlencoded, delete)
import Gargantext.Ends (Frontends(..), url) 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(..))
...@@ -211,7 +211,7 @@ nodeMainSpan :: (Action -> Aff Unit) ...@@ -211,7 +211,7 @@ nodeMainSpan :: (Action -> Aff Unit)
-> Session -> Session
-> Frontends -> Frontends
-> R.Element -> R.Element
nodeMainSpan d p folderOpen session (Frontends frontends) = R.createElement el p [] nodeMainSpan d p folderOpen session frontends = R.createElement el p []
where where
el = R.hooksComponent "NodeMainSpan" cpt el = R.hooksComponent "NodeMainSpan" cpt
cpt {id, name, nodeType, mCurrentRoute} _ = do cpt {id, name, nodeType, mCurrentRoute} _ = do
...@@ -222,7 +222,7 @@ nodeMainSpan d p folderOpen session (Frontends frontends) = R.createElement el p ...@@ -222,7 +222,7 @@ nodeMainSpan d p folderOpen session (Frontends 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.app (NodePath nodeType (Just id))) , H.a { href: (url frontends (NodePath nodeType (Just id)))
, style: {marginLeft: "22px"} , style: {marginLeft: "22px"}
} }
[ nodeText {isSelected: (mCorpusId mCurrentRoute) == (Just id), name} ] [ nodeText {isSelected: (mCorpusId mCurrentRoute) == (Just id), name} ]
......
...@@ -80,6 +80,12 @@ instance toUrlFrontendAppRoute :: ToUrl Frontend R.AppRoute where ...@@ -80,6 +80,12 @@ instance toUrlFrontendAppRoute :: ToUrl Frontend R.AppRoute where
-- | The currently selected App and Static configurations -- | The currently selected App and Static configurations
newtype Frontends = Frontends { app :: Frontend, static :: Frontend } newtype Frontends = Frontends { app :: Frontend, static :: Frontend }
instance toUrlFrontendsRoutes :: ToUrl Frontends R.AppRoute where
toUrl f r = appUrl f (R.appPath r)
instance toUrlFrontendsNodePath :: ToUrl Frontends NodePath where
toUrl (Frontends {app}) np = frontendUrl app (nodePath np)
-- | Creates an app url from a Frontends and the path as a string -- | Creates an app url from a Frontends and the path as a string
appUrl :: Frontends -> String -> String appUrl :: Frontends -> String -> String
appUrl (Frontends {app}) = frontendUrl app appUrl (Frontends {app}) = frontendUrl app
...@@ -88,9 +94,6 @@ appUrl (Frontends {app}) = frontendUrl app ...@@ -88,9 +94,6 @@ appUrl (Frontends {app}) = frontendUrl app
staticUrl :: Frontends -> String -> String staticUrl :: Frontends -> String -> String
staticUrl (Frontends {static}) = frontendUrl static staticUrl (Frontends {static}) = frontendUrl static
instance toUrlFrontendsRoutes :: ToUrl Frontends R.AppRoute where
toUrl f r = appUrl f (R.appPath r)
sessionPath :: R.SessionRoute -> String sessionPath :: R.SessionRoute -> String
sessionPath (R.Tab t i) = sessionPath (R.NodeAPI Node i) <> "/" <> showTabType' t sessionPath (R.Tab t i) = sessionPath (R.NodeAPI Node i) <> "/" <> showTabType' t
sessionPath (R.Children n o l s i) = root <> "children?type=" <> show n <> offsetUrl o <> limitUrl l <> orderUrl s sessionPath (R.Children n o l s i) = root <> "children?type=" <> show n <> offsetUrl o <> limitUrl l <> orderUrl s
...@@ -141,8 +144,6 @@ sessionPath (R.Chart {chartType, tabType} i) = ...@@ -141,8 +144,6 @@ sessionPath (R.Chart {chartType, tabType} i) =
<> "&listType=GraphTerm" -- <> show listId <> "&listType=GraphTerm" -- <> show listId
-- <> maybe "" (\x -> "&limit=" <> show x) limit -- <> maybe "" (\x -> "&limit=" <> show x) limit
------- misc routing stuff ------- misc routing stuff
limitUrl :: Limit -> String limitUrl :: Limit -> String
......
...@@ -245,7 +245,7 @@ data NodePath = NodePath NodeType (Maybe Id) ...@@ -245,7 +245,7 @@ data NodePath = NodePath NodeType (Maybe Id)
nodePath :: NodePath -> String nodePath :: NodePath -> String
nodePath (NodePath t i) = nodeTypePath t <> "/" <> id nodePath (NodePath t i) = nodeTypePath t <> "/" <> id
where id = maybe "" (\j -> "/" <> show j) i where id = maybe "" show 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