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
199
Issues
199
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
5b626d4a
Verified
Commit
5b626d4a
authored
Sep 14, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[refactor] some more record syntax refactorign
parent
67bc405e
Pipeline
#1834
passed with stage
in 33 minutes and 53 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
16 deletions
+22
-16
Public.hs
src/Gargantext/API/Public.hs
+17
-15
Table.hs
src/Gargantext/API/Table.hs
+5
-1
No files found.
src/Gargantext/API/Public.hs
View file @
5b626d4a
...
@@ -21,7 +21,7 @@ import Data.Maybe (catMaybes)
...
@@ -21,7 +21,7 @@ import Data.Maybe (catMaybes)
import
Data.Text
(
Text
)
import
Data.Text
(
Text
)
import
Data.List
(
replicate
,
null
)
import
Data.List
(
replicate
,
null
)
import
Data.Aeson
import
Data.Aeson
import
Data.Swagger
import
Data.Swagger
hiding
(
title
,
url
)
import
GHC.Generics
(
Generic
)
import
GHC.Generics
(
Generic
)
import
Servant
import
Servant
import
Test.QuickCheck
(
elements
)
import
Test.QuickCheck
(
elements
)
...
@@ -107,13 +107,15 @@ publicNodes = do
...
@@ -107,13 +107,15 @@ publicNodes = do
-- http://localhost:8008/api/v1.0/node/23543/file/download<Paste>
-- http://localhost:8008/api/v1.0/node/23543/file/download<Paste>
-- http://localhost:8000/images/Gargantextuel-212x300.jpg
-- http://localhost:8000/images/Gargantextuel-212x300.jpg
toPublicData
::
Text
->
(
Node
HyperdataFolder
,
[
NodeId
])
->
Maybe
PublicData
toPublicData
::
Text
->
(
Node
HyperdataFolder
,
[
NodeId
])
->
Maybe
PublicData
toPublicData
base
(
n
,
mn
)
=
PublicData
<$>
(
hd
^?
(
_Just
.
hf_data
.
cf_title
))
toPublicData
base
(
n
,
mn
)
=
do
<*>
(
hd
^?
(
_Just
.
hf_data
.
cf_desc
))
title
<-
(
hd
^?
(
_Just
.
hf_data
.
cf_title
))
<*>
(
Just
$
url'
mn
)
-- "images/Gargantextuel-212x300.jpg"
abstract
<-
(
hd
^?
(
_Just
.
hf_data
.
cf_desc
))
<*>
(
Just
$
url'
mn
)
img
<-
(
Just
$
url'
mn
)
-- "images/Gargantextuel-212x300.jpg"
<*>
Just
(
cs
$
show
$
utc2year
(
n
^.
node_date
))
url
<-
(
Just
$
url'
mn
)
<*>
(
hd
^?
(
_Just
.
hf_data
.
cf_query
))
date
<-
Just
(
cs
$
show
$
utc2year
(
n
^.
node_date
))
<*>
(
hd
^?
(
_Just
.
hf_data
.
cf_authors
))
database
<-
(
hd
^?
(
_Just
.
hf_data
.
cf_query
))
author
<-
(
hd
^?
(
_Just
.
hf_data
.
cf_authors
))
pure
$
PublicData
{
..
}
where
where
hd
=
head
hd
=
head
$
filter
(
\
(
HyperdataField
cd
_
_
)
->
cd
==
JSON
)
$
filter
(
\
(
HyperdataField
cd
_
_
)
->
cd
==
JSON
)
...
@@ -150,13 +152,13 @@ instance Arbitrary PublicData where
...
@@ -150,13 +152,13 @@ instance Arbitrary PublicData where
defaultPublicData
::
PublicData
defaultPublicData
::
PublicData
defaultPublicData
=
defaultPublicData
=
PublicData
"Title"
PublicData
{
title
=
"Title"
(
foldl
(
<>
)
""
$
replicate
100
"abstract "
)
,
abstract
=
foldl
(
<>
)
""
$
replicate
100
"abstract "
"images/Gargantextuel-212x300.jpg"
,
img
=
"images/Gargantextuel-212x300.jpg"
"https://.."
,
url
=
"https://.."
"YY/MM/DD"
,
date
=
"YY/MM/DD"
"database"
,
database
=
"database"
"Author"
,
author
=
"Author"
}
...
...
src/Gargantext/API/Table.hs
View file @
5b626d4a
...
@@ -86,7 +86,11 @@ instance ToSchema TableQuery where
...
@@ -86,7 +86,11 @@ instance ToSchema TableQuery where
declareNamedSchema
=
genericDeclareNamedSchema
(
unPrefixSwagger
"tq_"
)
declareNamedSchema
=
genericDeclareNamedSchema
(
unPrefixSwagger
"tq_"
)
instance
Arbitrary
TableQuery
where
instance
Arbitrary
TableQuery
where
arbitrary
=
elements
[
TableQuery
0
10
DateAsc
Docs
"electrodes"
]
arbitrary
=
elements
[
TableQuery
{
tq_offset
=
0
,
tq_limit
=
10
,
tq_orderBy
=
DateAsc
,
tq_view
=
Docs
,
tq_query
=
"electrodes"
}]
tableApi
::
NodeId
->
GargServer
TableApi
tableApi
::
NodeId
->
GargServer
TableApi
...
...
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