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
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
Grégoire Locqueville
haskell-gargantext
Commits
8577b95d
Commit
8577b95d
authored
Jan 30, 2023
by
Karen Konou
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into 497-dev-node-write-selection
parents
224a3f87
ef77d1f2
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
39 additions
and
32 deletions
+39
-32
CHANGELOG.md
CHANGELOG.md
+5
-0
0.0.6.9.4.sql
devops/postgres/upgrade/0.0.6.9.4.sql
+7
-0
gargantext.cabal
gargantext.cabal
+1
-1
package.yaml
package.yaml
+1
-1
Auth.hs
src/Gargantext/API/Admin/Auth.hs
+8
-9
Share.hs
src/Gargantext/API/Node/Share.hs
+8
-6
NodeStory.hs
src/Gargantext/Core/NodeStory.hs
+6
-13
New.hs
src/Gargantext/Database/Action/User/New.hs
+3
-2
No files found.
CHANGELOG.md
View file @
8577b95d
## Version 0.0.6.9.4
*
[
BACK
][
FIX
]
Username and email to lowerCase always. Use migration script please to avoid errors.
*
[
BACK
][
FIX
][
Ngrams Change insert causes Database error (#173)
](
https://gitlab.iscpif.fr/gargantext/haskell-gargantext/issues/173
)
## Version 0.0.6.9.3
## Version 0.0.6.9.3
*
[
FRONT
][
FIX
][
[hackathon
]
GraphExplorer fixes (#489)](https://gitlab.iscpif.fr/gargantext/purescript-gargantext/issues/489)
*
[
FRONT
][
FIX
][
[hackathon
]
GraphExplorer fixes (#489)](https://gitlab.iscpif.fr/gargantext/purescript-gargantext/issues/489)
...
...
devops/postgres/upgrade/0.0.6.9.4.sql
0 → 100644
View file @
8577b95d
UPDATE
auth_user
old
SET
email
=
LOWER
(
new
.
email
)
FROM
auth_user
new
WHERE
old
.
email
=
new
.
email
gargantext.cabal
View file @
8577b95d
...
@@ -5,7 +5,7 @@ cabal-version: 1.12
...
@@ -5,7 +5,7 @@ cabal-version: 1.12
-- see: https://github.com/sol/hpack
-- see: https://github.com/sol/hpack
name: gargantext
name: gargantext
version: 0.0.6.9.
3
version: 0.0.6.9.
4
synopsis: Search, map, share
synopsis: Search, map, share
description: Please see README.md
description: Please see README.md
category: Data
category: Data
...
...
package.yaml
View file @
8577b95d
...
@@ -6,7 +6,7 @@ name: gargantext
...
@@ -6,7 +6,7 @@ name: gargantext
# | | | +----- Layers * : New versions with API additions
# | | | +----- Layers * : New versions with API additions
# | | | | +--- Layers * : New versions without API breaking changes
# | | | | +--- Layers * : New versions without API breaking changes
# | | | | |
# | | | | |
version
:
'
0.0.6.9.
3
'
version
:
'
0.0.6.9.
4
'
synopsis
:
Search, map, share
synopsis
:
Search, map, share
description
:
Please see README.md
description
:
Please see README.md
category
:
Data
category
:
Data
...
...
src/Gargantext/API/Admin/Auth.hs
View file @
8577b95d
...
@@ -35,22 +35,16 @@ module Gargantext.API.Admin.Auth
...
@@ -35,22 +35,16 @@ module Gargantext.API.Admin.Auth
)
)
where
where
import
Control.Lens
(
view
,
(
#
))
--import Control.Monad.Logger.Aeson
--import Control.Monad.Logger.Aeson
--import qualified Text.Blaze.Html5.Attributes as HA
import
Control.Lens
(
view
,
(
#
))
import
Data.Aeson
import
Data.Aeson
import
Data.Swagger
(
ToSchema
(
..
))
import
Data.Swagger
(
ToSchema
(
..
))
import
Data.Text
(
Text
)
import
Data.Text
(
Text
)
import
Data.Text.Lazy
(
toStrict
)
import
Data.Text.Lazy
(
toStrict
)
import
qualified
Data.Text.Lazy.Encoding
as
LE
import
Data.UUID
(
UUID
,
fromText
,
toText
)
import
Data.UUID
(
UUID
,
fromText
,
toText
)
import
Data.UUID.V4
(
nextRandom
)
import
Data.UUID.V4
(
nextRandom
)
import
GHC.Generics
(
Generic
)
import
GHC.Generics
(
Generic
)
import
Servant
import
Servant.Auth.Server
--import qualified Text.Blaze.Html5.Attributes as HA
import
qualified
Gargantext.Prelude.Crypto.Auth
as
Auth
import
Gargantext.API.Admin.Auth.Types
import
Gargantext.API.Admin.Auth.Types
import
Gargantext.API.Admin.EnvTypes
(
GargJob
(
..
),
Env
)
import
Gargantext.API.Admin.EnvTypes
(
GargJob
(
..
),
Env
)
import
Gargantext.API.Admin.Orchestrator.Types
(
JobLog
(
..
),
AsyncJobs
)
import
Gargantext.API.Admin.Orchestrator.Types
(
JobLog
(
..
),
AsyncJobs
)
...
@@ -70,6 +64,11 @@ import Gargantext.Database.Schema.Node (NodePoly(_node_id))
...
@@ -70,6 +64,11 @@ import Gargantext.Database.Schema.Node (NodePoly(_node_id))
import
Gargantext.Prelude
hiding
(
reverse
)
import
Gargantext.Prelude
hiding
(
reverse
)
import
Gargantext.Prelude.Crypto.Pass.User
(
gargPass
)
import
Gargantext.Prelude.Crypto.Pass.User
(
gargPass
)
import
Gargantext.Utils.Jobs
(
serveJobsAPI
)
import
Gargantext.Utils.Jobs
(
serveJobsAPI
)
import
Servant
import
Servant.Auth.Server
import
qualified
Data.Text
as
Text
import
qualified
Data.Text.Lazy.Encoding
as
LE
import
qualified
Gargantext.Prelude.Crypto.Auth
as
Auth
---------------------------------------------------
---------------------------------------------------
...
@@ -181,7 +180,7 @@ forgotPassword = forgotPasswordPost :<|> forgotPasswordGet
...
@@ -181,7 +180,7 @@ forgotPassword = forgotPasswordPost :<|> forgotPasswordGet
forgotPasswordPost
::
(
HasConnectionPool
env
,
HasConfig
env
,
HasMail
env
)
forgotPasswordPost
::
(
HasConnectionPool
env
,
HasConfig
env
,
HasMail
env
)
=>
ForgotPasswordRequest
->
Cmd'
env
err
ForgotPasswordResponse
=>
ForgotPasswordRequest
->
Cmd'
env
err
ForgotPasswordResponse
forgotPasswordPost
(
ForgotPasswordRequest
email
)
=
do
forgotPasswordPost
(
ForgotPasswordRequest
email
)
=
do
us
<-
getUsersWithEmail
email
us
<-
getUsersWithEmail
(
Text
.
toLower
email
)
case
us
of
case
us
of
[
u
]
->
forgotUserPassword
u
[
u
]
->
forgotUserPassword
u
_
->
pure
()
_
->
pure
()
...
...
src/Gargantext/API/Node/Share.hs
View file @
8577b95d
...
@@ -27,14 +27,15 @@ import Gargantext.Database.Action.User
...
@@ -27,14 +27,15 @@ 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
(
findNodesWithType
)
import
Gargantext.Database.Query.Table.Node.Error
(
HasNodeError
(
..
))
import
Gargantext.Database.Query.Table.Node.Error
(
HasNodeError
(
..
))
import
Gargantext.Database.Query.Tree
(
findNodesWithType
)
import
Gargantext.Prelude
import
Gargantext.Prelude
import
qualified
Gargantext.Utils.Aeson
as
GUA
import
Servant
import
Servant
import
Test.QuickCheck
(
elements
)
import
Test.QuickCheck
(
elements
)
import
Test.QuickCheck.Arbitrary
import
Test.QuickCheck.Arbitrary
import
qualified
Data.List
as
List
import
qualified
Data.List
as
List
import
qualified
Data.Text
as
Text
import
qualified
Gargantext.Utils.Aeson
as
GUA
------------------------------------------------------------------------
------------------------------------------------------------------------
data
ShareNodeParams
=
ShareTeamParams
{
username
::
Text
}
data
ShareNodeParams
=
ShareTeamParams
{
username
::
Text
}
...
@@ -61,8 +62,9 @@ api :: HasNodeError err
...
@@ -61,8 +62,9 @@ api :: HasNodeError err
->
ShareNodeParams
->
ShareNodeParams
->
CmdR
err
Int
->
CmdR
err
Int
api
userInviting
nId
(
ShareTeamParams
user'
)
=
do
api
userInviting
nId
(
ShareTeamParams
user'
)
=
do
user
<-
case
guessUserName
user'
of
let
user''
=
Text
.
toLower
user'
Nothing
->
pure
user'
user
<-
case
guessUserName
user''
of
Nothing
->
pure
user''
Just
(
u
,
_
)
->
do
Just
(
u
,
_
)
->
do
isRegistered
<-
getUserId'
(
UserName
u
)
isRegistered
<-
getUserId'
(
UserName
u
)
case
isRegistered
of
case
isRegistered
of
...
@@ -87,8 +89,8 @@ api userInviting nId (ShareTeamParams user') = do
...
@@ -87,8 +89,8 @@ api userInviting nId (ShareTeamParams user') = 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
)
pure
0
pure
0
False
->
do
False
->
do
printDebug
"[G.A.N.Share.api]"
(
"Your invitation is sent to: "
<>
user'
)
printDebug
"[G.A.N.Share.api]"
(
"Your invitation is sent to: "
<>
user'
'
)
newUsers
[
user'
]
newUsers
[
user'
'
]
pure
()
pure
()
pure
u
pure
u
...
...
src/Gargantext/Core/NodeStory.hs
View file @
8577b95d
...
@@ -396,18 +396,14 @@ insertNodeArchiveHistory c nodeId version (h:hs) = do
...
@@ -396,18 +396,14 @@ insertNodeArchiveHistory c nodeId version (h:hs) = do
_
<-
insertNodeArchiveHistory
c
nodeId
version
hs
_
<-
insertNodeArchiveHistory
c
nodeId
version
hs
pure
()
pure
()
where
where
-- https://stackoverflow.com/questions/39224438/postgresql-insert-if-foreign-key-exists
-- https://dba.stackexchange.com/questions/265554/how-to-check-other-table-for-value-during-insert
query
::
PGS
.
Query
query
::
PGS
.
Query
query
=
[
sql
|
INSERT INTO node_story_archive_history(node_id, ngrams_type_id, ngrams_id, patch, version)
query
=
[
sql
|
INSERT INTO node_story_archive_history(node_id, ngrams_type_id, ngrams_id, patch, version)
SELECT node_id, ngrams_type_id, ngrams_id, patch::jsonb, version FROM (
SELECT node_id, ngrams_type_id, ngrams_id, patch::jsonb, version FROM (
VALUES (?, ?, ?, ?, ?)
VALUES (?, ?, ?, ?, ?)
) AS i(node_id, ngrams_type_id, ngrams_id, patch, version)
) AS i(node_id, ngrams_type_id, ngrams_id, patch, version)
WHERE NOT EXISTS (
WHERE EXISTS (
SELECT FROM ngrams
SELECT * FROM nodes where nodes.id = node_id
CROSS JOIN nodes
WHERE ngrams.id = ngrams_id
AND nodes.id = node_id
)
|]
)
|]
getNodeStory
::
PGS
.
Connection
->
NodeId
->
IO
NodeListStory
getNodeStory
::
PGS
.
Connection
->
NodeId
->
IO
NodeListStory
...
@@ -475,17 +471,14 @@ insertNodeStory c (NodeId nId) a = do
...
@@ -475,17 +471,14 @@ insertNodeStory c (NodeId nId) a = do
-- runInsert c $ insert ngramsType ngrams ngramsRepoElement) $ archiveStateToList _a_state
-- runInsert c $ insert ngramsType ngrams ngramsRepoElement) $ archiveStateToList _a_state
where
where
-- https://
dba.stackexchange.com/questions/265554/how-to-check-other-table-for-value-during-insert
-- https://
stackoverflow.com/questions/39224438/postgresql-insert-if-foreign-key-exists
query
::
PGS
.
Query
query
::
PGS
.
Query
query
=
[
sql
|
INSERT INTO node_stories(node_id, ngrams_type_id, ngrams_id, ngrams_repo_element)
query
=
[
sql
|
INSERT INTO node_stories(node_id, ngrams_type_id, ngrams_id, ngrams_repo_element)
SELECT * FROM (
SELECT * FROM (
VALUES (?, ?, ?, ?)
VALUES (?, ?, ?, ?)
) AS i(node_id, ngrams_type_id, ngrams_id, ngrams_repo_element)
) AS i(node_id, ngrams_type_id, ngrams_id, ngrams_repo_element)
WHERE NOT EXISTS (
WHERE EXISTS (
SELECT FROM ngrams
SELECT * FROM nodes where nodes.id = node_id
CROSS JOIN nodes
WHERE ngrams.id = ngrams_id
AND nodes.id = node_id
)
|]
)
|]
-- insert ngramsType ngrams ngramsRepoElement =
-- insert ngramsType ngrams ngramsRepoElement =
-- Insert { iTable = nodeStoryTable
-- Insert { iTable = nodeStoryTable
...
...
src/Gargantext/Database/Action/User/New.hs
View file @
8577b95d
...
@@ -16,7 +16,6 @@ module Gargantext.Database.Action.User.New
...
@@ -16,7 +16,6 @@ module Gargantext.Database.Action.User.New
import
Control.Lens
(
view
)
import
Control.Lens
(
view
)
import
Control.Monad.Random
import
Control.Monad.Random
import
Data.Text
(
Text
,
splitOn
)
import
Data.Text
(
Text
,
splitOn
)
import
qualified
Data.Text
as
Text
import
Gargantext.Core.Mail
import
Gargantext.Core.Mail
import
Gargantext.Core.Mail.Types
(
HasMail
,
mailSettings
)
import
Gargantext.Core.Mail.Types
(
HasMail
,
mailSettings
)
import
Gargantext.Core.Types.Individu
import
Gargantext.Core.Types.Individu
...
@@ -27,6 +26,7 @@ import Gargantext.Database.Query.Table.User
...
@@ -27,6 +26,7 @@ import Gargantext.Database.Query.Table.User
import
Gargantext.Prelude
import
Gargantext.Prelude
import
Gargantext.Prelude.Crypto.Pass.User
(
gargPass
)
import
Gargantext.Prelude.Crypto.Pass.User
(
gargPass
)
import
Gargantext.Prelude.Mail.Types
(
MailConfig
)
import
Gargantext.Prelude.Mail.Types
(
MailConfig
)
import
qualified
Data.Text
as
Text
------------------------------------------------------------------------
------------------------------------------------------------------------
newUsers
::
(
CmdM
env
err
m
,
MonadRandom
m
,
HasNodeError
err
,
HasMail
env
)
newUsers
::
(
CmdM
env
err
m
,
MonadRandom
m
,
HasNodeError
err
,
HasMail
env
)
...
@@ -52,10 +52,11 @@ newUserQuick :: (MonadRandom m)
...
@@ -52,10 +52,11 @@ newUserQuick :: (MonadRandom m)
=>
Text
->
m
(
NewUser
GargPassword
)
=>
Text
->
m
(
NewUser
GargPassword
)
newUserQuick
n
=
do
newUserQuick
n
=
do
pass
<-
gargPass
pass
<-
gargPass
let
n'
=
Text
.
toLower
n
let
u
=
case
guessUserName
n
of
let
u
=
case
guessUserName
n
of
Just
(
u'
,
_m
)
->
u'
Just
(
u'
,
_m
)
->
u'
Nothing
->
panic
"[G.D.A.U.N.newUserQuick]: Email invalid"
Nothing
->
panic
"[G.D.A.U.N.newUserQuick]: Email invalid"
pure
(
NewUser
u
n
(
GargPassword
pass
))
pure
(
NewUser
u
n
'
(
GargPassword
pass
))
------------------------------------------------------------------------
------------------------------------------------------------------------
------------------------------------------------------------------------
------------------------------------------------------------------------
...
...
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