Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Grégoire Locqueville
purescript-gargantext
Commits
9e9f2004
Commit
9e9f2004
authored
Jul 08, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] defaultList if listId == 0
parent
44921ede
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
11 deletions
+19
-11
Ends.purs
src/Gargantext/Ends.purs
+19
-11
No files found.
src/Gargantext/Ends.purs
View file @
9e9f2004
...
@@ -10,7 +10,7 @@ import Data.Generic.Rep.Eq (genericEq)
...
@@ -10,7 +10,7 @@ import Data.Generic.Rep.Eq (genericEq)
import Data.Maybe (Maybe(..), maybe, fromMaybe)
import Data.Maybe (Maybe(..), maybe, fromMaybe)
import Gargantext.Routes as R
import Gargantext.Routes as R
import Gargantext.Types (ApiVersion, ChartType(..), Limit, NodePath, NodeType(..), Offset, TabType(..), TermSize(..), nodePath, nodeTypePath, showTabType', TermList(MapTerm))
import Gargantext.Types (ApiVersion, ChartType(..), Limit, NodePath, NodeType(..), Offset, TabType(..), TermSize(..), nodePath, nodeTypePath, showTabType', TermList(MapTerm))
import
Prelude (class Eq, class Show, identity, show, ($), (<>), bind, pure, (<<<), (=
=))
import
Gargantext.Prelude (class Eq, class Show, identity, show, ($), (<>), bind, pure, (<<<), (==), (/
=))
-- | A means of generating a url to visit, a destination
-- | A means of generating a url to visit, a destination
class ToUrl conf p where
class ToUrl conf p where
...
@@ -117,13 +117,13 @@ sessionPath :: R.SessionRoute -> String
...
@@ -117,13 +117,13 @@ 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) = sessionPath (R.NodeAPI Node i ("children?type=" <> show n <> offsetUrl o <> limitUrl l <> orderUrl s))
sessionPath (R.Children n o l s i) = sessionPath (R.NodeAPI Node i ("children?type=" <> show n <> offsetUrl o <> limitUrl l <> orderUrl s))
sessionPath (R.NodeAPI Phylo pId p) = "phyloscape?nodeId=" <> (show $ fromMaybe 0 pId) <> p
sessionPath (R.NodeAPI Phylo pId p) = "phyloscape?nodeId=" <> (show $ fromMaybe 0 pId) <> p
sessionPath (R.RecomputeNgrams nt nId lId) = "node/" <> (show nId) <> "/ngrams/recompute?
list=" <> (show
lId) <> "&ngramsType=" <> (show nt)
sessionPath (R.RecomputeNgrams nt nId lId) = "node/" <> (show nId) <> "/ngrams/recompute?
" <> (defaultList
lId) <> "&ngramsType=" <> (show nt)
sessionPath (R.RecomputeListChart ChartBar nt nId lId)
= "node/" <> (show nId) <> "/pie?list=" <> (show
lId) <> "&ngramsType=" <> (show nt)
sessionPath (R.RecomputeListChart ChartBar nt nId lId)
= "node/" <> (show nId) <> "/pie?" <> (defaultList
lId) <> "&ngramsType=" <> (show nt)
sessionPath (R.RecomputeListChart ChartPie nt nId lId)
= "node/" <> (show nId) <> "/pie?list=" <> (show
lId) <> "&ngramsType=" <> (show nt)
sessionPath (R.RecomputeListChart ChartPie nt nId lId)
= "node/" <> (show nId) <> "/pie?" <> (defaultList
lId) <> "&ngramsType=" <> (show nt)
sessionPath (R.RecomputeListChart ChartTree nt nId lId)
= "node/" <> (show nId) <> "/tree?list=" <> (show
lId) <> "&ngramsType=" <> (show nt) <> "&listType=" <> show MapTerm
sessionPath (R.RecomputeListChart ChartTree nt nId lId)
= "node/" <> (show nId) <> "/tree?" <> (defaultList
lId) <> "&ngramsType=" <> (show nt) <> "&listType=" <> show MapTerm
sessionPath (R.RecomputeListChart Histo nt nId lId) = "node/" <> (show nId) <> "/chart?
list=" <> (show
lId) <> "&ngramsType=" <> (show nt)
sessionPath (R.RecomputeListChart Histo nt nId lId) = "node/" <> (show nId) <> "/chart?
" <> (defaultList
lId) <> "&ngramsType=" <> (show nt)
sessionPath (R.RecomputeListChart Scatter nt nId lId)
= "node/" <> (show nId) <> "/metrics?list=" <> (show
lId) <> "&ngramsType=" <> (show nt)
sessionPath (R.RecomputeListChart Scatter nt nId lId)
= "node/" <> (show nId) <> "/metrics?" <> (defaultList
lId) <> "&ngramsType=" <> (show nt)
sessionPath (R.RecomputeListChart _ nt nId lId)
= "node/" <> (show nId) <> "/recompute-chart?list=" <> (show
lId) <> "&ngramsType=" <> (show nt)
sessionPath (R.RecomputeListChart _ nt nId lId)
= "node/" <> (show nId) <> "/recompute-chart?" <> (defaultList
lId) <> "&ngramsType=" <> (show nt)
sessionPath (R.GraphAPI gId p) = "graph/" <> (show gId) <> "/" <> p
sessionPath (R.GraphAPI gId p) = "graph/" <> (show gId) <> "/" <> p
sessionPath (R.GetNgrams opts i) =
sessionPath (R.GetNgrams opts i) =
base opts.tabType
base opts.tabType
...
@@ -132,7 +132,7 @@ sessionPath (R.GetNgrams opts i) =
...
@@ -132,7 +132,7 @@ sessionPath (R.GetNgrams opts i) =
<> limitUrl opts.limit
<> limitUrl opts.limit
<> offset opts.offset
<> offset opts.offset
<> orderByUrl opts.orderBy
<> orderByUrl opts.orderBy
<> foldMap (\x ->
"&list=" <> show x
) opts.listIds
<> foldMap (\x ->
if x /= 0 then "&list=" <> show x else ""
) opts.listIds
<> foldMap (\x -> "&listType=" <> show x) opts.termListFilter
<> foldMap (\x -> "&listType=" <> show x) opts.termListFilter
<> foldMap termSizeFilter opts.termSizeFilter
<> foldMap termSizeFilter opts.termSizeFilter
<> search opts.searchQuery
<> search opts.searchQuery
...
@@ -202,7 +202,7 @@ sessionPath (R.Chart {chartType, listId, limit, tabType} i) =
...
@@ -202,7 +202,7 @@ sessionPath (R.Chart {chartType, listId, limit, tabType} i) =
$ show chartType
$ show chartType
<> "?ngramsType=" <> showTabType' tabType
<> "?ngramsType=" <> showTabType' tabType
<> "&listType=" <> show MapTerm -- listId
<> "&listType=" <> show MapTerm -- listId
<>
"&list=" <> show
listId
<>
defaultListAdd
listId
where
where
limitPath = case limit of
limitPath = case limit of
Just li -> "&limit=" <> show li
Just li -> "&limit=" <> show li
...
@@ -213,11 +213,19 @@ sessionPath (R.ChartMD5 { chartType, listId, tabType } i) =
...
@@ -213,11 +213,19 @@ sessionPath (R.ChartMD5 { chartType, listId, tabType } i) =
$ show chartType
$ show chartType
<> "/md5?ngramsType=" <> showTabType' tabType
<> "/md5?ngramsType=" <> showTabType' tabType
<> "&listType=" <> show MapTerm-- <> show listId
<> "&listType=" <> show MapTerm-- <> show listId
<>
"&list=" <> show
listId
<>
defaultListAdd
listId
-- sessionPath (R.NodeAPI (NodeContact s a i) i) = sessionPath $ "annuaire/" <> show a <> "/contact/" <> show i
-- sessionPath (R.NodeAPI (NodeContact s a i) i) = sessionPath $ "annuaire/" <> show a <> "/contact/" <> show i
------- misc routing stuff
------- misc routing stuff
defaultList :: Int -> String
defaultList n = if n == 0 then "" else ("list=" <> show n)
defaultListAdd :: Int -> String
defaultListAdd n = "&" <> defaultList n
limitUrl :: Limit -> String
limitUrl :: Limit -> String
limitUrl l = "&limit=" <> show l
limitUrl l = "&limit=" <> show l
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment