Commit 5c20ad2f authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FIX] typos

parent 4d89fa1b
Pipeline #1328 failed with stage
...@@ -27,9 +27,9 @@ isEmail = ((==) 2) . List.length . (splitOn "@") ...@@ -27,9 +27,9 @@ isEmail = ((==) 2) . List.length . (splitOn "@")
------------------------------------------------------------------------ ------------------------------------------------------------------------
data SendEmail = SendEmail Bool data SendEmail = SendEmail Bool
type EmailAddress = Text type EmailAddress = Text
type Name = Text type Name = Text
type ServerAdress = Text type ServerAddress = Text
data MailModel = Invitation { invitation_user :: NewUser GargPassword } data MailModel = Invitation { invitation_user :: NewUser GargPassword }
| PassUpdate { passUpdate_user :: NewUser GargPassword } | PassUpdate { passUpdate_user :: NewUser GargPassword }
...@@ -38,7 +38,7 @@ data MailModel = Invitation { invitation_user :: NewUser GargPassword } ...@@ -38,7 +38,7 @@ data MailModel = Invitation { invitation_user :: NewUser GargPassword }
} }
------------------------------------------------------------------------ ------------------------------------------------------------------------
------------------------------------------------------------------------ ------------------------------------------------------------------------
mail :: ServerAdress -> MailModel -> IO () mail :: ServerAddress -> MailModel -> IO ()
mail server model = gargMail (GargMail m (Just u) subject body) mail server model = gargMail (GargMail m (Just u) subject body)
where where
(m,u) = email_to model (m,u) = email_to model
...@@ -46,7 +46,7 @@ mail server model = gargMail (GargMail m (Just u) subject body) ...@@ -46,7 +46,7 @@ mail server model = gargMail (GargMail m (Just u) subject body)
body = emailWith server model body = emailWith server model
------------------------------------------------------------------------ ------------------------------------------------------------------------
emailWith :: ServerAdress -> MailModel -> Text emailWith :: ServerAddress -> MailModel -> Text
emailWith server model = emailWith server model =
unlines $ [ "Hello" ] unlines $ [ "Hello" ]
<> bodyWith server model <> bodyWith server model
...@@ -63,7 +63,7 @@ email_to' :: NewUser GargPassword -> (EmailAddress, Name) ...@@ -63,7 +63,7 @@ email_to' :: NewUser GargPassword -> (EmailAddress, Name)
email_to' (NewUser u m _) = (u,m) email_to' (NewUser u m _) = (u,m)
------------------------------------------------------------------------ ------------------------------------------------------------------------
bodyWith :: ServerAdress -> MailModel -> [Text] bodyWith :: ServerAddress -> MailModel -> [Text]
bodyWith server (Invitation u) = [ "Congratulation, you have been granted a beta user account to test the" bodyWith server (Invitation u) = [ "Congratulation, you have been granted a beta user account to test the"
, "new GarganText platform!" , "new GarganText platform!"
] <> (email_credentials server u) ] <> (email_credentials server u)
...@@ -80,7 +80,7 @@ email_subject (PassUpdate _) = "[GarganText] Update" ...@@ -80,7 +80,7 @@ email_subject (PassUpdate _) = "[GarganText] Update"
email_subject (MailInfo _ _) = "[GarganText] Info" email_subject (MailInfo _ _) = "[GarganText] Info"
email_credentials :: ServerAdress -> NewUser GargPassword -> [Text] email_credentials :: ServerAddress -> NewUser GargPassword -> [Text]
email_credentials server (NewUser u _ (GargPassword p)) = email_credentials server (NewUser u _ (GargPassword p)) =
[ "" [ ""
, "You can log in to: " <> server , "You can log in to: " <> server
......
...@@ -258,7 +258,10 @@ insertMasterDocs c lang hs = do ...@@ -258,7 +258,10 @@ insertMasterDocs c lang hs = do
-- this will enable global database monitoring -- this will enable global database monitoring
-- maps :: IO Map Ngrams (Map NgramsType (Map NodeId Int)) -- maps :: IO Map Ngrams (Map NgramsType (Map NodeId Int))
mapNgramsDocs <- mapNodeIdNgrams <$> documentIdWithNgrams (extractNgramsT $ withLang lang documentsWithId) documentsWithId mapNgramsDocs <- mapNodeIdNgrams
<$> documentIdWithNgrams
(extractNgramsT $ withLang lang documentsWithId)
documentsWithId
terms2id <- insertNgrams $ Map.keys mapNgramsDocs terms2id <- insertNgrams $ Map.keys mapNgramsDocs
-- to be removed -- to be removed
......
...@@ -52,11 +52,11 @@ guessUserName n = case splitOn "@" n of ...@@ -52,11 +52,11 @@ guessUserName n = case splitOn "@" n of
_ -> Nothing _ -> Nothing
------------------------------------------------------------------------ ------------------------------------------------------------------------
newUser' :: HasNodeError err newUser' :: HasNodeError err
=> ServerAdress -> NewUser GargPassword -> Cmd err Int64 => ServerAddress -> NewUser GargPassword -> Cmd err Int64
newUser' address u = newUsers' address [u] newUser' address u = newUsers' address [u]
newUsers' :: HasNodeError err newUsers' :: HasNodeError err
=> ServerAdress -> [NewUser GargPassword] -> Cmd err Int64 => ServerAddress -> [NewUser GargPassword] -> Cmd err Int64
newUsers' address us = do newUsers' address us = do
us' <- liftBase $ mapM toUserHash us us' <- liftBase $ mapM toUserHash us
r <- insertUsers $ map toUserWrite us' r <- insertUsers $ map toUserWrite us'
......
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