Fix client routing

[?]
Jan 24, 2021, 6:54 AM
AAALU5A2FQQTNV7ZVAFCU2JTRUONEUWWZKENDUUXDOFUGWHM3KZQC

Dependencies

  • [2] XA7SOE6J Dockerize reactclient.
  • [3] WRPIYG3E Use project listing functionality to check for whether we have a cookie.
  • [4] 3GLHIR4F Add migrate script for prod system.
  • [5] BFZN4SUA Make timeline component work.
  • [6] GMYPBCWE Make docker-compose work.
  • [7] NJNMO72S Add zcash.com submodule and update client to modern halogen.
  • [8] 3LMXT7Z6 preventDefault on login form submission.
  • [9] 5R2Z7FSX Initial rendering for signup controls.
  • [10] SAESJLLY Initial experiments in hash routing.
  • [11] 5SBSBFLS Bind log directories to local paths for development.
  • [12] IR75ZMX3 Return actual events for interval ends, not just timestamps.
  • [13] QMEYU4MW Add display for prior intervals.
  • [14] TKGBRIQT Login component now raises LoginComplete message.
  • [15] PT4276XC Add logout functionality.
  • [16] O2BZOX7M Add signup form, captcha check.
  • [17] QU5FW67R Add project selection to time tracker.
  • [*] EA5BFM5G Split Login component into its own module.
  • [*] RB2ETNIF Add skeletal PureScript client project.
  • [*] ARX7SHY5 Begin work on login UI.

