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
77c4095c
Commit
77c4095c
authored
Oct 06, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEAT] Cumulative private and social lists (WIP)
parent
4eb0b1c2
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
8 deletions
+59
-8
Node.hs
src/Gargantext/API/Node.hs
+1
-1
Social.hs
src/Gargantext/Core/Text/List/Social.hs
+36
-0
User.hs
src/Gargantext/Database/Action/User.hs
+2
-1
Tree.hs
src/Gargantext/Database/Query/Tree.hs
+20
-6
No files found.
src/Gargantext/API/Node.hs
View file @
77c4095c
...
...
@@ -294,7 +294,7 @@ pairWith cId aId lId = do
type
TreeAPI
=
QueryParams
"type"
NodeType
:>
Get
'[
J
SON
]
(
Tree
NodeTree
)
treeAPI
::
NodeId
->
GargServer
TreeAPI
treeAPI
=
tree
Advanced
treeAPI
=
tree
Tree
Advanced
------------------------------------------------------------------------
-- | TODO Check if the name is less than 255 char
...
...
src/Gargantext/Core/Text/List/Social.hs
0 → 100644
View file @
77c4095c
{-|
Module : Gargantext.Core.Text.List.Social
Description :
Copyright : (c) CNRS, 2018-Present
License : AGPL + CECILL v3
Maintainer : team@gargantext.org
Stability : experimental
Portability : POSIX
-}
module
Gargantext.Core.Text.List.Social
where
import
Gargantext.Database.Prelude
import
Gargantext.Database.Query.Tree
import
Gargantext.Database.Query.Tree.Root
(
getRootId
)
import
Gargantext.Core.Types.Individu
import
Gargantext.Database.Admin.Types.Node
import
Gargantext.Prelude
import
Gargantext.Database.Query.Table.Node.Error
import
Gargantext.Database.Admin.Config
findListsId
::
(
HasNodeError
err
,
HasTreeError
err
)
=>
NodeMode
->
User
->
Cmd
err
[
NodeId
]
findListsId
mode
u
=
do
r
<-
getRootId
u
map
_dt_nodeId
<$>
filter
(
\
n
->
_dt_typeId
n
==
nodeTypeId
NodeList
)
<$>
findNodes'
mode
r
findNodes'
::
HasTreeError
err
=>
NodeMode
->
RootId
->
Cmd
err
[
DbTreeNode
]
findNodes'
Private
r
=
findNodes
Private
r
[
NodeFolderPrivate
,
NodeCorpus
,
NodeList
]
findNodes'
Shared
r
=
findNodes
Shared
r
[
NodeFolderShared
,
NodeCorpus
,
NodeList
]
findNodes'
Public
r
=
findNodes
Public
r
[
NodeFolderPublic
,
NodeCorpus
,
NodeList
]
src/Gargantext/Database/Action/User.hs
View file @
77c4095c
...
...
@@ -42,9 +42,10 @@ getUserId UserPublic = nodeError NoUserFound
-- | Username = Text
-- UserName is User
-- that is confusing, we should change this
type
Username
=
Text
getUsername
::
HasNodeError
err
=>
User
->
Cmd
err
Text
->
Cmd
err
Username
getUsername
(
UserName
u
)
=
pure
u
getUsername
(
UserDBId
i
)
=
do
users
<-
getUsersWithId
i
...
...
src/Gargantext/Database/Query/Tree.hs
View file @
77c4095c
...
...
@@ -29,6 +29,8 @@ module Gargantext.Database.Query.Tree
,
dt_nodeId
,
dt_typeId
,
findShared
,
findNodes
,
NodeMode
(
..
)
)
where
...
...
@@ -62,7 +64,7 @@ instance Eq DbTreeNode where
------------------------------------------------------------------------
data
TreeMode
=
Basic
|
Advanced
data
TreeMode
=
TreeBasic
|
Tree
Advanced
-- | Returns the Tree of Nodes in Database
tree
::
HasTreeError
err
...
...
@@ -70,8 +72,8 @@ tree :: HasTreeError err
->
RootId
->
[
NodeType
]
->
Cmd
err
(
Tree
NodeTree
)
tree
Basic
=
tree_basic
tree
Advanced
=
tree_advanced
tree
Tree
Basic
=
tree_basic
tree
Tree
Advanced
=
tree_advanced
-- | Tree basic returns the Tree of Nodes in Database
-- (without shared folders)
...
...
@@ -91,11 +93,23 @@ tree_advanced :: HasTreeError err
->
[
NodeType
]
->
Cmd
err
(
Tree
NodeTree
)
tree_advanced
r
nodeTypes
=
do
mainRoot
<-
dbTree
r
nodeTypes
sharedRoots
<-
find
Shared
r
NodeFolderShared
nodeTypes
sharedTreeUpdate
publicRoots
<-
find
Shared
r
NodeFolderPublic
nodeTypes
publicTreeUpdate
mainRoot
<-
findNodes
Private
r
nodeTypes
sharedRoots
<-
find
Nodes
Shared
r
nodeTypes
publicRoots
<-
find
Nodes
Public
r
nodeTypes
toTree
$
toTreeParent
(
mainRoot
<>
sharedRoots
<>
publicRoots
)
------------------------------------------------------------------------
data
NodeMode
=
Private
|
Shared
|
Public
findNodes
::
HasTreeError
err
=>
NodeMode
->
RootId
->
[
NodeType
]
->
Cmd
err
[
DbTreeNode
]
findNodes
Private
r
nt
=
dbTree
r
nt
findNodes
Shared
r
nt
=
findShared
r
NodeFolderShared
nt
sharedTreeUpdate
findNodes
Public
r
nt
=
findShared
r
NodeFolderPublic
nt
publicTreeUpdate
------------------------------------------------------------------------
-- | Collaborative Nodes in the Tree
findShared
::
HasTreeError
err
...
...
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