From fefe6769f205efac0b0644e9f7f44861fcf1dd96 Mon Sep 17 00:00:00 2001 From: Philippe Pittoli Date: Sat, 17 Feb 2024 02:56:25 +0100 Subject: [PATCH] WIP: Authd Admin: Search User Interface. --- .../AuthenticationDaemonAdminInterface.purs | 24 +++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/App/AuthenticationDaemonAdminInterface.purs b/src/App/AuthenticationDaemonAdminInterface.purs index f5cd109..44a537e 100644 --- a/src/App/AuthenticationDaemonAdminInterface.purs +++ b/src/App/AuthenticationDaemonAdminInterface.purs @@ -142,7 +142,7 @@ generic_button action active = HH.button [ HP.style "padding: 0.5rem 1.25rem;" , HP.type_ HP.ButtonSubmit - , HE.onClick \_ -> SearchUserAttempt + , HE.onClick \_ -> action , (if active then (HP.enabled true) else (HP.disabled true)) ] [ HH.text "Send Message to Server" ] @@ -177,14 +177,9 @@ handleAction = case _ of pass = addUserForm.pass case login, email, pass of - "", _, _ -> - H.raise $ Log $ UnableToSend "Write the user's login!" - - _, "", _ -> - H.raise $ Log $ UnableToSend "Write the user's email!" - - _, _, "" -> - H.raise $ Log $ UnableToSend "Write the user's password!" + "", _, _ -> H.raise $ Log $ UnableToSend "Write the user's login!" + _, "", _ -> H.raise $ Log $ UnableToSend "Write the user's email!" + _, _, "" -> H.raise $ Log $ UnableToSend "Write the user's password!" _, _, _ -> do ab <- H.liftEffect $ AuthD.serialize $ AuthD.MkAddUser { login: login @@ -204,12 +199,11 @@ handleAction = case _ of H.modify_ _ { page = page } SearchUserAttempt -> do - { searchUserForm } <- H.get - let login = searchUserForm.login - email = searchUserForm.email - -- domain = searchUserForm.domain - admin = searchUserForm.admin - + --{ searchUserForm } <- H.get + --let login = searchUserForm.login + -- email = searchUserForm.email + -- -- domain = searchUserForm.domain + -- admin = searchUserForm.admin --ab <- H.liftEffect $ AuthD.serialize $ AuthD.MkSearchUser { login: -- , admin: -- , email: Just (Email.Email email)