Change contents

  • replacement in client/src/Aftok/Login.purs at line 148
    [3.541][3.541:582]()
    [ P.href "./#signup" ]
    [3.541]
    [3.582]
    [ P.href "#signup" ]
  • replacement in client/src/Aftok/Signup.purs at line 190
    [3.5570][3.5570:5624]()
    [ HH.text "Alreay have an account? "
    [3.5570]
    [3.5624]
    [ HH.text "Already have an account? "
  • replacement in client/src/Aftok/Signup.purs at line 192
    [3.5648][3.5648:5710]()
    [ P.href "#", E.onClick (Just <<< Signin) ]
    [3.5648]
    [3.5710]
    [ P.href "#login" ]
  • edit in client/src/Aftok/Types.purs at line 40
    [3.1504]
    [3.11606]
    , setHash :: String -> m Unit
  • edit in client/src/Aftok/Types.purs at line 52
    [3.1539]
    [3.11809]
    , setHash: liftEffect <<< H.setHash
  • edit in client/src/Main.purs at line 7
    [21.493]
    [3.307503]
    import Data.Foldable (oneOf)
  • edit in client/src/Main.purs at line 12
    [3.307589]
    [3.1023]
    import Effect.Class (liftEffect)
    import Effect.Aff (launchAff_)
  • edit in client/src/Main.purs at line 24
    [3.1485]
    [21.1094]
    import Routing (match)
    import Routing.Hash (matchesWith)
    import Routing.Match (Match, lit)
  • replacement in client/src/Main.purs at line 44
    [3.1683][3.1541:1573](),[3.13687][3.1541:1573](),[3.1541][3.1541:1573]()
    runUI mainComponent unit body
    [3.1683]
    [3.1684]
    halogenIO <- runUI mainComponent unit body
  • replacement in client/src/Main.purs at line 46
    [3.1685][3.1685:1700]()
    data MainView
    [3.1685]
    [3.1700]
    void $ liftEffect $ matchesWith (match mainRoute) \oldMay new ->
    when (oldMay /= Just new) do
    launchAff_ <<< halogenIO.query <<< H.tell $ Navigate new
    data View
  • edit in client/src/Main.purs at line 55
    [3.1751]
    [3.1116]
    mainRoute :: Match View
    mainRoute = oneOf
    [ VSignup <$ lit "signup"
    , VLogin <$ lit "login"
    , VTimeline <$ lit "timeline"
    ]
    routeHash :: View -> String
    routeHash = case _ of
    VSignup -> "signup"
    VLogin -> "login"
    VTimeline -> "timeline"
    VLoading -> ""
  • edit in client/src/Main.purs at line 70
    [3.1117]
    [3.1752]
    -- derive instance genericView :: Generic View _
    derive instance eqView :: Eq View
    derive instance ordView :: Ord View
    data MainQuery a = Navigate View a
  • replacement in client/src/Main.purs at line 77
    [3.1769][3.1769:1790]()
    { view :: MainView
    [3.1769]
    [3.1790]
    { view :: View
  • replacement in client/src/Main.purs at line 98
    [3.308288][3.13688:13721]()
    :: forall query input output m
    [3.308288]
    [3.13721]
    :: forall input output m
  • replacement in client/src/Main.purs at line 105
    [3.13825][3.13825:13871]()
    -> H.Component HH.HTML query input output m
    [3.13825]
    [3.2007]
    -> H.Component HH.HTML MainQuery input output m
  • replacement in client/src/Main.purs at line 110
    [3.4065][3.4065:4094]()
    { handleAction = eval
    [3.4065]
    [3.4094]
    { handleAction = handleAction
    , handleQuery = handleQuery
  • replacement in client/src/Main.purs at line 114
    [3.4140][3.308517:308527](),[3.308517][3.308517:308527]()
    } where
    [3.4140]
    [3.308528]
    }
    where
  • replacement in client/src/Main.purs at line 139
    [3.308925][3.14177:14255](),[3.14255][3.2476:2509]()
    eval :: MainAction -> H.HalogenM MainState MainAction Slots output m Unit
    eval action = case action of
    [3.308925]
    [3.4241]
    handleAction :: MainAction -> H.HalogenM MainState MainAction Slots output m Unit
    handleAction = case _ of
  • replacement in client/src/Main.purs at line 152
    [3.2830][3.2830:2872]()
    H.modify_ (_ { view = nextView })
    [3.2830]
    [3.4407]
    navigate nextView
  • replacement in client/src/Main.purs at line 155
    [3.2919][3.2919:2962]()
    H.modify_ (_ { view = VTimeline })
    [3.2919]
    [3.2081]
    navigate VTimeline
  • replacement in client/src/Main.purs at line 158
    [3.3011][3.3011:3054]()
    H.modify_ (_ { view = VTimeline })
    [3.3011]
    [3.3054]
    navigate VTimeline
  • replacement in client/src/Main.purs at line 161
    [3.9538][3.9538:9578]()
    H.modify_ (_ { view = VLogin })
    [3.9538]
    [3.9578]
    navigate VLogin
  • replacement in client/src/Main.purs at line 165
    [3.2130][3.3081:3121]()
    H.modify_ (_ { view = VLogin })
    [3.2130]
    [3.3121]
    navigate VLogin
    handleQuery :: forall a. MainQuery a -> H.HalogenM MainState MainAction Slots output m (Maybe a)
    handleQuery = case _ of
    Navigate view a -> do
    currentView <- H.gets _.view
    when (currentView /= view) $ navigate view
    pure (Just a)
  • edit in client/src/Main.purs at line 174
    [3.3122]
    [3.2154]
    navigate :: View -> H.HalogenM MainState MainAction Slots output m Unit
    navigate view = do
    lift $ system.setHash (routeHash view)
    H.modify_ (_ { view = view })
  • replacement in docker-compose.yml at line 66
    [3.405][3.2646:2703](),[3.2703][3.9998:10062](),[3.9998][3.9998:10062](),[3.10062][3.2704:2756]()
    # - type: bind
    # source: ./client/dist
    # target: /opt/static/app
    # read_only: true
    - type: volume
    source: v_aftok-client
    [3.405]
    [3.2756]
    - type: bind
    source: ./client/dist
  • edit in docker-compose.yml at line 70
    [2.1667]
    [2.1667]
    # - type: volume
    # source: v_aftok-client
    # target: /opt/static/app
    # read_only: true