Commit df392b7a authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

Merge branch '90-dev-hal-box-fix' of...

Merge branch '90-dev-hal-box-fix' of ssh://gitlab.iscpif.fr:20022/gargantext/haskell-gargantext into 90-dev-hal-box-fix
parents ac7c3653 89114ee3
## Version 0.0.5.6.7
* [BACK] fix limit with MAX_DOCS_SCRAPERS
* [FEAT] Users Password Sugar function : in repl, runCmdReplEasy $ updateUsersPassword ["user@mail.com"]
## Version 0.0.5.6.6
* [BACK] CSV List post and reindex after (for both CSV and JSON)
......
name: gargantext
version: '0.0.5.6.6'
version: '0.0.5.6.7'
synopsis: Search, map, share
description: Please see README.md
category: Data
......
......@@ -31,10 +31,6 @@ import qualified Gargantext.Core.Text.Corpus.API.Istex as ISTEX
import qualified Gargantext.Core.Text.Corpus.API.Pubmed as PUBMED
import Servant.Client (ClientError)
-- | TODO put in gargantext.init
default_limit :: Maybe Integer
default_limit = Just 10000
-- | Get External API metadata main function
get :: ExternalAPIs
-> Lang
......@@ -42,15 +38,15 @@ get :: ExternalAPIs
-> Maybe Limit
-- -> IO [HyperdataDocument]
-> IO (Either ClientError (Maybe Integer, ConduitT () HyperdataDocument IO ()))
get PubMed _la q _l = PUBMED.get q Nothing
get PubMed _la q limit = PUBMED.get q limit
--docs <- PUBMED.get q default_limit -- EN only by default
--pure (Just $ fromIntegral $ length docs, yieldMany docs)
get HAL la q _l = HAL.getC la q Nothing
get IsTex la q _l = do
docs <- ISTEX.get la q default_limit
get HAL la q limit = HAL.getC la q limit
get IsTex la q limit = do
docs <- ISTEX.get la q limit
pure $ Right (Just $ fromIntegral $ length docs, yieldMany docs)
get Isidore la q _l = do
docs <- ISIDORE.get la (fromIntegral <$> default_limit) (Just q) Nothing
get Isidore la q limit = do
docs <- ISIDORE.get la (fromIntegral <$> limit) (Just q) Nothing
pure $ Right (Just $ fromIntegral $ length docs, yieldMany docs)
get _ _ _ _ = undefined
......
......@@ -27,7 +27,7 @@ import Gargantext.Database.Query.Table.User
import Gargantext.Prelude
import Gargantext.Prelude.Crypto.Pass.User (gargPass)
import Gargantext.Prelude.Mail.Types (MailConfig)
------------------------------------------------------------------------
------------------------------------------------------------------------
newUsers :: (CmdM env err m, MonadRandom m, HasNodeError err, HasMail env)
=> [EmailAddress] -> m Int64
......@@ -35,6 +35,18 @@ newUsers us = do
us' <- mapM newUserQuick us
config <- view $ mailSettings
newUsers' config us'
------------------------------------------------------------------------
updateUsersPassword :: (CmdM env err m, MonadRandom m, HasNodeError err, HasMail env)
=> [EmailAddress] -> m Int64
updateUsersPassword us = do
us' <- mapM newUserQuick us
config <- view $ mailSettings
_ <- mapM (\u -> updateUser (SendEmail True) config u) us'
pure 1
------------------------------------------------------------------------
------------------------------------------------------------------------
newUserQuick :: (MonadRandom m)
=> Text -> m (NewUser GargPassword)
......@@ -44,6 +56,7 @@ newUserQuick n = do
Just (u', _m) -> u'
Nothing -> panic "[G.D.A.U.N.newUserQuick]: Email invalid"
pure (NewUser u n (GargPassword pass))
------------------------------------------------------------------------
------------------------------------------------------------------------
-- | guessUserName
......@@ -68,7 +81,6 @@ newUsers' cfg us = do
printDebug "newUsers'" us
pure r
------------------------------------------------------------------------
updateUser :: HasNodeError err
=> SendEmail -> MailConfig -> NewUser GargPassword -> Cmd err Int64
updateUser (SendEmail send) cfg u = do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment