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
131
Issues
131
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
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
gargantext
purescript-gargantext
Commits
8f1e6841
Unverified
Commit
8f1e6841
authored
Oct 18, 2018
by
Nicolas Pouillard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix corpusLoader, add node type to Children, .?? chart, warning free build
parent
04c93526
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
27 deletions
+21
-27
Config.purs
src/Gargantext/Config.purs
+5
-5
Annuaire.purs
src/Gargantext/Pages/Annuaire.purs
+4
-9
Corpus.purs
src/Gargantext/Pages/Corpus.purs
+9
-10
Documents.purs
src/Gargantext/Pages/Corpus/Tabs/Documents.purs
+1
-1
Types.purs
src/Gargantext/Pages/Corpus/Tabs/Types.purs
+2
-2
No files found.
src/Gargantext/Config.purs
View file @
8f1e6841
...
...
@@ -98,7 +98,7 @@ endPathUrl Back c nt i = pathUrl c.back nt i
endPathUrl Front c nt i = pathUrl c.front nt i
pathUrl :: Config -> NodeType -> Id -> UrlPath
pathUrl c
(Children o l) i = pathUrl c Node i <> "/" <> show (Children o l)
pathUrl c
nt@(Children _ _ _) i = pathUrl c Node i <> "/" <> show nt
pathUrl c nt i = c.prePath <> urlConfig nt <> "/" <> show i
------------------------------------------------------------
toUrl :: End -> NodeType -> Id -> Url
...
...
@@ -110,7 +110,7 @@ toUrl e nt i = doUrl base path params
------------------------------------------------------------
data NodeType = NodeUser
| Annuaire
| Children Offset Limit
| Children
NodeType
Offset Limit
| Corpus
| CorpusV3
| Dashboard
...
...
@@ -136,7 +136,7 @@ instance showApiVersion :: Show ApiVersion where
------------------------------------------------------------
urlConfig :: NodeType -> Url
urlConfig Annuaire = show Annuaire
urlConfig
(Children o l) = show (Children o l)
urlConfig
nt@(Children _ _ _) = show nt
urlConfig Corpus = show Corpus
urlConfig CorpusV3 = show CorpusV3
urlConfig Dashboard = show Dashboard
...
...
@@ -162,13 +162,13 @@ instance showNodeType :: Show NodeType where
show Node = "node"
show NodeUser = "user"
show Tree = "tree"
show (Children
o l) = "children?
offset=" <> show o <> "&limit=" <> show l
show (Children
t o l) = "children?type=" <> show t <> "&
offset=" <> show o <> "&limit=" <> show l
-- | TODO : where is the Read Class ?
-- instance readNodeType :: Read NodeType where
readNodeType :: String -> NodeType
readNodeType "Annuaire" = Annuaire
readNodeType "Children" = (Children 0 0)
readNodeType "Children" = (Children
Node
0 0)
readNodeType "Dashboard" = Dashboard
readNodeType "Document" = Url_Document
readNodeType "Folder" = Folder
...
...
src/Gargantext/Pages/Annuaire.purs
View file @
8f1e6841
module Gargantext.Pages.Annuaire where
import Data.Array (concat)
import Data.Traversable (foldl)
import Control.Monad.Trans.Class (lift)
import Data.Either (Either(..))
import Data.Lens (Lens', Prism', lens, prism, (?~))
import Data.Lens (Lens', lens, (?~))
import Data.Maybe (Maybe(..), maybe)
import React (ReactElement)
import React.DOM (div, h1, h3, hr, i, p, text, thead, tbody, input, br', b, b', tr, th, table, td, a)
import React.DOM.Props (_type, className, href, onChange, onClick, scope, selected, value, style)
import Effect.Console (log)
import React.DOM (a, b, b', br', div, h3, hr, i, input, p, table, tbody, td, text, th, thead, tr)
import React.DOM.Props (className, href, scope, style)
import Effect.Aff (Aff)
import Thermite (Render, Spec
, simpleSpec
...
...
@@ -20,7 +16,6 @@ import Gargantext.Prelude
import Gargantext.Config (toUrl, NodeType(..), End(..))
import Gargantext.Config.REST (get)
import Gargantext.Pages.Annuaire.User.Users.Types.Types (User(..), HyperData(..))
import Gargantext.Utils.DecodeMaybe ((.?|))
import Data.Argonaut (class DecodeJson, decodeJson, (.?))
------------------------------------------------------------------------------
type State = { info :: Maybe AnnuaireInfo
...
...
@@ -185,7 +180,7 @@ instance decodeAnnuaireTable :: DecodeJson AnnuaireTable where
pure $ AnnuaireTable { annuaireTable : rows}
------------------------------------------------------------------------
getTable :: Int -> Aff AnnuaireTable
getTable id = get $ toUrl Back (Children 0 10) id
getTable id = get $ toUrl Back (Children
Annuaire
0 10) id
getInfo :: Int -> Aff AnnuaireInfo
getInfo id = get $ toUrl Back Node id
...
...
src/Gargantext/Pages/Corpus.purs
View file @
8f1e6841
...
...
@@ -53,9 +53,9 @@ layout = simpleSpec defaultPerformAction render
where
render :: Render {} {nodeId :: Int} Void
render _ {nodeId} _ _ =
[
node
Loader { path: nodeId
, component: createClass "Layout" layout' initialState
} ]
[
corpus
Loader { path: nodeId
, component: createClass "Layout" layout' initialState
} ]
layout' :: Spec State Props Action
layout' = noState corpusHeaderSpec
...
...
@@ -99,12 +99,11 @@ corpusHeaderSpec = simpleSpec defaultPerformAction render
------------------------------------------------------------------------
getNode :: Int -> Aff (NodePoly CorpusInfo)
getNode = get <<< toUrl Back Node
-- MOCK getNode = const $ pure corpusInfoDefault
getCorpus :: Int -> Aff (NodePoly CorpusInfo)
getCorpus = get <<< toUrl Back Corpus
node
LoaderClass :: ReactClass (Loader.Props Int (NodePoly CorpusInfo))
nodeLoaderClass = createLoaderClass "NodeLoader" getNode
corpus
LoaderClass :: ReactClass (Loader.Props Int (NodePoly CorpusInfo))
corpusLoaderClass = createLoaderClass "CorpusLoader" getCorpus
node
Loader :: Loader.Props Int (NodePoly CorpusInfo) -> ReactElement
nodeLoader = React.createLeafElement node
LoaderClass
corpus
Loader :: Loader.Props Int (NodePoly CorpusInfo) -> ReactElement
corpusLoader = React.createLeafElement corpus
LoaderClass
src/Gargantext/Pages/Corpus/Tabs/Documents.purs
View file @
8f1e6841
...
...
@@ -170,7 +170,7 @@ mock = false
loadPage :: {nodeId :: Int, limit :: Int, offset :: Int} -> Aff (Array DocumentsView)
loadPage {nodeId, limit, offset} = do
logs "loading documents page: loadPage with Offset and limit"
res <- get $ toUrl Back (Children offset limit) nodeId
res <- get $ toUrl Back (Children
Url_Document
offset limit) nodeId
let docs = res2corpus <$> res
_ <- logs "Ok: loading page documents"
_ <- logs $ map show docs
...
...
src/Gargantext/Pages/Corpus/Tabs/Types.purs
View file @
8f1e6841
module Gargantext.Pages.Corpus.Tabs.Types where
import Data.Argonaut (class DecodeJson, decodeJson, (.?))
import Data.Argonaut (class DecodeJson, decodeJson, (.?)
, (.??)
)
import Data.Maybe (Maybe(..))
--------------------------------------------------------
import Gargantext.Prelude
...
...
@@ -38,7 +38,7 @@ instance decodeCorpusInfo :: DecodeJson CorpusInfo where
desc <- obj .? "desc"
query <- obj .? "query"
authors <- obj .? "authors"
chart <- obj .? "chart"
chart <- obj .?
?
"chart"
let totalRecords = 47361 -- TODO
pure $ CorpusInfo {title, desc, query, authors, chart, totalRecords}
...
...
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