Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
158
Issues
158
List
Board
Labels
Milestones
Merge Requests
10
Merge Requests
10
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
haskell-gargantext
Commits
325970ef
Commit
325970ef
authored
Nov 29, 2018
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DEMO] adapting Contact Type.
parent
3a2ce776
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
9 deletions
+24
-9
API.hs
src/Gargantext/API.hs
+2
-1
Node.hs
src/Gargantext/Database/Node.hs
+1
-2
Contact.hs
src/Gargantext/Database/Node/Contact.hs
+20
-5
IMTUser.hs
src/Gargantext/Ext/IMTUser.hs
+1
-1
No files found.
src/Gargantext/API.hs
View file @
325970ef
...
...
@@ -80,6 +80,7 @@ import Gargantext.API.Node ( Roots , roots
,
HyperdataCorpus
,
HyperdataAnnuaire
)
import
Gargantext.Database.Node.Contact
(
HyperdataContact
)
import
Gargantext.Database.Types.Node
()
import
Gargantext.API.Count
(
CountAPI
,
count
,
Query
)
import
Gargantext.API.Search
(
SearchAPI
,
search
,
SearchQuery
)
...
...
@@ -283,7 +284,7 @@ serverGargAPI env = do
:<|>
roots
conn
:<|>
nodeAPI
conn
(
Proxy
::
Proxy
HyperdataAny
)
:<|>
nodeAPI
conn
(
Proxy
::
Proxy
HyperdataCorpus
)
:<|>
nodeAPI
conn
(
Proxy
::
Proxy
Hyperdata
Annuaire
)
:<|>
nodeAPI
conn
(
Proxy
::
Proxy
Hyperdata
Contact
)
:<|>
nodesAPI
conn
:<|>
count
-- TODO: undefined
:<|>
search
conn
...
...
src/Gargantext/Database/Node.hs
View file @
325970ef
...
...
@@ -272,8 +272,7 @@ deleteNodes ns = mkCmd $ \conn ->
getNodesWith
::
JSONB
a
=>
Connection
->
Int
->
proxy
a
->
Maybe
NodeType
->
Maybe
Offset
->
Maybe
Limit
->
IO
[
Node
a
]
getNodesWith
conn
parentId
_
nodeType
maybeOffset
maybeLimit
=
runQuery
conn
$
selectNodesWith
parentId
nodeType
maybeOffset
maybeLimit
runQuery
conn
$
selectNodesWith
parentId
nodeType
maybeOffset
maybeLimit
-- NP check type
...
...
src/Gargantext/Database/Node/Contact.hs
View file @
325970ef
...
...
@@ -22,6 +22,7 @@ module Gargantext.Database.Node.Contact
import
Control.Lens
(
makeLenses
)
import
Data.Aeson.TH
(
deriveJSON
)
import
Data.Swagger
(
ToSchema
)
import
Data.Text
(
Text
)
import
Data.Time
(
UTCTime
)
import
Database.PostgreSQL.Simple.FromField
(
FromField
,
fromField
)
...
...
@@ -32,17 +33,22 @@ import Gargantext.Database.Types.Node (Node,Hyperdata,NodeType(..))
import
Gargantext.Database.Utils
(
fromField'
)
import
Gargantext.Prelude
import
Opaleye
(
QueryRunnerColumnDefault
,
queryRunnerColumnDefault
,
PGJsonb
,
fieldQueryRunnerColumn
)
import
Test.QuickCheck
(
elements
)
import
Test.QuickCheck.Arbitrary
(
Arbitrary
,
arbitrary
)
------------------------------------------------------------------------
type
NodeContact
=
Node
HyperdataContact
data
HyperdataContact
=
HyperdataContact
{
_hc_who
::
Maybe
ContactWho
,
_hc_where
::
Maybe
[
ContactWhere
]
,
_hc_metaData
::
Maybe
ContactMetaData
,
_hc_uniqId
::
Maybe
Text
,
_hc_uniqIdBdd
::
Maybe
Text
HyperdataContact
{
_hc_bdd
::
Maybe
Text
-- ID of Database source
,
_hc_who
::
Maybe
ContactWho
,
_hc_where
::
Maybe
[
ContactWhere
]
,
_hc_title
::
Maybe
Text
-- TODO remove (only demo)
,
_hc_source
::
Maybe
Text
-- TODO remove (only demo)
,
_hc_lastValidation
::
Maybe
Text
,
_hc_uniqIdBdd
::
Maybe
Text
,
_hc_uniqId
::
Maybe
Text
}
deriving
(
Eq
,
Show
,
Generic
)
...
...
@@ -54,6 +60,7 @@ data ContactMetaData =
arbitraryHyperdataContact
::
HyperdataContact
arbitraryHyperdataContact
=
HyperdataContact
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
data
ContactWho
=
...
...
@@ -97,6 +104,14 @@ nodeContactW maybeName maybeContact aId =
-- | Main instances of Contact
instance
ToSchema
HyperdataContact
instance
ToSchema
ContactWho
instance
ToSchema
ContactWhere
instance
ToSchema
ContactTouch
instance
Arbitrary
HyperdataContact
where
arbitrary
=
elements
[
HyperdataContact
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
Nothing
]
-- | Specific Gargantext instance
instance
Hyperdata
HyperdataContact
...
...
src/Gargantext/Ext/IMTUser.hs
View file @
325970ef
...
...
@@ -77,7 +77,7 @@ imtUser2gargContact (IMTUser id' entite' mail' nom' prenom' fonction' tel' _fax'
service'
_groupe'
bureau'
url'
_pservice'
_pfonction'
_afonction'
_grprech'
lieu'
_aprecision'
_atel'
_sexe'
_statut'
_idutilentite'
_entite2'
_service2'
_group2'
_actif'
_idutilsiecoles'
date_modification'
)
=
HyperdataContact
(
Just
qui
)
(
Just
[
ou
])
(
Just
meta
)
Nothing
Nothing
=
HyperdataContact
(
Just
qui
)
(
Just
[
ou
])
(
Just
meta
)
((
<>
)
<$>
prenom'
<*>
nom'
)
entite'
Nothing
Nothing
where
qui
=
ContactWho
(
Just
id'
)
prenom'
nom'
(
Just
$
catMaybes
[
service'
])
Nothing
ou
=
ContactWhere
(
toList
entite'
)
(
toList
service'
)
fonction'
bureau'
(
Just
"France"
)
lieu'
contact
Nothing
Nothing
...
...
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