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
148
Issues
148
List
Board
Labels
Milestones
Merge Requests
7
Merge Requests
7
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
43db884d
Commit
43db884d
authored
Jan 09, 2024
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/622-dev-fix-for-first-commit-after-import' into dev
parents
b70888af
0cdb214f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
8 deletions
+28
-8
New.hs
src/Gargantext/API/Node/Corpus/New.hs
+23
-7
FrameCalcUpload.hs
src/Gargantext/API/Node/FrameCalcUpload.hs
+5
-1
No files found.
src/Gargantext/API/Node/Corpus/New.hs
View file @
43db884d
...
...
@@ -39,7 +39,7 @@ import Gargantext.API.Node.Corpus.Types
import
Gargantext.API.Node.Corpus.Update
(
addLanguageToCorpus
)
import
Gargantext.API.Node.Types
import
Gargantext.Core
(
Lang
(
..
),
withDefaultLanguage
,
defaultLanguage
)
import
Gargantext.Core.NodeStory
(
HasNodeStoryImmediateSaver
,
HasNodeArchiveStoryImmediateSaver
,
currentVersion
)
import
Gargantext.Core.NodeStory
(
HasNodeStoryImmediateSaver
,
HasNodeArchiveStoryImmediateSaver
,
currentVersion
,
NgramsStatePatch
'
)
import
Gargantext.Core.Text.Corpus.API
qualified
as
API
import
Gargantext.Core.Text.Corpus.Parsers
qualified
as
Parser
(
FileType
(
..
),
parseFormatC
)
import
Gargantext.Core.Text.List.Social
(
FlowSocialListWith
(
..
))
...
...
@@ -51,7 +51,7 @@ import Gargantext.Database.Action.Mail (sendMail)
import
Gargantext.Database.Action.Node
(
mkNodeWithParent
)
import
Gargantext.Database.Action.User
(
getUserId
)
import
Gargantext.Database.Admin.Types.Hyperdata
import
Gargantext.Database.Admin.Types.Node
(
CorpusId
,
NodeType
(
..
))
import
Gargantext.Database.Admin.Types.Node
(
CorpusId
,
NodeType
(
..
)
,
ParentId
)
import
Gargantext.Database.GargDB
qualified
as
GargDB
import
Gargantext.Database.Prelude
(
hasConfig
)
import
Gargantext.Database.Query.Table.Node
(
getNodeWith
,
getOrMkList
)
...
...
@@ -252,10 +252,7 @@ addToCorpusWithQuery user cid (WithQuery { _wq_query = q
corpusId
<-
flowDataText
user
txt
(
Multi
l
)
cid
(
Just
flw
)
jobHandle
$
(
logLocM
)
DEBUG
$
T
.
pack
$
"corpus id "
<>
show
corpusId
userId
<-
getUserId
user
listId
<-
getOrMkList
cid
userId
v
<-
currentVersion
listId
_
<-
commitStatePatch
listId
(
Versioned
v
mempty
)
_
<-
commitCorpus
cid
user
-- printDebug "sending email" ("xxxxxxxxxxxxxxxxxxxxx" :: Text)
sendMail
user
...
...
@@ -275,7 +272,10 @@ type AddWithForm = Summary "Add with FormUrlEncoded to corpus endpoint"
:>
"async"
:>
AsyncJobs
JobLog
'[
F
ormUrlEncoded
]
NewWithForm
JobLog
addToCorpusWithForm
::
(
FlowCmdM
env
err
m
,
MonadJobStatus
m
)
addToCorpusWithForm
::
(
FlowCmdM
env
err
m
,
MonadJobStatus
m
,
HasNodeStoryImmediateSaver
env
,
HasNodeArchiveStoryImmediateSaver
env
)
=>
User
->
CorpusId
->
NewWithForm
...
...
@@ -344,6 +344,8 @@ addToCorpusWithForm user cid nwf jobHandle = do
--(map (map toHyperdataDocument) docs)
jobHandle
_
<-
commitCorpus
cid
user
-- printDebug "Extraction finished : " cid
-- printDebug "sending email" ("xxxxxxxxxxxxxxxxxxxxx" :: Text)
-- TODO uncomment this
...
...
@@ -422,3 +424,17 @@ addToCorpusWithFile user cid nwf@(NewWithFile _d (withDefaultLanguage -> l) fNam
sendMail
user
markComplete
jobHandle
--- UTILITIES
commitCorpus
::
(
FlowCmdM
env
err
m
,
HasNodeArchiveStoryImmediateSaver
env
,
HasNodeStoryImmediateSaver
env
)
=>
ParentId
->
User
->
m
(
Versioned
NgramsStatePatch'
)
commitCorpus
cid
user
=
do
userId
<-
getUserId
user
listId
<-
getOrMkList
cid
userId
v
<-
currentVersion
listId
commitStatePatch
listId
(
Versioned
v
mempty
)
src/Gargantext/API/Node/FrameCalcUpload.hs
View file @
43db884d
...
...
@@ -35,6 +35,7 @@ import Gargantext.API.Node.Corpus.New.Types (FileFormat(..), FileType(..))
import
Gargantext.API.Node.Types
(
NewWithForm
(
..
))
import
Gargantext.API.Prelude
import
Gargantext.Core
(
Lang
)
import
Gargantext.Core.NodeStory
(
HasNodeArchiveStoryImmediateSaver
)
import
Gargantext.Core.Text.List.Social
(
FlowSocialListWith
(
..
))
import
Gargantext.Core.Types.Individu
(
User
(
..
))
import
Gargantext.Database.Action.Flow.Types
...
...
@@ -70,7 +71,10 @@ api authenticatedUser nId =
frameCalcUploadAsync
::
(
HasConfig
env
,
FlowCmdM
env
err
m
,
MonadJobStatus
m
)
frameCalcUploadAsync
::
(
HasConfig
env
,
FlowCmdM
env
err
m
,
MonadJobStatus
m
,
HasNodeArchiveStoryImmediateSaver
env
)
=>
AuthenticatedUser
-- ^ The logged-in user
->
NodeId
...
...
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