Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-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
purescript-gargantext
Commits
ebfcb1c7
Commit
ebfcb1c7
authored
May 21, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DESIGN/ERGO] Login
parent
c99eb587
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
26 deletions
+24
-26
Login.purs
src/Gargantext/Components/Login.purs
+24
-26
No files found.
src/Gargantext/Components/Login.purs
View file @
ebfcb1c7
...
@@ -19,7 +19,7 @@ import Reactix as R
...
@@ -19,7 +19,7 @@ import Reactix as R
import Reactix.DOM.HTML as H
import Reactix.DOM.HTML as H
------------------------------------------------------------------------
------------------------------------------------------------------------
import Gargantext.Components.Forms (clearfix, card
, card
Block, cardGroup, center, formGroup)
import Gargantext.Components.Forms (clearfix, cardBlock, cardGroup, center, formGroup)
import Gargantext.Components.Login.Types (AuthRequest(..))
import Gargantext.Components.Login.Types (AuthRequest(..))
import Gargantext.Ends (Backend(..))
import Gargantext.Ends (Backend(..))
import Gargantext.Sessions (Session, Sessions(..), postAuthRequest, unSessions)
import Gargantext.Sessions (Session, Sessions(..), postAuthRequest, unSessions)
...
@@ -55,7 +55,6 @@ modalCpt = R.hooksComponent "G.C.Login.modal" cpt where
...
@@ -55,7 +55,6 @@ modalCpt = R.hooksComponent "G.C.Login.modal" cpt where
[ H.div { className: "modal-header" }
[ H.div { className: "modal-header" }
[ closing
[ closing
, logo
, logo
, H.h2 { className: "center modal-title" } [H.text "Instances manager"]
]
]
, H.div { className: "modal-body" } children ] ] ] ]
, H.div { className: "modal-body" } children ] ] ] ]
modalClass s = "modal myModal" <> if s then "" else " fade"
modalClass s = "modal myModal" <> if s then "" else " fade"
...
@@ -88,7 +87,7 @@ loginCpt = R.hooksComponent "G.C.Login.login" cpt
...
@@ -88,7 +87,7 @@ loginCpt = R.hooksComponent "G.C.Login.login" cpt
modal {visible} $
modal {visible} $
case fst backend of
case fst backend of
Nothing -> chooser { backends, backend, sessions, visible }
Nothing -> chooser { backends, backend, sessions, visible }
Just b -> form { sessions, visible, backend: b }
Just b
-> form { sessions, visible, backend: b }
type ChooserProps = ( backend :: R.State (Maybe Backend) | Props )
type ChooserProps = ( backend :: R.State (Maybe Backend) | Props )
...
@@ -99,8 +98,9 @@ chooserCpt :: R.Component ChooserProps
...
@@ -99,8 +98,9 @@ chooserCpt :: R.Component ChooserProps
chooserCpt = R.staticComponent "G.C.Login.chooser" cpt where
chooserCpt = R.staticComponent "G.C.Login.chooser" cpt where
cpt :: Record ChooserProps -> Array R.Element -> R.Element
cpt :: Record ChooserProps -> Array R.Element -> R.Element
cpt {backend, backends, sessions} _ =
cpt {backend, backends, sessions} _ =
R.fragment $ active <> new <> search
R.fragment $
title <>
active <> new <> search
where
where
title = [H.h2 { className: "center modal-title" } [H.text "Instances manager"]]
active = if DS.length ss > 0 then [ H.h3 {} [H.text "Active connection(s)"]
active = if DS.length ss > 0 then [ H.h3 {} [H.text "Active connection(s)"]
, H.ul {} [ renderSessions sessions]
, H.ul {} [ renderSessions sessions]
] else [] where
] else [] where
...
@@ -165,29 +165,27 @@ formCpt = R.hooksComponent "G.C.Login.form" cpt where
...
@@ -165,29 +165,27 @@ formCpt = R.hooksComponent "G.C.Login.form" cpt where
setBox@(checkBox /\ setCheckBox) <- R.useState' false
setBox@(checkBox /\ setCheckBox) <- R.useState' false
pure $ R2.row
pure $ R2.row
[ cardGroup
[ cardGroup
[ card
[ cardBlock
[ cardBlock
[ center
[ center
[ H.div {className: "text-muted"}
[ H.h4 {className: "m-b-0"}
[ H.text $ "Login to garg://" <> show backend]
[ H.span {className: "icon-text"} [ H.text "Welcome :)" ] ]
, requestAccessLink {}
, H.p {className: "text-muted"}
[ H.text $ "Login to your account or", requestAccessLink {} ] ]
, H.div {}
[ csrfTokenInput {}
, formGroup [ H.p {} [ H.text (fst error) ], usernameInput username ]
, formGroup [ passwordInput password, clearfix {} ]
, center
[ H.label {}
[ H.div {className: "checkbox"}
[ termsCheckbox setBox , H.text "I accept the terms of use ", termsLink {} ] ]
]
]
]
, if checkBox == true
, H.div {}
&& fst username /= ""
[ csrfTokenInput {}
&& fst password /= ""
, formGroup [ H.p {} [ H.text (fst error) ], usernameInput username ]
then H.div {} [center [loginSubmit $ onClick props error username password]]
, formGroup [ passwordInput password, clearfix {} ]
else H.div {} []
, center
]
[ H.label {}
[ H.div {className: "checkbox"}
[ termsCheckbox setBox , H.text "I accept the terms of use ", termsLink {} ] ]
]
]
, if checkBox == true
&& fst username /= ""
&& fst password /= ""
then H.div {} [center [loginSubmit $ onClick props error username password]]
else H.div {} []
]
]
]
]
]
]
...
...
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