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
200
Issues
200
List
Board
Labels
Milestones
Merge Requests
12
Merge Requests
12
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
23e94a21
Verified
Commit
23e94a21
authored
Nov 14, 2024
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into 238-dev-async-job-worker
parents
8f6f9f94
4327e2a6
Pipeline
#6973
failed with stages
in 54 minutes and 30 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
5 deletions
+26
-5
install
bin/install
+1
-1
Node.hs
src/Gargantext/Database/Query/Table/Node.hs
+9
-4
Private.hs
test/Test/API/Private.hs
+5
-0
Main.hs
test/drivers/hspec/Main.hs
+11
-0
No files found.
bin/install
View file @
23e94a21
...
@@ -4,5 +4,5 @@ echo "GarganText, build, install, test and documentation"
...
@@ -4,5 +4,5 @@ echo "GarganText, build, install, test and documentation"
nix-shell
--run
"cabal update
\\
nix-shell
--run
"cabal update
\\
&& cabal v2-build --ghc-options=-O2
\\
&& cabal v2-build --ghc-options=-O2
\\
&& cabal --overwrite-policy=always install
\\
&& cabal --overwrite-policy=always install
\\
&& cabal v2-test
\\
&& cabal v2-test
--test-show-details=streaming
\\
&& cabal haddock"
&& cabal haddock"
src/Gargantext/Database/Query/Table/Node.hs
View file @
23e94a21
...
@@ -81,6 +81,7 @@ import Gargantext.Database.Schema.Node
...
@@ -81,6 +81,7 @@ import Gargantext.Database.Schema.Node
import
Gargantext.Prelude
hiding
(
sum
,
head
)
import
Gargantext.Prelude
hiding
(
sum
,
head
)
import
Opaleye
hiding
(
FromField
)
import
Opaleye
hiding
(
FromField
)
import
Prelude
hiding
(
null
,
id
,
map
,
sum
)
import
Prelude
hiding
(
null
,
id
,
map
,
sum
)
import
qualified
Data.List.NonEmpty
as
NE
queryNodeSearchTable
::
Select
NodeSearchRead
queryNodeSearchTable
::
Select
NodeSearchRead
...
@@ -448,10 +449,14 @@ get_user_root_node_folder nty userId = do
...
@@ -448,10 +449,14 @@ get_user_root_node_folder nty userId = do
where_
$
(
n
^.
node_typename
.==
sqlInt4
(
toDBid
nty
))
.&&
where_
$
(
n
^.
node_typename
.==
sqlInt4
(
toDBid
nty
))
.&&
(
n
^.
node_user_id
.==
sqlInt4
(
_UserId
userId
))
(
n
^.
node_user_id
.==
sqlInt4
(
_UserId
userId
))
pure
n
pure
n
case
result
of
case
NE
.
nonEmpty
result
of
[]
->
nodeError
$
NodeLookupFailed
$
UserFolderDoesNotExist
userId
Nothing
[
n
]
->
pure
n
->
nodeError
$
NodeLookupFailed
$
UserFolderDoesNotExist
userId
folders
->
nodeError
$
NodeLookupFailed
$
UserHasTooManyRoots
userId
(
map
_node_id
folders
)
-- See https://gitlab.iscpif.fr/gargantext/haskell-gargantext/merge_requests/350#note_12732
-- User might have more than one public folder, in which case we need to take the one with the
-- smallest id.
Just
folders
->
pure
$
NE
.
head
(
NE
.
sortWith
_node_id
folders
)
-- | An input 'NodeId' identifies a user node if its typename is 'NodeUser' and it has no parent_id.
-- | An input 'NodeId' identifies a user node if its typename is 'NodeUser' and it has no parent_id.
isUserNode
::
HasDBid
NodeType
=>
NodeId
->
DBCmd
err
Bool
isUserNode
::
HasDBid
NodeType
=>
NodeId
->
DBCmd
err
Bool
...
...
test/Test/API/Private.hs
View file @
23e94a21
...
@@ -38,6 +38,11 @@ nodeTests = sequential $ aroundAll withTestDBAndPort $ beforeAllWith dbEnvSetup
...
@@ -38,6 +38,11 @@ nodeTests = sequential $ aroundAll withTestDBAndPort $ beforeAllWith dbEnvSetup
manager
<-
runIO
$
newManager
defaultManagerSettings
manager
<-
runIO
$
newManager
defaultManagerSettings
let
unauthenticatedClientEnv
port
=
mkClientEnv
manager
(
baseUrl
{
baseUrlPort
=
port
})
let
unauthenticatedClientEnv
port
=
mkClientEnv
manager
(
baseUrl
{
baseUrlPort
=
port
})
it
"setup DB triggers"
$
\
SpecContext
{
..
}
->
do
setupEnvironment
_sctx_env
-- Let's create the Alice user.
void
$
createAliceAndBob
_sctx_env
describe
"GET /api/v1.0/user"
$
do
describe
"GET /api/v1.0/user"
$
do
-- FIXME(adn): unclear if this is useful at all. Doesn't do permission checking.
-- FIXME(adn): unclear if this is useful at all. Doesn't do permission checking.
...
...
test/drivers/hspec/Main.hs
View file @
23e94a21
...
@@ -4,8 +4,19 @@ module Main where
...
@@ -4,8 +4,19 @@ module Main where
import
Control.Monad
import
Control.Monad
import
Data.Text
(
isInfixOf
)
import
Data.Text
(
isInfixOf
)
<<<<<<<
HEAD
import
Data.Text
qualified
as
T
import
Data.Text
qualified
as
T
import
Gargantext.Prelude
hiding
(
isInfixOf
)
import
Gargantext.Prelude
hiding
(
isInfixOf
)
|||||||
0
bbbba60
import
Gargantext.Core.Notifications.CentralExchange
qualified
as
CE
import
Gargantext.Core.Notifications.Dispatcher
qualified
as
D
import
Gargantext.Core.Notifications.Dispatcher.Types
qualified
as
DT
import
Gargantext.Core.Config.Types
(
NotificationsConfig
(
..
))
=======
import
Gargantext.Core.Notifications.CentralExchange
qualified
as
CE
import
Gargantext.Core.Notifications.Dispatcher
qualified
as
D
import
Gargantext.Core.Config.Types
(
NotificationsConfig
(
..
))
>>>>>>>
dev
import
Shelly
hiding
(
FilePath
)
import
Shelly
hiding
(
FilePath
)
import
System.IO
import
System.IO
import
System.Process
import
System.Process
...
...
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