Login component now raises LoginComplete message.

[?]
Apr 22, 2017, 4:47 AM
TKGBRIQT7XCPJ3LA5JAEMMGMPFWQWINMSDRW76V2IMZZGT5AWTYAC

Dependencies

  • [2] JXG3FCXY Upgrade ps + halogen versions.
  • [3] ARX7SHY5 Begin work on login UI.
  • [4] QQXR7DTO Rework login component to use more appropriate Bootstrap theme.
  • [5] RB2ETNIF Add skeletal PureScript client project.
  • [6] EA5BFM5G Split Login component into its own module.
  • [*] HO2PFRAB Client login now handles response correctly.

Change contents

  • replacement in client/bower.json at line 19
    [2.206][2.206:237]()
    "purescript-now": "^2.0.0"
    [2.206]
    [3.350]
    "purescript-now": "^2.0.0",
    "purescript-routing": "^4.0.0",
    "purescript-uuid": "^3.0.0"
  • replacement in client/src/Aftok/Login.purs at line 3
    [2.515][2.515:585]()
    import Prelude (type (~>), Void, bind, pure, ($), ($>), (<$>), const)
    [2.515]
    [3.46]
    import Prelude (type (~>), bind, pure, ($), ($>), (<$>), const)
  • replacement in client/src/Aftok/Login.purs at line 22
    [3.460][3.460:521]()
    type LoginState = { username :: String, password :: String }
    [3.460]
    [3.521]
    data LoginResponse
    = OK
    | Forbidden
    | Error { status :: StatusCode, message :: String }
    type LoginState =
    { username :: String
    , password :: String
    , loginResponse :: Maybe LoginResponse
    }
  • replacement in client/src/Aftok/Login.purs at line 34
    [3.549][3.549:595]()
    initialState = { username: "", password: "" }
    [3.549]
    [3.595]
    initialState = { username: "", password: "", loginResponse: Nothing }
  • edit in client/src/Aftok/Login.purs at line 45
    [3.833]
    [3.833]
    data LoginComplete = LoginComplete
  • replacement in client/src/Aftok/Login.purs at line 48
    [3.886][2.897:988]()
    ui :: forall eff. H.Component HH.HTML LoginAction LoginState Void (Aff (LoginEffects eff))
    [3.886]
    [2.988]
    ui :: forall eff. H.Component HH.HTML LoginAction LoginState LoginComplete (Aff (LoginEffects eff))
  • replacement in client/src/Aftok/Login.purs at line 92
    [3.2139][2.1913:2006]()
    eval :: LoginAction ~> H.ComponentDSL LoginState LoginAction Void (Aff (LoginEffects eff))
    [3.2139]
    [2.2006]
    eval :: LoginAction ~> H.ComponentDSL LoginState LoginAction LoginComplete (Aff (LoginEffects eff))
  • replacement in client/src/Aftok/Login.purs at line 96
    [3.2411][2.2155:2197]()
    result <- H.liftAff (login user pass)
    [3.2411]
    [3.2452]
    response <- H.liftAff (login user pass)
    case response of
    OK -> H.raise LoginComplete
    _ -> H.put { username: "", password: "", loginResponse: Just response }
  • edit in client/src/Aftok/Login.purs at line 102
    [3.2467][3.2467:2565]()
    data LoginResponse
    = OK
    | Forbidden
    | Error { status :: StatusCode, message :: String }
  • replacement in client/src/Main.purs at line 3
    [3.477][2.6930:6963]()
    import Prelude (Unit, bind, ($))
    [3.477]
    [3.492]
    import Prelude (Unit, bind, ($), (<$), (<$>), (*>), (<<<))
  • edit in client/src/Main.purs at line 5
    [3.493]
    [3.561]
    import Control.Alt ((<|>))
  • edit in client/src/Main.purs at line 8
    [3.3248]
    [3.646]
    import Data.Maybe (maybe)
    import Data.UUID (UUID, parseUUID)
    import Routing.Match (Match)
    import Routing.Match.Class (lit, str)
  • edit in client/src/Main.purs at line 18
    [2.7060][2.7060:7084]()
    import Aftok.Login as L
  • edit in client/src/Main.purs at line 21
    [3.1190]
    [8.1159]
    import Aftok.Login as L
  • edit in client/src/Main.purs at line 29
    [2.7170]
    data ARoute
    = Home
    | Login
    | Project UUID
    | NotFound
    routing :: Match ARoute
    routing = Home <$ lit ""
    <|> Login <$ (lit "" *> lit "login")
    <|> (maybe NotFound Project <<< parseUUID) <$> (lit "" *> lit "project" *> str)