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
11
Merge Requests
11
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
5897de6c
Commit
5897de6c
authored
Apr 09, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Flow] with userId own Tree : OK mergeable.
parent
9a23e2d1
Pipeline
#821
failed with stage
Changes
7
Pipelines
4
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
21 additions
and
23 deletions
+21
-23
Main.hs
bin/gargantext-import/Main.hs
+4
-3
Main.hs
bin/gargantext-init/Main.hs
+4
-3
package.yaml
package.yaml
+1
-0
Types.hs
src/Gargantext/API/Types.hs
+7
-8
Individu.hs
src/Gargantext/Core/Types/Individu.hs
+0
-1
Root.hs
src/Gargantext/Database/Root.hs
+0
-1
Node.hs
src/Gargantext/Database/Schema/Node.hs
+5
-7
No files found.
bin/gargantext-import/Main.hs
View file @
5897de6c
...
...
@@ -28,6 +28,7 @@ import Gargantext.Text.Corpus.Parsers (FileFormat(..))
import
Gargantext.Database.Utils
(
Cmd
,
)
import
Gargantext.Database.Types.Node
(
CorpusId
,
toHyperdataDocument
)
import
Gargantext.Database.Schema.User
(
insertUsersDemo
)
import
Gargantext.Core.Types.Individu
(
User
(
..
))
import
Gargantext.Text.Terms
(
TermType
(
..
))
import
Gargantext.Core
(
Lang
(
..
))
import
Gargantext.API.Types
(
GargError
)
...
...
@@ -52,13 +53,13 @@ main = do
tt
=
(
Multi
EN
)
format
=
CsvGargV3
-- CsvHal --WOS
corpus
::
forall
m
.
FlowCmdM
DevEnv
GargError
m
=>
m
CorpusId
corpus
=
flowCorpusFile
(
cs
user
)
(
Left
(
cs
name
::
Text
))
(
read
limit
::
Int
)
tt
format
corpusPath
corpus
=
flowCorpusFile
(
UserName
$
cs
user
)
(
Left
(
cs
name
::
Text
))
(
read
limit
::
Int
)
tt
format
corpusPath
corpusCsvHal
::
forall
m
.
FlowCmdM
DevEnv
GargError
m
=>
m
CorpusId
corpusCsvHal
=
flowCorpusFile
(
cs
user
)
(
Left
(
cs
name
::
Text
))
(
read
limit
::
Int
)
tt
CsvHal
corpusPath
corpusCsvHal
=
flowCorpusFile
(
UserName
$
cs
user
)
(
Left
(
cs
name
::
Text
))
(
read
limit
::
Int
)
tt
CsvHal
corpusPath
annuaire
::
forall
m
.
FlowCmdM
DevEnv
GargError
m
=>
m
CorpusId
annuaire
=
flowAnnuaire
(
cs
user
)
(
Left
"Annuaire"
)
(
Multi
EN
)
corpusPath
annuaire
=
flowAnnuaire
(
UserName
$
cs
user
)
(
Left
"Annuaire"
)
(
Multi
EN
)
corpusPath
{-
...
...
bin/gargantext-init/Main.hs
View file @
5897de6c
...
...
@@ -23,11 +23,12 @@ import Data.Either (Either(..))
import
Data.Maybe
(
Maybe
(
..
))
import
System.Environment
(
getArgs
)
import
Gargantext.Prelude
import
Gargantext.Core.Types.Individu
(
UserId
,
User
(
..
))
import
Gargantext.Database.Flow
(
getOrMkRoot
,
getOrMk_RootWithCorpus
)
import
Gargantext.Database.Schema.Node
(
getOrMkList
)
import
Gargantext.Database.Utils
(
Cmd
,
)
import
Gargantext.Database.Types.Node
(
CorpusId
,
RootId
,
HyperdataCorpus
,
ListId
)
import
Gargantext.Database.Schema.User
(
insertUsersDemo
,
UserId
)
import
Gargantext.Database.Schema.User
(
insertUsersDemo
)
import
Gargantext.API.Types
(
GargError
)
import
Gargantext.API.Node
()
-- instances
import
Gargantext.API.Settings
(
withDevEnv
,
runCmdDev
)
...
...
@@ -42,13 +43,13 @@ main = do
let
mkRoots
::
Cmd
GargError
[(
UserId
,
RootId
)]
mkRoots
=
mapM
getOrMkRoot
[
"gargantua"
,
"user1"
,
"user2"
]
mkRoots
=
mapM
getOrMkRoot
$
map
UserName
[
"gargantua"
,
"user1"
,
"user2"
]
-- TODO create all users roots
let
initMaster
::
Cmd
GargError
(
UserId
,
RootId
,
CorpusId
,
ListId
)
initMaster
=
do
(
masterUserId
,
masterRootId
,
masterCorpusId
)
<-
getOrMk_RootWithCorpus
userMaster
(
Left
corpusMasterName
)
(
Nothing
::
Maybe
HyperdataCorpus
)
(
masterUserId
,
masterRootId
,
masterCorpusId
)
<-
getOrMk_RootWithCorpus
(
UserName
userMaster
)
(
Left
corpusMasterName
)
(
Nothing
::
Maybe
HyperdataCorpus
)
masterListId
<-
getOrMkList
masterCorpusId
masterUserId
_triggers
<-
initTriggers
masterListId
pure
(
masterUserId
,
masterRootId
,
masterCorpusId
,
masterListId
)
...
...
package.yaml
View file @
5897de6c
...
...
@@ -38,6 +38,7 @@ library:
-
Gargantext.API.Types
-
Gargantext.Core
-
Gargantext.Core.Types
-
Gargantext.Core.Types.Individu
-
Gargantext.Core.Types.Main
-
Gargantext.Core.Utils.Prefix
-
Gargantext.Database
...
...
src/Gargantext/API/Types.hs
View file @
5897de6c
...
...
@@ -37,18 +37,17 @@ import Crypto.JOSE.Error as Jose
import
Data.Aeson.Types
import
Data.Typeable
import
Data.Validity
import
Servant
import
Servant.Job.Core
(
HasServerError
(
..
),
serverError
)
import
Servant.Job.Async
(
HasJobEnv
)
import
Gargantext.Prelude
import
Gargantext.API.Settings
import
Gargantext.API.Orchestrator.Types
import
Gargantext.API.Ngrams
import
Gargantext.API.Orchestrator.Types
import
Gargantext.API.Settings
import
Gargantext.Core.Types
import
Gargantext.Database.Types.Errors
(
NodeError
(
..
),
HasNodeError
(
..
))
import
Gargantext.Database.Tree
import
Gargantext.Database.Types.Errors
(
NodeError
(
..
),
HasNodeError
(
..
))
import
Gargantext.Database.Utils
import
Gargantext.Database.Schema.Node
import
Gargantext.Prelude
import
Servant
import
Servant.Job.Async
(
HasJobEnv
)
import
Servant.Job.Core
(
HasServerError
(
..
),
serverError
)
class
HasJoseError
e
where
_JoseError
::
Prism'
e
Jose
.
Error
...
...
src/Gargantext/Core/Types/Individu.hs
View file @
5897de6c
...
...
@@ -20,7 +20,6 @@ module Gargantext.Core.Types.Individu
import
Gargantext.Prelude
hiding
(
reverse
)
import
Data.Text
(
Text
,
pack
,
reverse
)
import
Gargantext.Database.Types.Node
(
NodeId
)
type
UserId
=
Int
...
...
src/Gargantext/Database/Root.hs
View file @
5897de6c
...
...
@@ -31,7 +31,6 @@ import Gargantext.Core.Types.Individu (User(..))
import
Gargantext.Database.Config
(
nodeTypeId
)
import
Gargantext.Database.Node.User
(
HyperdataUser
)
import
Gargantext.Database.Schema.Node
(
NodeRead
)
import
Gargantext.Database.Schema.Node
(
pgNodeId
)
import
Gargantext.Database.Schema.Node
(
queryNodeTable
)
import
Gargantext.Database.Schema.User
(
queryUserTable
,
UserPoly
(
..
))
import
Gargantext.Database.Types.Node
(
Node
,
NodePoly
(
..
),
NodeType
(
NodeUser
))
...
...
src/Gargantext/Database/Schema/Node.hs
View file @
5897de6c
...
...
@@ -27,9 +27,8 @@ Portability : POSIX
module
Gargantext.Database.Schema.Node
where
import
Control.Arrow
(
returnA
)
import
Control.Lens
(
Prism
'
,
set
,
view
,
(
#
),
(
^?
)
)
import
Control.Lens
(
set
,
view
)
import
Control.Lens.TH
(
makeLensesWith
,
abbreviatedFields
)
import
Control.Monad.Error.Class
(
MonadError
(
..
))
import
Data.Aeson
import
Data.Maybe
(
Maybe
(
..
),
fromMaybe
)
import
Data.Profunctor.Product.TH
(
makeAdaptorAndInstance
)
...
...
@@ -37,18 +36,17 @@ import Data.Text (Text)
import
Database.PostgreSQL.Simple.FromField
(
FromField
,
fromField
)
import
GHC.Int
(
Int64
)
import
Gargantext.Core.Types
import
Gargantext.Database.Types.Errors
import
Gargantext.Core.Types.Individu
(
User
(
..
))
import
Gargantext.Database.Config
(
nodeTypeId
)
import
Gargantext.Database.Queries.Filter
(
limit'
,
offset'
)
import
Gargantext.Database.Types.Node
(
NodeType
(
..
),
defaultCorpus
,
Hyperdata
,
HyperData
(
..
))
import
Gargantext.Database.Node.User
(
HyperdataUser
(
..
),
fake_HyperdataUser
)
import
Gargantext.Database.Node.Contact
(
HyperdataContact
(
..
),
arbitraryHyperdataContact
)
import
Gargantext.Database.Node.User
(
HyperdataUser
(
..
),
fake_HyperdataUser
)
import
Gargantext.Database.Queries.Filter
(
limit'
,
offset'
)
import
Gargantext.Database.Schema.User
(
getUserId
)
import
Gargantext.Database.Types.Errors
import
Gargantext.Database.Types.Node
(
NodeType
(
..
),
defaultCorpus
,
Hyperdata
,
HyperData
(
..
))
import
Gargantext.Database.Utils
import
Gargantext.Prelude
hiding
(
sum
,
head
)
import
Gargantext.Viz.Graph
(
HyperdataGraph
(
..
))
import
Opaleye
hiding
(
FromField
)
import
Opaleye.Internal.QueryArr
(
Query
)
import
Prelude
hiding
(
null
,
id
,
map
,
sum
)
...
...
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