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
6d590bf1
Commit
6d590bf1
authored
Oct 19, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] routes for table.
parent
97fcab0f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
600 additions
and
14 deletions
+600
-14
Config.purs
src/Gargantext/Config.purs
+20
-10
Annuaire.purs
src/Gargantext/Pages/Annuaire.purs
+2
-2
Documents.purs
src/Gargantext/Pages/Corpus/Tabs/Documents.purs
+3
-2
yarn.lock
yarn.lock
+575
-0
No files found.
src/Gargantext/Config.purs
View file @
6d590bf1
...
@@ -94,11 +94,11 @@ baseUrl :: Config -> UrlBase
...
@@ -94,11 +94,11 @@ baseUrl :: Config -> UrlBase
baseUrl conf = conf.proto <> conf.domain <> ":" <> show conf.port
baseUrl conf = conf.proto <> conf.domain <> ":" <> show conf.port
------------------------------------------------------------
------------------------------------------------------------
endPathUrl :: End -> EndConfig -> NodeType -> Id -> UrlPath
endPathUrl :: End -> EndConfig -> NodeType -> Id -> UrlPath
endPathUrl Back c nt i = pathUrl c.back nt i
endPathUrl Back c nt i = pathUrl c.back
nt i
endPathUrl Front c nt i = pathUrl c.front nt i
endPathUrl Front c nt i = pathUrl c.front nt i
pathUrl :: Config -> NodeType -> Id -> UrlPath
pathUrl :: Config -> NodeType -> Id -> UrlPath
pathUrl c nt@(
Children
_ _ _) i = pathUrl c Node i <> "/" <> show nt
pathUrl c nt@(
Tab
_ _ _) i = pathUrl c Node i <> "/" <> show nt
pathUrl c nt i = c.prePath <> urlConfig nt <> "/" <> show i
pathUrl c nt i = c.prePath <> urlConfig nt <> "/" <> show i
------------------------------------------------------------
------------------------------------------------------------
toUrl :: End -> NodeType -> Id -> Url
toUrl :: End -> NodeType -> Id -> Url
...
@@ -110,7 +110,7 @@ toUrl e nt i = doUrl base path params
...
@@ -110,7 +110,7 @@ toUrl e nt i = doUrl base path params
------------------------------------------------------------
------------------------------------------------------------
data NodeType = NodeUser
data NodeType = NodeUser
| Annuaire
| Annuaire
|
Children Node
Type Offset Limit
|
Tab Tab
Type Offset Limit
| Corpus
| Corpus
| CorpusV3
| CorpusV3
| Dashboard
| Dashboard
...
@@ -133,10 +133,20 @@ instance showApiVersion :: Show ApiVersion where
...
@@ -133,10 +133,20 @@ instance showApiVersion :: Show ApiVersion where
show V10 = "v1.0"
show V10 = "v1.0"
show V11 = "v1.1"
show V11 = "v1.1"
------------------------------------------------------------
------------------------------------------------------------
data TabType = TabDocs | TabTerms | TabSources | TabAuthors | TabTrash
instance showTabType :: Show TabType where
show TabDocs = "Docs"
show TabTerms = "Terms"
show TabSources = "Sources"
show TabAuthors = "Authors"
show TabTrash = "Trash"
------------------------------------------------------------
------------------------------------------------------------
urlConfig :: NodeType -> Url
urlConfig :: NodeType -> Url
urlConfig Annuaire = show Annuaire
urlConfig Annuaire = show Annuaire
urlConfig nt@(
Children
_ _ _) = show nt
urlConfig nt@(
Tab
_ _ _) = show nt
urlConfig Corpus = show Corpus
urlConfig Corpus = show Corpus
urlConfig CorpusV3 = show CorpusV3
urlConfig CorpusV3 = show CorpusV3
urlConfig Dashboard = show Dashboard
urlConfig Dashboard = show Dashboard
...
@@ -162,17 +172,17 @@ instance showNodeType :: Show NodeType where
...
@@ -162,17 +172,17 @@ instance showNodeType :: Show NodeType where
show Node = "node"
show Node = "node"
show NodeUser = "user"
show NodeUser = "user"
show Tree = "tree"
show Tree = "tree"
show (
Children t o l) = "children?type=" <> show t <> "&offset=" <> show o <> "&limit=" <> show l
show (
Tab t o l) = "table?view=" <> show t <> "&offset=" <> show o <> "&limit=" <> show l <> "&order=DateAsc"
-- | TODO : where is the Read Class ?
-- | TODO : where is the Read Class ?
-- instance readNodeType :: Read NodeType where
-- instance readNodeType :: Read NodeType where
readNodeType :: String -> NodeType
readNodeType :: String -> NodeType
readNodeType "Annuaire" = Annuaire
readNodeType "
Node
Annuaire" = Annuaire
readNodeType "
Children" = (Children Node
0 0)
readNodeType "
Tab" = (Tab TabDocs
0 0)
readNodeType "Dashboard" = Dashboard
readNodeType "
Node
Dashboard" = Dashboard
readNodeType "Document" = Url_Document
readNodeType "Document" = Url_Document
readNodeType "Folder" = Folder
readNodeType "
Node
Folder" = Folder
readNodeType "Graph" = Graph
readNodeType "
Node
Graph" = Graph
readNodeType "Individu" = Individu
readNodeType "Individu" = Individu
readNodeType "Node" = Node
readNodeType "Node" = Node
readNodeType "NodeCorpus" = Corpus
readNodeType "NodeCorpus" = Corpus
...
...
src/Gargantext/Pages/Annuaire.purs
View file @
6d590bf1
...
@@ -13,7 +13,7 @@ import Thermite (Render, Spec
...
@@ -13,7 +13,7 @@ import Thermite (Render, Spec
------------------------------------------------------------------------------
------------------------------------------------------------------------------
import Gargantext.Prelude
import Gargantext.Prelude
import Gargantext.Config (toUrl, NodeType(..), End(..))
import Gargantext.Config (toUrl, NodeType(..),
TabType(..),
End(..))
import Gargantext.Config.REST (get)
import Gargantext.Config.REST (get)
import Gargantext.Pages.Annuaire.User.Users.Types.Types (User(..), HyperData(..))
import Gargantext.Pages.Annuaire.User.Users.Types.Types (User(..), HyperData(..))
import Data.Argonaut (class DecodeJson, decodeJson, (.?))
import Data.Argonaut (class DecodeJson, decodeJson, (.?))
...
@@ -180,7 +180,7 @@ instance decodeAnnuaireTable :: DecodeJson AnnuaireTable where
...
@@ -180,7 +180,7 @@ instance decodeAnnuaireTable :: DecodeJson AnnuaireTable where
pure $ AnnuaireTable { annuaireTable : rows}
pure $ AnnuaireTable { annuaireTable : rows}
------------------------------------------------------------------------
------------------------------------------------------------------------
getTable :: Int -> Aff AnnuaireTable
getTable :: Int -> Aff AnnuaireTable
getTable id = get $ toUrl Back (
Children Annuaire
0 10) id
getTable id = get $ toUrl Back (
Tab TabDocs
0 10) id
getInfo :: Int -> Aff AnnuaireInfo
getInfo :: Int -> Aff AnnuaireInfo
getInfo id = get $ toUrl Back Node id
getInfo id = get $ toUrl Back Node id
...
...
src/Gargantext/Pages/Corpus/Tabs/Documents.purs
View file @
6d590bf1
...
@@ -13,7 +13,7 @@ import React.DOM.Props (_type, className, href)
...
@@ -13,7 +13,7 @@ import React.DOM.Props (_type, className, href)
import Thermite (Render, Spec, defaultPerformAction, simpleSpec)
import Thermite (Render, Spec, defaultPerformAction, simpleSpec)
------------------------------------------------------------------------
------------------------------------------------------------------------
import Gargantext.Prelude
import Gargantext.Prelude
import Gargantext.Config (NodeType(..), toUrl, End(..))
import Gargantext.Config (NodeType(..),
TabType(..),
toUrl, End(..))
import Gargantext.Config.REST (get, post)
import Gargantext.Config.REST (get, post)
import Gargantext.Utils.DecodeMaybe ((.|))
import Gargantext.Utils.DecodeMaybe ((.|))
import Gargantext.Components.Charts.Options.ECharts (chart)
import Gargantext.Components.Charts.Options.ECharts (chart)
...
@@ -170,7 +170,8 @@ mock = false
...
@@ -170,7 +170,8 @@ mock = false
loadPage :: {nodeId :: Int, limit :: Int, offset :: Int} -> Aff (Array DocumentsView)
loadPage :: {nodeId :: Int, limit :: Int, offset :: Int} -> Aff (Array DocumentsView)
loadPage {nodeId, limit, offset} = do
loadPage {nodeId, limit, offset} = do
logs "loading documents page: loadPage with Offset and limit"
logs "loading documents page: loadPage with Offset and limit"
res <- get $ toUrl Back (Children Url_Document offset limit) nodeId
--res <- get $ toUrl Back (Children Url_Document offset limit) nodeId
res <- get $ toUrl Back (Tab TabDocs offset limit ) nodeId
let docs = res2corpus <$> res
let docs = res2corpus <$> res
_ <- logs "Ok: loading page documents"
_ <- logs "Ok: loading page documents"
_ <- logs $ map show docs
_ <- logs $ map show docs
...
...
yarn.lock
View file @
6d590bf1
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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