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
6 years ago
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
...
@@ -98,7 +98,7 @@ 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
(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
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 Offset Limit
| Children
NodeType
Offset Limit
| Corpus
| Corpus
| CorpusV3
| CorpusV3
| Dashboard
| Dashboard
...
@@ -136,7 +136,7 @@ instance showApiVersion :: Show ApiVersion where
...
@@ -136,7 +136,7 @@ instance showApiVersion :: Show ApiVersion where
------------------------------------------------------------
------------------------------------------------------------
urlConfig :: NodeType -> Url
urlConfig :: NodeType -> Url
urlConfig Annuaire = show Annuaire
urlConfig Annuaire = show Annuaire
urlConfig
(Children o l) = show (Children o l)
urlConfig
nt@(Children _ _ _) = 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,13 +162,13 @@ instance showNodeType :: Show NodeType where
...
@@ -162,13 +162,13 @@ 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
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 ?
-- | 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 "Annuaire" = Annuaire
readNodeType "Children" = (Children 0 0)
readNodeType "Children" = (Children
Node
0 0)
readNodeType "Dashboard" = Dashboard
readNodeType "Dashboard" = Dashboard
readNodeType "Document" = Url_Document
readNodeType "Document" = Url_Document
readNodeType "Folder" = Folder
readNodeType "Folder" = Folder
...
...
This diff is collapsed.
Click to expand it.
src/Gargantext/Pages/Annuaire.purs
View file @
8f1e6841
module Gargantext.Pages.Annuaire where
module Gargantext.Pages.Annuaire where
import Data.Array (concat)
import Data.Traversable (foldl)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Class (lift)
import Data.Either (Either(..))
import Data.Lens (Lens', lens, (?~))
import Data.Lens (Lens', Prism', lens, prism, (?~))
import Data.Maybe (Maybe(..), maybe)
import Data.Maybe (Maybe(..), maybe)
import React (ReactElement)
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 (a, b, b', br', div, h3, hr, i, input, p, table, tbody, td, text, th, thead, tr)
import React.DOM.Props (_type, className, href, onChange, onClick, scope, selected, value, style)
import React.DOM.Props (className, href, scope, style)
import Effect.Console (log)
import Effect.Aff (Aff)
import Effect.Aff (Aff)
import Thermite (Render, Spec
import Thermite (Render, Spec
, simpleSpec
, simpleSpec
...
@@ -20,7 +16,6 @@ import Gargantext.Prelude
...
@@ -20,7 +16,6 @@ import Gargantext.Prelude
import Gargantext.Config (toUrl, NodeType(..), End(..))
import Gargantext.Config (toUrl, NodeType(..), 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 Gargantext.Utils.DecodeMaybe ((.?|))
import Data.Argonaut (class DecodeJson, decodeJson, (.?))
import Data.Argonaut (class DecodeJson, decodeJson, (.?))
------------------------------------------------------------------------------
------------------------------------------------------------------------------
type State = { info :: Maybe AnnuaireInfo
type State = { info :: Maybe AnnuaireInfo
...
@@ -185,7 +180,7 @@ instance decodeAnnuaireTable :: DecodeJson AnnuaireTable where
...
@@ -185,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 0 10) id
getTable id = get $ toUrl Back (Children
Annuaire
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
...
...
This diff is collapsed.
Click to expand it.
src/Gargantext/Pages/Corpus.purs
View file @
8f1e6841
...
@@ -53,9 +53,9 @@ layout = simpleSpec defaultPerformAction render
...
@@ -53,9 +53,9 @@ layout = simpleSpec defaultPerformAction render
where
where
render :: Render {} {nodeId :: Int} Void
render :: Render {} {nodeId :: Int} Void
render _ {nodeId} _ _ =
render _ {nodeId} _ _ =
[
node
Loader { path: nodeId
[
corpus
Loader { path: nodeId
, component: createClass "Layout" layout' initialState
, component: createClass "Layout" layout' initialState
} ]
} ]
layout' :: Spec State Props Action
layout' :: Spec State Props Action
layout' = noState corpusHeaderSpec
layout' = noState corpusHeaderSpec
...
@@ -99,12 +99,11 @@ corpusHeaderSpec = simpleSpec defaultPerformAction render
...
@@ -99,12 +99,11 @@ corpusHeaderSpec = simpleSpec defaultPerformAction render
------------------------------------------------------------------------
------------------------------------------------------------------------
getNode :: Int -> Aff (NodePoly CorpusInfo)
getCorpus :: Int -> Aff (NodePoly CorpusInfo)
getNode = get <<< toUrl Back Node
getCorpus = get <<< toUrl Back Corpus
-- MOCK getNode = const $ pure corpusInfoDefault
node
LoaderClass :: ReactClass (Loader.Props Int (NodePoly CorpusInfo))
corpus
LoaderClass :: ReactClass (Loader.Props Int (NodePoly CorpusInfo))
nodeLoaderClass = createLoaderClass "NodeLoader" getNode
corpusLoaderClass = createLoaderClass "CorpusLoader" getCorpus
node
Loader :: Loader.Props Int (NodePoly CorpusInfo) -> ReactElement
corpus
Loader :: Loader.Props Int (NodePoly CorpusInfo) -> ReactElement
nodeLoader = React.createLeafElement node
LoaderClass
corpusLoader = React.createLeafElement corpus
LoaderClass
This diff is collapsed.
Click to expand it.
src/Gargantext/Pages/Corpus/Tabs/Documents.purs
View file @
8f1e6841
...
@@ -170,7 +170,7 @@ mock = false
...
@@ -170,7 +170,7 @@ 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 offset limit) nodeId
res <- get $ toUrl Back (Children
Url_Document
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
...
...
This diff is collapsed.
Click to expand it.
src/Gargantext/Pages/Corpus/Tabs/Types.purs
View file @
8f1e6841
module Gargantext.Pages.Corpus.Tabs.Types where
module Gargantext.Pages.Corpus.Tabs.Types where
import Data.Argonaut (class DecodeJson, decodeJson, (.?))
import Data.Argonaut (class DecodeJson, decodeJson, (.?)
, (.??)
)
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..))
--------------------------------------------------------
--------------------------------------------------------
import Gargantext.Prelude
import Gargantext.Prelude
...
@@ -38,7 +38,7 @@ instance decodeCorpusInfo :: DecodeJson CorpusInfo where
...
@@ -38,7 +38,7 @@ instance decodeCorpusInfo :: DecodeJson CorpusInfo where
desc <- obj .? "desc"
desc <- obj .? "desc"
query <- obj .? "query"
query <- obj .? "query"
authors <- obj .? "authors"
authors <- obj .? "authors"
chart <- obj .? "chart"
chart <- obj .?
?
"chart"
let totalRecords = 47361 -- TODO
let totalRecords = 47361 -- TODO
pure $ CorpusInfo {title, desc, query, authors, chart, totalRecords}
pure $ CorpusInfo {title, desc, query, authors, chart, totalRecords}
...
...
This diff is collapsed.
Click to expand it.
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