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
158
Issues
158
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
167b8698
Commit
167b8698
authored
Dec 09, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] Invitation if completed corpus exists
parent
f0b921c1
Pipeline
#1284
failed with stage
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
3 deletions
+20
-3
Share.hs
src/Gargantext/API/Node/Share.hs
+7
-2
Find.hs
src/Gargantext/Core/Text/List/Social/Find.hs
+2
-0
Tree.hs
src/Gargantext/Database/Query/Tree.hs
+11
-1
No files found.
src/Gargantext/API/Node/Share.hs
View file @
167b8698
...
@@ -27,7 +27,7 @@ import Gargantext.Database.Action.User
...
@@ -27,7 +27,7 @@ import Gargantext.Database.Action.User
import
Gargantext.Database.Action.User.New
import
Gargantext.Database.Action.User.New
import
Gargantext.Database.Admin.Types.Node
import
Gargantext.Database.Admin.Types.Node
import
Gargantext.Database.Prelude
import
Gargantext.Database.Prelude
import
Gargantext.Database.Query.Tree
(
findNodes
Id
)
import
Gargantext.Database.Query.Tree
(
findNodes
WithType
)
import
Gargantext.Database.Query.Table.Node.Error
(
HasNodeError
(
..
))
import
Gargantext.Database.Query.Table.Node.Error
(
HasNodeError
(
..
))
import
Gargantext.Prelude
import
Gargantext.Prelude
import
Servant
import
Servant
...
@@ -75,7 +75,12 @@ api userInviting nId (ShareTeamParams user') = do
...
@@ -75,7 +75,12 @@ api userInviting nId (ShareTeamParams user') = do
printDebug
"[G.A.N.Share.api]"
(
"demo users are not allowed to invite"
::
Text
)
printDebug
"[G.A.N.Share.api]"
(
"demo users are not allowed to invite"
::
Text
)
pure
()
pure
()
False
->
do
False
->
do
children
<-
findNodesId
nId
[
NodeCorpus
]
-- TODO better analysis of the composition of what is shared
children
<-
findNodesWithType
nId
[
NodeList
]
[
NodeFolderShared
,
NodeTeam
,
NodeFolder
,
NodeCorpus
]
_
<-
case
List
.
null
children
of
_
<-
case
List
.
null
children
of
True
->
do
True
->
do
printDebug
"[G.A.N.Share.api]"
(
"Invitation is enabled if you share a corpus at least"
::
Text
)
printDebug
"[G.A.N.Share.api]"
(
"Invitation is enabled if you share a corpus at least"
::
Text
)
...
...
src/Gargantext/Core/Text/List/Social/Find.hs
View file @
167b8698
...
@@ -31,6 +31,8 @@ findListsId u mode = do
...
@@ -31,6 +31,8 @@ findListsId u mode = do
<$>
findNodes'
rootId
mode
<$>
findNodes'
rootId
mode
pure
ns
pure
ns
-- | TODO not clear enough:
-- | TODO not clear enough:
-- | Shared is for Shared with me but I am not the owner of it
-- | Shared is for Shared with me but I am not the owner of it
-- | Private is for all Lists I have created
-- | Private is for all Lists I have created
...
...
src/Gargantext/Database/Query/Tree.hs
View file @
167b8698
...
@@ -30,6 +30,7 @@ module Gargantext.Database.Query.Tree
...
@@ -30,6 +30,7 @@ module Gargantext.Database.Query.Tree
,
dt_typeId
,
dt_typeId
,
findShared
,
findShared
,
findNodes
,
findNodes
,
findNodesWithType
,
NodeMode
(
..
)
,
NodeMode
(
..
)
)
)
where
where
...
@@ -38,7 +39,8 @@ import Control.Lens (view, toListOf, at, each, _Just, to, set, makeLenses)
...
@@ -38,7 +39,8 @@ import Control.Lens (view, toListOf, at, each, _Just, to, set, makeLenses)
import
Control.Monad.Except
(
MonadError
())
import
Control.Monad.Except
(
MonadError
())
import
Data.List
(
tail
,
concat
,
nub
)
import
Data.List
(
tail
,
concat
,
nub
)
import
Data.Map
(
Map
,
fromListWith
,
lookup
)
import
Data.Map
(
Map
,
fromListWith
,
lookup
)
import
qualified
Data.Set
as
Set
import
qualified
Data.Set
as
Set
import
qualified
Data.List
as
List
import
Data.Text
(
Text
)
import
Data.Text
(
Text
)
import
Database.PostgreSQL.Simple
import
Database.PostgreSQL.Simple
import
Database.PostgreSQL.Simple.SqlQQ
import
Database.PostgreSQL.Simple.SqlQQ
...
@@ -171,6 +173,14 @@ findNodesId :: RootId -> [NodeType] -> Cmd err [NodeId]
...
@@ -171,6 +173,14 @@ findNodesId :: RootId -> [NodeType] -> Cmd err [NodeId]
findNodesId
r
nt
=
tail
findNodesId
r
nt
=
tail
<$>
map
_dt_nodeId
<$>
map
_dt_nodeId
<$>
dbTree
r
nt
<$>
dbTree
r
nt
findNodesWithType
::
RootId
->
[
NodeType
]
->
[
NodeType
]
->
Cmd
err
[
DbTreeNode
]
findNodesWithType
root
target
through
=
filter
isInTarget
<$>
dbTree
root
through
where
isInTarget
n
=
List
.
elem
(
fromNodeTypeId
$
view
dt_typeId
n
)
$
List
.
nub
$
target
<>
through
------------------------------------------------------------------------
------------------------------------------------------------------------
------------------------------------------------------------------------
------------------------------------------------------------------------
toTree
::
(
MonadError
e
m
toTree
::
(
MonadError
e
m
...
...
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