Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Przemyslaw Kaminski
haskell-gargantext
Commits
1b2ffbc3
Commit
1b2ffbc3
authored
Sep 08, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[list selection] some initial work (doesn't compile)
parent
2a4febfe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
8 deletions
+20
-8
New.hs
src/Gargantext/API/Node/Corpus/New.hs
+8
-7
Social.hs
src/Gargantext/Core/Text/List/Social.hs
+12
-1
No files found.
src/Gargantext/API/Node/Corpus/New.hs
View file @
1b2ffbc3
...
...
@@ -45,6 +45,7 @@ import Gargantext.API.Node.Corpus.Searx
import
Gargantext.API.Node.Corpus.Types
import
Gargantext.API.Node.Types
import
Gargantext.Core
(
Lang
(
..
)
{-, allLangs-}
)
import
Gargantext.Core.Text.List.Social
(
FlowSocialListWith
(
..
))
import
qualified
Gargantext.Core.Text.Corpus.API
as
API
import
qualified
Gargantext.Core.Text.Corpus.Parsers
as
Parser
(
FileFormat
(
..
),
parseFormat
)
import
Gargantext.Core.Types.Individu
(
User
(
..
))
...
...
@@ -132,12 +133,12 @@ info _u = pure $ ApiInfo API.externalAPIs
------------------------------------------------------------------------
------------------------------------------------------------------------
data
WithQuery
=
WithQuery
{
_wq_query
::
!
Text
,
_wq_databases
::
!
Database
,
_wq_datafield
::
!
Datafield
,
_wq_lang
::
!
Lang
,
_wq_node_id
::
!
Int
--
, _wq_flowListWith :: !FlowSocialListWith
{
_wq_query
::
!
Text
,
_wq_databases
::
!
Database
,
_wq_datafield
::
!
(
Maybe
Datafield
)
,
_wq_lang
::
!
Lang
,
_wq_node_id
::
!
Int
,
_wq_flowListWith
::
!
FlowSocialListWith
}
deriving
Generic
...
...
@@ -190,7 +191,7 @@ addToCorpusWithQuery user cid (WithQuery q dbs datafield l _nid) maybeLimit logS
printDebug
"[addToCorpusWithQuery] datafield"
datafield
case
datafield
of
Web
->
do
Just
Web
->
do
printDebug
"[addToCorpusWithQuery] processing web request"
datafield
_
<-
triggerSearxSearch
cid
q
l
...
...
src/Gargantext/Core/Text/List/Social.hs
View file @
1b2ffbc3
...
...
@@ -11,6 +11,8 @@ Portability : POSIX
module
Gargantext.Core.Text.List.Social
where
import
Control.Monad
(
mzero
)
import
Data.Aeson
import
Data.HashMap.Strict
(
HashMap
)
import
Data.Map
(
Map
)
import
Data.Monoid
(
mconcat
)
...
...
@@ -39,7 +41,16 @@ import Gargantext.Prelude
data
FlowSocialListWith
=
FlowSocialListWithPriority
{
fslw_priority
::
FlowSocialListPriority
}
|
FlowSocialListWithLists
{
fslw_lists
::
[
ListId
]
}
instance
FromJSON
FlowSocialListWith
where
parseJSON
(
Object
v
)
=
do
typ
<-
v
.:
"type"
value
<-
v
.:?
"value"
.!=
[]
case
typ
of
"MyListsFirst"
->
pure
$
FlowSocialListWithPriority
{
fslw_priority
=
MySelfFirst
}
"OtherListsFirst"
->
pure
$
FlowSocialListWithPriority
{
fslw_priority
=
OthersFirst
}
"SelectedLists"
->
pure
$
FlowSocialListWithLists
{
fslw_lists
=
v
}
_
->
pure
$
FlowSocialListWithPriority
{
fslw_priority
=
MySelfFirst
}
parseJSON
_
=
mzero
data
FlowSocialListPriority
=
MySelfFirst
|
OthersFirst
flowSocialListPriority
::
FlowSocialListPriority
->
[
NodeMode
]
...
...
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