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