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
b7e624dc
Commit
b7e624dc
authored
Sep 30, 2019
by
James Laver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reenable texts page
parent
04fe91cf
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
71 additions
and
66 deletions
+71
-66
Types.purs
src/Gargantext/Components/Login/Types.purs
+3
-3
Core.purs
src/Gargantext/Components/NgramsTable/Core.purs
+5
-5
Config.purs
src/Gargantext/Config.purs
+3
-3
Annuaire.purs
src/Gargantext/Pages/Annuaire.purs
+3
-3
Types.purs
src/Gargantext/Pages/Annuaire/User/Contacts/Types.purs
+28
-28
Document.purs
src/Gargantext/Pages/Corpus/Document.purs
+19
-19
Tabs.purs
src/Gargantext/Pages/Lists/Tabs.purs
+2
-2
Texts.purs
src/Gargantext/Pages/Texts.purs
+6
-1
Tabs.purs
src/Gargantext/Pages/Texts/Tabs.purs
+2
-2
No files found.
src/Gargantext/Components/Login/Types.purs
View file @
b7e624dc
...
@@ -2,7 +2,7 @@ module Gargantext.Components.Login.Types where
...
@@ -2,7 +2,7 @@ module Gargantext.Components.Login.Types where
import Prelude
import Prelude
import Data.Argonaut ( class DecodeJson, class EncodeJson, decodeJson, jsonEmptyObject
import Data.Argonaut ( class DecodeJson, class EncodeJson, decodeJson, jsonEmptyObject
, (.:), (.
:!
), (:=), (~>)
, (.:), (.
??
), (:=), (~>)
)
)
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep.Eq (genericEq)
import Data.Generic.Rep.Eq (genericEq)
...
@@ -52,8 +52,8 @@ instance decodeAuthInvalid :: DecodeJson AuthInvalid where
...
@@ -52,8 +52,8 @@ instance decodeAuthInvalid :: DecodeJson AuthInvalid where
instance decodeAuthResponse :: DecodeJson AuthResponse where
instance decodeAuthResponse :: DecodeJson AuthResponse where
decodeJson json = do
decodeJson json = do
obj <- decodeJson json
obj <- decodeJson json
valid <- obj .
:!
"valid"
valid <- obj .
??
"valid"
inval <- obj .
:!
"inval"
inval <- obj .
??
"inval"
pure $ AuthResponse {valid, inval}
pure $ AuthResponse {valid, inval}
instance decodeAuthData :: DecodeJson AuthData where
instance decodeAuthData :: DecodeJson AuthData where
...
...
src/Gargantext/Components/NgramsTable/Core.purs
View file @
b7e624dc
...
@@ -50,7 +50,7 @@ import Control.Monad.Cont.Trans (lift)
...
@@ -50,7 +50,7 @@ import Control.Monad.Cont.Trans (lift)
import Data.Array (head)
import Data.Array (head)
import Data.Array as A
import Data.Array as A
import Data.Argonaut ( class DecodeJson, decodeJson, class EncodeJson, encodeJson
import Data.Argonaut ( class DecodeJson, decodeJson, class EncodeJson, encodeJson
, jsonEmptyObject, (:=), (~>), (.:), (.
:!
) )
, jsonEmptyObject, (:=), (~>), (.:), (.
??
) )
import Data.Either (Either(..))
import Data.Either (Either(..))
import Data.Foldable (class Foldable, foldMap, foldl, foldr)
import Data.Foldable (class Foldable, foldMap, foldl, foldr)
import Data.FoldableWithIndex (class FoldableWithIndex, foldMapWithIndex, foldlWithIndex, foldrWithIndex)
import Data.FoldableWithIndex (class FoldableWithIndex, foldMapWithIndex, foldlWithIndex, foldrWithIndex)
...
@@ -163,8 +163,8 @@ instance decodeJsonNgramsElement :: DecodeJson NgramsElement where
...
@@ -163,8 +163,8 @@ instance decodeJsonNgramsElement :: DecodeJson NgramsElement where
ngrams <- obj .: "ngrams"
ngrams <- obj .: "ngrams"
list <- obj .: "list"
list <- obj .: "list"
occurrences <- obj .: "occurrences"
occurrences <- obj .: "occurrences"
parent <- obj .
:!
"parent"
parent <- obj .
??
"parent"
root <- obj .
:!
"root"
root <- obj .
??
"root"
children' <- obj .: "children"
children' <- obj .: "children"
let children = Set.fromFoldable (children' :: Array NgramsTerm)
let children = Set.fromFoldable (children' :: Array NgramsTerm)
pure $ NgramsElement {ngrams, list, occurrences, parent, root, children}
pure $ NgramsElement {ngrams, list, occurrences, parent, root, children}
...
@@ -333,8 +333,8 @@ instance encodeJsonReplace :: EncodeJson a => EncodeJson (Replace a) where
...
@@ -333,8 +333,8 @@ instance encodeJsonReplace :: EncodeJson a => EncodeJson (Replace a) where
instance decodeJsonReplace :: (DecodeJson a, Eq a) => DecodeJson (Replace a) where
instance decodeJsonReplace :: (DecodeJson a, Eq a) => DecodeJson (Replace a) where
decodeJson json = do
decodeJson json = do
obj <- decodeJson json
obj <- decodeJson json
mold <- obj .
:!
"old"
mold <- obj .
??
"old"
mnew <- obj .
:!
"new"
mnew <- obj .
??
"new"
case Tuple mold mnew of
case Tuple mold mnew of
Tuple (Just old) (Just new) -> pure $ replace old new
Tuple (Just old) (Just new) -> pure $ replace old new
Tuple Nothing Nothing -> pure Keep
Tuple Nothing Nothing -> pure Keep
...
...
src/Gargantext/Config.purs
View file @
b7e624dc
...
@@ -7,9 +7,9 @@ import Gargantext.Types (ApiVersion(..))
...
@@ -7,9 +7,9 @@ import Gargantext.Types (ApiVersion(..))
defaultBackends :: NonEmpty Array Backend
defaultBackends :: NonEmpty Array Backend
defaultBackends = prod :| [dev, demo, local]
defaultBackends = prod :| [dev, demo, local]
where
where
prod = backend V10 "/api/" "http://gargantext.org" "gargantext.org"
prod = backend V10 "/api/" "http
s
://gargantext.org" "gargantext.org"
dev = backend V10 "/api/" "http://dev.gargantext.org" "dev.gargantext.org"
dev = backend V10 "/api/" "http
s
://dev.gargantext.org" "dev.gargantext.org"
demo = backend V10 "/api/" "http://demo.gargantext.org" "demo.gargantext.org"
demo = backend V10 "/api/" "http
s
://demo.gargantext.org" "demo.gargantext.org"
local = backend V10 "/api/" "http://localhost:8008" "localhost"
local = backend V10 "/api/" "http://localhost:8008" "localhost"
defaultApps :: NonEmpty Array Frontend
defaultApps :: NonEmpty Array Frontend
...
...
src/Gargantext/Pages/Annuaire.purs
View file @
b7e624dc
module Gargantext.Pages.Annuaire where
module Gargantext.Pages.Annuaire where
import Prelude (bind, const, identity, pure, ($), (<$>), (<>))
import Prelude (bind, const, identity, pure, ($), (<$>), (<>))
import Data.Argonaut (class DecodeJson, decodeJson, (.:), (.
:!
))
import Data.Argonaut (class DecodeJson, decodeJson, (.:), (.
??
))
import Data.Array (head)
import Data.Array (head)
import Data.Maybe (Maybe(..), maybe)
import Data.Maybe (Maybe(..), maybe)
import Data.Tuple (fst, snd)
import Data.Tuple (fst, snd)
...
@@ -138,8 +138,8 @@ data HyperdataAnnuaire = HyperdataAnnuaire
...
@@ -138,8 +138,8 @@ data HyperdataAnnuaire = HyperdataAnnuaire
instance decodeHyperdataAnnuaire :: DecodeJson HyperdataAnnuaire where
instance decodeHyperdataAnnuaire :: DecodeJson HyperdataAnnuaire where
decodeJson json = do
decodeJson json = do
obj <- decodeJson json
obj <- decodeJson json
title <- obj .
:!
"title"
title <- obj .
??
"title"
desc <- obj .
:!
"desc"
desc <- obj .
??
"desc"
pure $ HyperdataAnnuaire { title, desc }
pure $ HyperdataAnnuaire { title, desc }
------------------------------------------------------------------------------
------------------------------------------------------------------------------
...
...
src/Gargantext/Pages/Annuaire/User/Contacts/Types.purs
View file @
b7e624dc
...
@@ -2,7 +2,7 @@ module Gargantext.Pages.Annuaire.User.Contacts.Types where
...
@@ -2,7 +2,7 @@ module Gargantext.Pages.Annuaire.User.Contacts.Types where
import Prelude
import Prelude
import Data.Argonaut (class DecodeJson, decodeJson, (.:), (.
:!
))
import Data.Argonaut (class DecodeJson, decodeJson, (.:), (.
??
))
import Data.Maybe (Maybe, fromMaybe)
import Data.Maybe (Maybe, fromMaybe)
import Data.Map (Map)
import Data.Map (Map)
import Gargantext.Utils.DecodeMaybe ((.?|))
import Gargantext.Utils.DecodeMaybe ((.?|))
...
@@ -35,11 +35,11 @@ instance decodeContactWho :: DecodeJson ContactWho
...
@@ -35,11 +35,11 @@ instance decodeContactWho :: DecodeJson ContactWho
where
where
decodeJson json = do
decodeJson json = do
obj <- decodeJson json
obj <- decodeJson json
idWho <- obj .
:!
"id"
idWho <- obj .
??
"id"
firstName <- obj .
:!
"firstName"
firstName <- obj .
??
"firstName"
lastName <- obj .
:!
"lastName"
lastName <- obj .
??
"lastName"
keywords <- obj .
:!
"keywords"
keywords <- obj .
??
"keywords"
freetags <- obj .
:!
"freetags"
freetags <- obj .
??
"freetags"
let k = fromMaybe [] keywords
let k = fromMaybe [] keywords
let f = fromMaybe [] freetags
let f = fromMaybe [] freetags
...
@@ -68,15 +68,15 @@ instance decodeContactWhere :: DecodeJson ContactWhere
...
@@ -68,15 +68,15 @@ instance decodeContactWhere :: DecodeJson ContactWhere
where
where
decodeJson json = do
decodeJson json = do
obj <- decodeJson json
obj <- decodeJson json
organization <- obj .
:!
"organization"
organization <- obj .
??
"organization"
labTeamDepts <- obj .
:!
"labTeamDepts"
labTeamDepts <- obj .
??
"labTeamDepts"
role <- obj .
:!
"role"
role <- obj .
??
"role"
office <- obj .
:!
"office"
office <- obj .
??
"office"
country <- obj .
:!
"country"
country <- obj .
??
"country"
city <- obj .
:!
"city"
city <- obj .
??
"city"
touch <- obj .
:!
"touch"
touch <- obj .
??
"touch"
entry <- obj .
:!
"entry"
entry <- obj .
??
"entry"
exit <- obj .
:!
"exit"
exit <- obj .
??
"exit"
let o = fromMaybe [] organization
let o = fromMaybe [] organization
let l = fromMaybe [] labTeamDepts
let l = fromMaybe [] labTeamDepts
...
@@ -95,9 +95,9 @@ instance decodeContactTouch :: DecodeJson ContactTouch
...
@@ -95,9 +95,9 @@ instance decodeContactTouch :: DecodeJson ContactTouch
where
where
decodeJson json = do
decodeJson json = do
obj <- decodeJson json
obj <- decodeJson json
mail <- obj .
:!
"mail"
mail <- obj .
??
"mail"
phone <- obj .
:!
"phone"
phone <- obj .
??
"phone"
url <- obj .
:!
"url"
url <- obj .
??
"url"
pure $ ContactTouch {mail, phone, url}
pure $ ContactTouch {mail, phone, url}
...
@@ -117,14 +117,14 @@ instance decodeHyperdataContact :: DecodeJson HyperdataContact
...
@@ -117,14 +117,14 @@ instance decodeHyperdataContact :: DecodeJson HyperdataContact
where
where
decodeJson json = do
decodeJson json = do
obj <- decodeJson json
obj <- decodeJson json
bdd <- obj .
:!
"bdd"
bdd <- obj .
??
"bdd"
who <- obj .
:!
"who"
who <- obj .
??
"who"
ou <- obj .
:!
"where"
ou <- obj .
??
"where"
title <- obj .
:!
"title"
title <- obj .
??
"title"
source <- obj .
:!
"source"
source <- obj .
??
"source"
lastValidation <- obj .
:!
"lastValidation"
lastValidation <- obj .
??
"lastValidation"
uniqId <- obj .
:!
"uniqId"
uniqId <- obj .
??
"uniqId"
uniqIdBdd <- obj .
:!
"uniqIdBdd"
uniqIdBdd <- obj .
??
"uniqIdBdd"
let ou' = fromMaybe [] ou
let ou' = fromMaybe [] ou
...
@@ -151,9 +151,9 @@ instance decodeUser :: DecodeJson Contact where
...
@@ -151,9 +151,9 @@ instance decodeUser :: DecodeJson Contact where
obj <- decodeJson json
obj <- decodeJson json
id <- obj .: "id"
id <- obj .: "id"
typename <- obj .?| "typename"
typename <- obj .?| "typename"
userId <- obj .
:!
"userId"
userId <- obj .
??
"userId"
parentId <- obj .?| "parentId"
parentId <- obj .?| "parentId"
name <- obj .
:!
"name"
name <- obj .
??
"name"
date <- obj .?| "date"
date <- obj .?| "date"
hyperdata <- obj .: "hyperdata"
hyperdata <- obj .: "hyperdata"
pure $ Contact { id, typename, userId
pure $ Contact { id, typename, userId
...
...
src/Gargantext/Pages/Corpus/Document.purs
View file @
b7e624dc
module Gargantext.Pages.Corpus.Document where
module Gargantext.Pages.Corpus.Document where
import Prelude (class Show, bind, identity, mempty, pure, ($), (<<<))
import Prelude (class Show, bind, identity, mempty, pure, ($), (<<<))
import Data.Argonaut (class DecodeJson, decodeJson, (.:), (.
:!
))
import Data.Argonaut (class DecodeJson, decodeJson, (.:), (.
??
))
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep.Show (genericShow)
import Data.Generic.Rep.Show (genericShow)
import Data.Maybe (Maybe(..), maybe)
import Data.Maybe (Maybe(..), maybe)
...
@@ -203,7 +203,7 @@ instance decodeDocumentV3 :: DecodeJson DocumentV3
...
@@ -203,7 +203,7 @@ instance decodeDocumentV3 :: DecodeJson DocumentV3
where
where
decodeJson json = do
decodeJson json = do
obj <- decodeJson json
obj <- decodeJson json
abstract <- obj .
:!
"abstract"
abstract <- obj .
??
"abstract"
authors <- obj .: "authors"
authors <- obj .: "authors"
--error <- obj .: "error"
--error <- obj .: "error"
language_iso2 <- obj .: "language_iso2"
language_iso2 <- obj .: "language_iso2"
...
@@ -243,23 +243,23 @@ instance decodeDocument :: DecodeJson Document
...
@@ -243,23 +243,23 @@ instance decodeDocument :: DecodeJson Document
where
where
decodeJson json = do
decodeJson json = do
obj <- decodeJson json
obj <- decodeJson json
abstract <- obj .
:!
"abstract"
abstract <- obj .
??
"abstract"
authors <- obj .
:!
"authors"
authors <- obj .
??
"authors"
bdd <- obj .
:!
"bdd"
bdd <- obj .
??
"bdd"
doi <- obj .
:!
"doi"
doi <- obj .
??
"doi"
language_iso2 <- obj .
:!
"language_iso2"
language_iso2 <- obj .
??
"language_iso2"
-- page <- obj .
:!
"page"
-- page <- obj .
??
"page"
publication_date <- obj .
:!
"publication_date"
publication_date <- obj .
??
"publication_date"
--publication_second <- obj .
:!
"publication_second"
--publication_second <- obj .
??
"publication_second"
--publication_minute <- obj .
:!
"publication_minute"
--publication_minute <- obj .
??
"publication_minute"
--publication_hour <- obj .
:!
"publication_hour"
--publication_hour <- obj .
??
"publication_hour"
publication_day <- obj .
:!
"publication_day"
publication_day <- obj .
??
"publication_day"
publication_month <- obj .
:!
"publication_month"
publication_month <- obj .
??
"publication_month"
publication_year <- obj .
:!
"publication_year"
publication_year <- obj .
??
"publication_year"
source <- obj .
:!
"sources"
source <- obj .
??
"sources"
institutes <- obj .
:!
"institutes"
institutes <- obj .
??
"institutes"
title <- obj .
:!
"title"
title <- obj .
??
"title"
uniqId <- obj .
:!
"uniqId"
uniqId <- obj .
??
"uniqId"
--url <- obj .: "url"
--url <- obj .: "url"
--text <- obj .: "text"
--text <- obj .: "text"
pure $ Document { abstract
pure $ Document { abstract
...
...
src/Gargantext/Pages/Lists/Tabs.purs
View file @
b7e624dc
module Gargantext.Pages.Lists.Tabs where
module Gargantext.Pages.Lists.Tabs where
import Prelude
import Prelude
import Data.Argonaut (class DecodeJson, decodeJson, (.:), (.
:!
))
import Data.Argonaut (class DecodeJson, decodeJson, (.:), (.
??
))
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep.Show (genericShow)
import Data.Generic.Rep.Show (genericShow)
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..))
...
@@ -111,7 +111,7 @@ instance decodeCorpusInfo :: DecodeJson CorpusInfo where
...
@@ -111,7 +111,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}
...
...
src/Gargantext/Pages/Texts.purs
View file @
b7e624dc
...
@@ -3,6 +3,8 @@ module Gargantext.Pages.Texts where
...
@@ -3,6 +3,8 @@ module Gargantext.Pages.Texts where
import Prelude ((<<<))
import Prelude ((<<<))
import Data.Array (head)
import Data.Array (head)
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..))
import DOM.Simple.Console (log2)
import Effect.Class (liftEffect)
import Effect.Aff (Aff, throwError)
import Effect.Aff (Aff, throwError)
import Effect.Exception (error)
import Effect.Exception (error)
import Reactix as R
import Reactix as R
...
@@ -45,9 +47,12 @@ textsLayoutCpt = R.hooksComponent "TextsLoader" cpt
...
@@ -45,9 +47,12 @@ textsLayoutCpt = R.hooksComponent "TextsLoader" cpt
getCorpus :: Session -> Int -> Aff CorpusData
getCorpus :: Session -> Int -> Aff CorpusData
getCorpus session textsId = do
getCorpus session textsId = do
liftEffect $ log2 "nodepolyurl: " nodePolyUrl
-- fetch corpus via texts parentId
-- fetch corpus via texts parentId
(NodePoly {parentId: corpusId} :: NodePoly {}) <- get nodePolyUrl
(NodePoly {parentId: corpusId} :: NodePoly {}) <- get nodePolyUrl
liftEffect $ log2 "corpusnodeurl: " $ corpusNodeUrl corpusId
corpusNode <- get $ corpusNodeUrl corpusId
corpusNode <- get $ corpusNodeUrl corpusId
liftEffect $ log2 "defaultlistidsurl: " $ defaultListIdsUrl corpusId
defaultListIds <- get $ defaultListIdsUrl corpusId
defaultListIds <- get $ defaultListIdsUrl corpusId
case (head defaultListIds :: Maybe (NodePoly HyperdataList)) of
case (head defaultListIds :: Maybe (NodePoly HyperdataList)) of
Just (NodePoly { id: defaultListId }) ->
Just (NodePoly { id: defaultListId }) ->
...
@@ -55,6 +60,6 @@ getCorpus session textsId = do
...
@@ -55,6 +60,6 @@ getCorpus session textsId = do
Nothing ->
Nothing ->
throwError $ error "Missing default list"
throwError $ error "Missing default list"
where
where
nodePolyUrl = url session $ NodeAPI
NodeList
(Just textsId)
nodePolyUrl = url session $ NodeAPI
Corpus
(Just textsId)
corpusNodeUrl = url session <<< NodeAPI Corpus <<< Just
corpusNodeUrl = url session <<< NodeAPI Corpus <<< Just
defaultListIdsUrl = url session <<< Children NodeList 0 1 Nothing <<< Just
defaultListIdsUrl = url session <<< Children NodeList 0 1 Nothing <<< Just
src/Gargantext/Pages/Texts/Tabs.purs
View file @
b7e624dc
...
@@ -2,7 +2,7 @@ module Gargantext.Pages.Texts.Tabs where
...
@@ -2,7 +2,7 @@ module Gargantext.Pages.Texts.Tabs where
--------------------------------------------------------
--------------------------------------------------------
import Prelude (class Eq, class Show, bind, pure, ($))
import Prelude (class Eq, class Show, bind, pure, ($))
import Data.Argonaut (class DecodeJson, decodeJson, (.:), (.
:!
))
import Data.Argonaut (class DecodeJson, decodeJson, (.:), (.
??
))
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep.Show (genericShow)
import Data.Generic.Rep.Show (genericShow)
import Data.Maybe (Maybe(..))
import Data.Maybe (Maybe(..))
...
@@ -149,7 +149,7 @@ instance decodeCorpusInfo :: DecodeJson CorpusInfo where
...
@@ -149,7 +149,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}
...
...
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