Commit fe34b637 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[LOGIN] Fix for demos.

parent e755e9e3
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
-- Select a backend and log into it -- Select a backend and log into it
module Gargantext.Components.Login where module Gargantext.Components.Login where
import Prelude (Unit, bind, const, discard, pure, flip, show, ($), (<>), (*>), (<$>), (>), map) import Prelude (Unit, bind, const, discard, pure, show, ($), (<>), (*>), (<$>), (>), map)
import Data.Array (head) import Data.Array (head)
import Data.Either (Either(..)) import Data.Either (Either(..))
import Data.Maybe (Maybe(..), fromMaybe) import Data.Maybe (Maybe(..), fromMaybe)
...@@ -102,10 +102,11 @@ chooserCpt = R.staticComponent "G.C.Login.chooser" cpt where ...@@ -102,10 +102,11 @@ chooserCpt = R.staticComponent "G.C.Login.chooser" cpt where
, H.ul {} [ renderSessions sessions] , H.ul {} [ renderSessions sessions]
] else [] where ] else [] where
Sessions {sessions:ss} = fst sessions Sessions {sessions:ss} = fst sessions
new = [ H.h3 {} [H.text "New connection(s)"] new = [ H.input {className: "form-control", type:"text", placeholder: "Search for your institute"}
, H.h3 {} [H.text "Last connection(s)"]
, H.table {className : "table"} , H.table {className : "table"}
[ H.thead {className: "thead-dark"} [ H.tr {} [ H.th {} [H.text "Label of instance"] [ H.thead {className: "thead-dark"} [ H.tr {} [ H.th {} [H.text "Label of instance"]
, H.th {} [H.text "Url garg protocole"] , H.th {} [H.text "Gargurl"]
, H.th {} [ H.text ""] , H.th {} [ H.text ""]
] ]
] ]
...@@ -117,14 +118,14 @@ renderSessions :: R2.Reductor Sessions Sessions.Action -> R.Element ...@@ -117,14 +118,14 @@ renderSessions :: R2.Reductor Sessions Sessions.Action -> R.Element
renderSessions sessions = R.fragment (renderSession sessions <$> unSessions (fst sessions)) renderSessions sessions = R.fragment (renderSession sessions <$> unSessions (fst sessions))
where where
renderSession :: R2.Reductor Sessions Sessions.Action -> Session -> R.Element renderSession :: R2.Reductor Sessions Sessions.Action -> Session -> R.Element
renderSession sessions session = H.li {} $ [ H.text $ "Active session: " <> show session ] renderSession sessions' session = H.li {} $ [ H.text $ "Active session: " <> show session ]
<> [ H.a { on : {click} <> [ H.a { on : {click}
, className: "glyphitem glyphicon glyphicon-log-out" , className: "glyphitem glyphicon glyphicon-log-out"
, id : "log-out" , id : "log-out"
, title: "Log out" , title: "Log out"
} [] ] } [] ]
where where
click _ = (snd sessions) (Sessions.Logout session) click _ = (snd sessions') (Sessions.Logout session)
renderBackend :: R.State (Maybe Backend) -> Backend -> R.Element renderBackend :: R.State (Maybe Backend) -> Backend -> R.Element
...@@ -139,7 +140,7 @@ renderBackend state backend@(Backend {name}) = ...@@ -139,7 +140,7 @@ renderBackend state backend@(Backend {name}) =
where where
click _ = (snd state) (const $ Just backend) click _ = (snd state) (const $ Just backend)
label = DST.toUpper $ fromMaybe "" $ head $ DST.split (DST.Pattern ".") name label = DST.toUpper $ fromMaybe "" $ head $ DST.split (DST.Pattern ".") name
url = "(garg://" <> name <> ")" url = "garg://" <> name
type FormProps = type FormProps =
( backend :: Backend ( backend :: Backend
......
...@@ -5,12 +5,12 @@ import Gargantext.Ends ...@@ -5,12 +5,12 @@ import Gargantext.Ends
import Gargantext.Types (ApiVersion(..)) import Gargantext.Types (ApiVersion(..))
defaultBackends :: NonEmpty Array Backend defaultBackends :: NonEmpty Array Backend
defaultBackends = prod :| [partner, demo, dev, local] defaultBackends = local :| [prod, partner, demo, dev]
where where
prod = backend V10 "/api/" "https://v4.gargantext.org" "iscpif.cnrs" prod = backend V10 "/api/" "https://v4.gargantext.org" "iscpif.cnrs"
partner = backend V10 "/api/" "https://demo.gargantext.org" "institut-mines-telecom.imt" partner = backend V10 "/api/" "https://demo.gargantext.org" "institut-mines-telecom.imt"
demo = backend V10 "/api/" "https://demo.gargantext.org" "demo.cnrs" demo = backend V10 "/api/" "https://demo.gargantext.org" "demo.inshs.cnrs"
dev = backend V10 "/api/" "https://dev.gargantext.org" "devel.cnrs" dev = backend V10 "/api/" "https://dev.gargantext.org" "devel.inshs.cnrs"
local = backend V10 "/api/" "http://localhost:8008" "local.cnrs" local = backend V10 "/api/" "http://localhost:8008" "local.cnrs"
defaultApps :: NonEmpty Array Frontend defaultApps :: NonEmpty Array Frontend
......
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