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
195
Issues
195
List
Board
Labels
Milestones
Merge Requests
12
Merge Requests
12
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
c81dacf7
Commit
c81dacf7
authored
Jun 29, 2022
by
Karen Konou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[GQL] Extra fields for Annuaire Contact
parent
8f4f5668
Pipeline
#2958
failed with stage
in 17 minutes and 16 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
7 deletions
+52
-7
Annuaire.hs
src/Gargantext/API/GraphQL/Annuaire.hs
+52
-7
No files found.
src/Gargantext/API/GraphQL/Annuaire.hs
View file @
c81dacf7
...
...
@@ -19,7 +19,7 @@ import Gargantext.Database.Admin.Types.Hyperdata.Contact
,
ContactWho
,
cw_firstName
,
cw_lastName
,
hc_who
)
,
hc_who
,
ContactWhere
,
hc_where
,
cw_organization
,
cw_labTeamDepts
,
cw_role
,
cw_office
,
cw_country
,
cw_city
,
cw_touch
,
ct_mail
,
ct_phone
,
ct_url
,
hc_title
,
hc_source
)
import
Gargantext.Database.Admin.Types.Node
(
NodeId
(
..
))
import
Gargantext.Database.Prelude
(
HasConnectionPool
,
HasConfig
)
import
Gargantext.Database.Query.Table.Context
(
getContextWith
)
...
...
@@ -28,9 +28,20 @@ import Gargantext.Prelude
import
GHC.Generics
(
Generic
)
data
AnnuaireContact
=
AnnuaireContact
{
ac_id
::
Int
,
ac_firstName
::
Maybe
Text
,
ac_lastName
::
Maybe
Text
{
ac_title
::
Maybe
Text
,
ac_source
::
Maybe
Text
,
ac_id
::
Int
,
ac_firstName
::
Maybe
Text
,
ac_lastName
::
Maybe
Text
,
ac_labTeamDepts
::
[
Text
]
,
ac_organization
::
[
Text
]
,
ac_role
::
Maybe
Text
,
ac_office
::
Maybe
Text
,
ac_country
::
Maybe
Text
,
ac_city
::
Maybe
Text
,
ac_touchMail
::
Maybe
Text
,
ac_touchPhone
::
Maybe
Text
,
ac_touchUrl
::
Maybe
Text
}
deriving
(
Generic
,
GQLType
,
Show
)
...
...
@@ -62,14 +73,48 @@ dbAnnuaireContacts contact_id = do
toAnnuaireContact
::
(
Int
,
HyperdataContact
)
->
AnnuaireContact
toAnnuaireContact
(
c_id
,
c_hyperdata
)
=
AnnuaireContact
{
ac_id
=
c_id
AnnuaireContact
{
ac_title
=
c_hyperdata
^.
ac_titleL
,
ac_source
=
c_hyperdata
^.
ac_sourceL
,
ac_id
=
c_id
,
ac_firstName
=
c_hyperdata
^.
ac_firstNameL
,
ac_lastName
=
c_hyperdata
^.
ac_lastNameL
}
,
ac_lastName
=
c_hyperdata
^.
ac_lastNameL
,
ac_organization
=
c_hyperdata
^.
ac_organizationL
,
ac_labTeamDepts
=
c_hyperdata
^.
ac_labTeamDeptsL
,
ac_role
=
c_hyperdata
^.
ac_roleL
,
ac_office
=
c_hyperdata
^.
ac_officeL
,
ac_country
=
c_hyperdata
^.
ac_countryL
,
ac_city
=
c_hyperdata
^.
ac_cityL
,
ac_touchMail
=
c_hyperdata
^.
ac_touchMailL
,
ac_touchPhone
=
c_hyperdata
^.
ac_touchPhoneL
,
ac_touchUrl
=
c_hyperdata
^.
ac_touchUrlL
}
ac_titleL
::
Traversal'
HyperdataContact
(
Maybe
Text
)
ac_titleL
=
hc_title
ac_sourceL
::
Traversal'
HyperdataContact
(
Maybe
Text
)
ac_sourceL
=
hc_source
contactWhoL
::
Traversal'
HyperdataContact
ContactWho
contactWhoL
=
hc_who
.
_Just
ac_firstNameL
::
Traversal'
HyperdataContact
(
Maybe
Text
)
ac_firstNameL
=
contactWhoL
.
cw_firstName
ac_lastNameL
::
Traversal'
HyperdataContact
(
Maybe
Text
)
ac_lastNameL
=
contactWhoL
.
cw_lastName
contactWhereL
::
Traversal'
HyperdataContact
ContactWhere
contactWhereL
=
hc_where
.
ix
0
ac_organizationL
::
Traversal'
HyperdataContact
[
Text
]
ac_organizationL
=
contactWhereL
.
cw_organization
ac_labTeamDeptsL
::
Traversal'
HyperdataContact
[
Text
]
ac_labTeamDeptsL
=
contactWhereL
.
cw_labTeamDepts
ac_roleL
::
Traversal'
HyperdataContact
(
Maybe
Text
)
ac_roleL
=
contactWhereL
.
cw_role
ac_officeL
::
Traversal'
HyperdataContact
(
Maybe
Text
)
ac_officeL
=
contactWhereL
.
cw_office
ac_countryL
::
Traversal'
HyperdataContact
(
Maybe
Text
)
ac_countryL
=
contactWhereL
.
cw_country
ac_cityL
::
Traversal'
HyperdataContact
(
Maybe
Text
)
ac_cityL
=
contactWhereL
.
cw_city
ac_touchMailL
::
Traversal'
HyperdataContact
(
Maybe
Text
)
ac_touchMailL
=
contactWhereL
.
cw_touch
.
_Just
.
ct_mail
ac_touchPhoneL
::
Traversal'
HyperdataContact
(
Maybe
Text
)
ac_touchPhoneL
=
contactWhereL
.
cw_touch
.
_Just
.
ct_phone
ac_touchUrlL
::
Traversal'
HyperdataContact
(
Maybe
Text
)
ac_touchUrlL
=
contactWhereL
.
cw_touch
.
_Just
.
ct_url
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