diff options
Diffstat (limited to 'Biz')
-rw-r--r-- | Biz/Devalloc.hs | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/Biz/Devalloc.hs b/Biz/Devalloc.hs index a806d65..f03d2d4 100644 --- a/Biz/Devalloc.hs +++ b/Biz/Devalloc.hs @@ -1,10 +1,10 @@ {-# LANGUAGE DataKinds #-} -{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RecordWildCards #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE NoImplicitPrelude #-} @@ -150,7 +150,7 @@ allPaths = Proxy :: Proxy AllPaths type ShowAnalysis = "analysis" :> QueryParam "id" Int :> Get '[HTML] (HtmlApp Analysis) paths :: Config -> OAuthArgs -> Server AllPaths -paths (Config {assets}) oAuthArgs = +paths Config {assets} oAuthArgs = page (Home oAuthArgs) :<|> auth oAuthArgs :<|> analyze @@ -176,7 +176,7 @@ data Response = Response auth :: OAuthArgs -> Maybe Text -> Handler (HtmlApp Page) auth _ Nothing = panic "no code from github api" -auth (OAuthArgs {..}) (Just code) = +auth OAuthArgs {..} (Just code) = liftIO <| getAccessToken >>= getRepos >>= \case @@ -209,7 +209,7 @@ linkTo :: (HasLink path, IsElem path AllPaths) => Proxy path -> MkLink path Lucid.Attribute -linkTo thisPath = Lucid.safeHref_ "/" allPaths thisPath +linkTo = Lucid.safeHref_ "/" allPaths data Page = Home OAuthArgs @@ -224,8 +224,8 @@ instance Lucid.ToHtml Page where Lucid.h1_ "Select a repo to analyze" selectRepo repos -data Analysis = Analysis - { targetRepo :: (GitHub.Id GitHub.Repo) +newtype Analysis = Analysis + { targetRepo :: GitHub.Id GitHub.Repo } instance Lucid.ToHtml Analysis where @@ -262,17 +262,17 @@ selectRepo = Lucid.ul_ . mapM_ render . Vector.toList <| GitHub.repoName repo loginButton :: OAuthArgs -> Lucid.Html () -loginButton (OAuthArgs {..}) = - Lucid.a_ - [ Lucid.href_ - <| "https://github.com/login/oauth/authorize?" - <> encodeParams - [ ("client_id", githubClientId), - ("state", githubState) - -- ("redirect_uri", "https://devalloc.io") - ] - ] - "Get Started with GitHub" +loginButton OAuthArgs {..} = + Lucid.a_ + [ Lucid.href_ + <| "https://github.com/login/oauth/authorize?" + <> encodeParams + [ ("client_id", githubClientId), + ("state", githubState) + -- ("redirect_uri", "https://devalloc.io") + ] + ] + "Get Started with GitHub" pitch :: OAuthArgs -> Lucid.Html () pitch oAuthArgs = |