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
153
Issues
153
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
1f9b9f14
Commit
1f9b9f14
authored
Jan 26, 2021
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] User Layout
parent
f126695c
Pipeline
#1391
failed with stage
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
14 deletions
+43
-14
Contact.hs
src/Gargantext/API/Node/Contact.hs
+2
-2
Routes.hs
src/Gargantext/API/Routes.hs
+12
-4
Search.hs
src/Gargantext/API/Search.hs
+17
-6
Facet.hs
src/Gargantext/Database/Query/Facet.hs
+12
-2
No files found.
src/Gargantext/API/Node/Contact.hs
View file @
1f9b9f14
...
...
@@ -55,8 +55,8 @@ type API = "contact" :> Summary "Contact endpoint"
api
::
UserId
->
CorpusId
->
GargServer
API
api
uid
cid
=
(
api_async
(
RootId
(
NodeId
uid
))
cid
)
:<|>
(
nodeNodeAPI
(
Proxy
::
Proxy
HyperdataContact
)
uid
cid
)
api
uid
cid
=
(
api_async
(
RootId
(
NodeId
uid
))
cid
)
:<|>
(
nodeNodeAPI
(
Proxy
::
Proxy
HyperdataContact
)
uid
cid
)
type
API_Async
=
AsyncJobs
JobLog
'[
J
SON
]
AddContactParams
JobLog
------------------------------------------------------------------------
...
...
src/Gargantext/API/Routes.hs
View file @
1f9b9f14
...
...
@@ -95,10 +95,12 @@ type GargPrivateAPI' =
:>
Capture
"node_id"
NodeId
:>
NodeAPI
HyperdataAny
--{-
-- Corpus endpoints
:<|>
"corpus"
:>
Summary
"Corpus endpoint"
:>
Capture
"corpus_id"
CorpusId
:>
NodeAPI
HyperdataCorpus
--}
:<|>
"corpus"
:>
Summary
"Corpus endpoint"
:>
Capture
"node1_id"
NodeId
...
...
@@ -110,6 +112,12 @@ type GargPrivateAPI' =
:>
Export
.
API
-- Annuaire endpoint
{-
:<|> "contact" :> Summary "Contact endpoint"
:> Capture "contact_id" ContactId
:> NodeAPI HyperdataContact
--}
:<|>
"annuaire"
:>
Summary
"Annuaire endpoint"
:>
Capture
"annuaire_id"
AnnuaireId
:>
NodeAPI
HyperdataAnnuaire
...
...
@@ -117,7 +125,6 @@ type GargPrivateAPI' =
:<|>
"annuaire"
:>
Summary
"Contact endpoint"
:>
Capture
"annuaire_id"
NodeId
:>
Contact
.
API
-- Document endpoint
:<|>
"document"
:>
Summary
"Document endpoint"
:>
Capture
"doc_id"
DocId
...
...
@@ -158,11 +165,11 @@ type GargPrivateAPI' =
:<|>
"lists"
:>
Summary
"List export API"
:>
Capture
"listId"
ListId
:>
List
.
API
{-
:<|> "wait" :> Summary "Wait test"
:> Capture "x" Int
:> WaitAPI -- Get '[JSON] Int
-}
-- /mv/<id>/<id>
-- /merge/<id>/<id>
-- /rename/<id>
...
...
@@ -207,6 +214,7 @@ serverPrivateGargAPI' (AuthenticatedUser (NodeId uid))
:<|>
nodeAPI
(
Proxy
::
Proxy
HyperdataCorpus
)
uid
:<|>
nodeNodeAPI
(
Proxy
::
Proxy
HyperdataAny
)
uid
:<|>
Export
.
getCorpus
-- uid
-- :<|> nodeAPI (Proxy :: Proxy HyperdataContact) uid
:<|>
nodeAPI
(
Proxy
::
Proxy
HyperdataAnnuaire
)
uid
:<|>
Contact
.
api
uid
...
...
@@ -232,7 +240,7 @@ serverPrivateGargAPI' (AuthenticatedUser (NodeId uid))
-- :<|> New.api uid -- TODO-SECURITY
-- :<|> New.info uid -- TODO-SECURITY
:<|>
List
.
api
:<|>
waitAPI
--
:<|> waitAPI
----------------------------------------------------------------------
...
...
src/Gargantext/API/Search.hs
View file @
1f9b9f14
...
...
@@ -47,16 +47,25 @@ type API results = Summary "Search endpoint"
:>
QueryParam
"order"
OrderBy
:>
Post
'[
J
SON
]
results
-----------------------------------------------------------------------
-- | Api search function
api
::
NodeId
->
GargServer
(
API
SearchResult
)
api
nId
(
SearchQuery
q
SearchDoc
)
o
l
order
=
SearchResult
<$>
SearchResultDoc
<$>
map
toRow
<$>
searchInCorpus
nId
False
q
o
l
order
SearchResult
<$>
SearchResultDoc
<$>
map
(
toRow
nId
)
<$>
searchInCorpus
nId
False
q
o
l
order
api
nId
(
SearchQuery
q
SearchContact
)
o
l
order
=
do
printDebug
"isPairedWith"
nId
aIds
<-
isPairedWith
nId
NodeAnnuaire
-- TODO if paired with several corpus
case
head
aIds
of
Nothing
->
pure
$
SearchResult
$
SearchNoResult
"[G.A.Search] pair corpus with an Annuaire"
Just
aId
->
SearchResult
<$>
SearchResultContact
<$>
map
toRow
<$>
searchInCorpusWithContacts
nId
aId
q
o
l
order
Nothing
->
pure
$
SearchResult
$
SearchNoResult
"[G.A.Search] pair corpus with an Annuaire"
Just
aId
->
SearchResult
<$>
SearchResultContact
<$>
map
(
toRow
aId
)
<$>
searchInCorpusWithContacts
nId
aId
q
o
l
order
api
_
_
_
_
_
=
undefined
-----------------------------------------------------------------------
...
...
@@ -166,6 +175,7 @@ data Row =
,
c_created
::
!
UTCTime
,
c_hyperdata
::
!
HyperdataRow
,
c_score
::
!
Int
,
c_annuaireId
::
!
NodeId
}
deriving
(
Generic
)
...
...
@@ -187,16 +197,17 @@ instance ToSchema Row where
declareNamedSchema
=
genericDeclareNamedSchema
(
unPrefixSwagger
""
)
class
ToRow
a
where
toRow
::
a
->
Row
toRow
::
NodeId
->
a
->
Row
instance
ToRow
FacetDoc
where
toRow
(
FacetDoc
nId
utc
t
h
mc
_md
sc
)
=
Document
nId
utc
t
(
toHyperdataRow
h
)
(
fromMaybe
0
mc
)
(
round
$
fromMaybe
0
sc
)
toRow
_
(
FacetDoc
nId
utc
t
h
mc
_md
sc
)
=
Document
nId
utc
t
(
toHyperdataRow
h
)
(
fromMaybe
0
mc
)
(
round
$
fromMaybe
0
sc
)
-- | TODO rename FacetPaired
type
FacetContact
=
FacetPaired
Int
UTCTime
HyperdataContact
Int
instance
ToRow
FacetContact
where
toRow
(
FacetPaired
nId
utc
h
s
)
=
Contact
nId
utc
(
toHyperdataRow
h
)
s
toRow
annuaireId
(
FacetPaired
nId
utc
h
s
)
=
Contact
nId
utc
(
toHyperdataRow
h
)
s
annuaireId
--------------------------------------------------------------------
...
...
src/Gargantext/Database/Query/Facet.hs
View file @
1f9b9f14
...
...
@@ -232,13 +232,23 @@ instance Arbitrary OrderBy
-- TODO-SECURITY check
--{-
runViewAuthorsDoc
::
HasDBid
NodeType
=>
ContactId
->
IsTrash
->
Maybe
Offset
->
Maybe
Limit
->
Maybe
OrderBy
->
Cmd
err
[
FacetDoc
]
runViewAuthorsDoc
::
HasDBid
NodeType
=>
ContactId
->
IsTrash
->
Maybe
Offset
->
Maybe
Limit
->
Maybe
OrderBy
->
Cmd
err
[
FacetDoc
]
runViewAuthorsDoc
cId
t
o
l
order
=
runOpaQuery
$
filterWith
o
l
order
$
viewAuthorsDoc
cId
t
ntId
where
ntId
=
NodeDocument
-- TODO add delete ?
viewAuthorsDoc
::
HasDBid
NodeType
=>
ContactId
->
IsTrash
->
NodeType
->
Query
FacetDocRead
viewAuthorsDoc
::
HasDBid
NodeType
=>
ContactId
->
IsTrash
->
NodeType
->
Query
FacetDocRead
viewAuthorsDoc
cId
_
nt
=
proc
()
->
do
(
doc
,(
_
,(
_
,(
_
,
contact'
))))
<-
queryAuthorsDoc
-<
()
...
...
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