Review fixes.

This commit is contained in:
Dillon Kearns 2022-08-25 11:56:03 -07:00
parent 9772828563
commit 18a5d20ccf
14 changed files with 11 additions and 84 deletions

View File

@ -1,17 +1,10 @@
module Api exposing (routes)
import ApiRoute exposing (ApiRoute)
import ApiRoute
import DataSource exposing (DataSource)
import DataSource.Http
import Html exposing (Html)
import Json.Decode
import Json.Encode
import MySession
import Pages.Manifest as Manifest
import Route exposing (Route)
import Server.Request
import Server.Response
import Server.Session as Session
import Site

View File

@ -2,8 +2,7 @@ module ErrorPage exposing (ErrorPage(..), Model, Msg, head, init, internalError,
import Effect exposing (Effect)
import Head
import Html exposing (Html)
import Html.Events exposing (onClick)
import Html
import Route
import View exposing (View)

View File

@ -12,7 +12,7 @@ import ErrorPage exposing (ErrorPage)
import Form
import Form.Field as Field
import Form.FieldView
import Form.Validation as Validation exposing (Combined, Field, Validation)
import Form.Validation as Validation exposing (Combined, Field)
import Head
import Head.Seo as Seo
import Html exposing (Html)
@ -26,7 +26,7 @@ import Pages.PageUrl exposing (PageUrl)
import Pages.Url
import Request.Hasura
import Route
import RouteBuilder exposing (StatefulRoute, StatelessRoute, StaticPayload)
import RouteBuilder exposing (StatelessRoute, StaticPayload)
import SendGrid
import Server.Request as Request
import Server.Response exposing (Response)
@ -59,12 +59,6 @@ route =
|> RouteBuilder.buildNoState { view = view }
type alias Login =
{ username : String
, password : String
}
now : DataSource Time.Posix
now =
DataSource.Port.get "now"
@ -201,12 +195,6 @@ globalErrors formState =
|> Html.ul [ Attr.style "color" "red" ]
type alias Request =
{ cookies : Dict String String
, maybeFormData : Maybe (Dict String ( String, List String ))
}
data : RouteParams -> Request.Parser (DataSource (Response Data ErrorPage))
data routeParams =
MySession.withSession

View File

@ -22,10 +22,10 @@ import MySession
import Pages.Msg
import Pages.PageUrl exposing (PageUrl)
import Pages.Transition
import Path exposing (Path)
import Path
import Request.Hasura
import Route
import RouteBuilder exposing (StatefulRoute, StatelessRoute, StaticPayload)
import RouteBuilder exposing (StatefulRoute, StaticPayload)
import Server.Request as Request
import Server.Response as Response exposing (Response)
import Server.Session as Session exposing (Session)

View File

@ -29,7 +29,6 @@ type Msg
, query : Maybe String
, fragment : Maybe String
}
| SharedMsg SharedMsg
type alias Data =
@ -70,9 +69,6 @@ update msg model =
OnPageChange _ ->
( { model | showMobileMenu = False }, Effect.none )
SharedMsg globalMsg ->
( model, Effect.none )
subscriptions : Path -> Model -> Sub Msg
subscriptions _ _ =

View File

@ -2,9 +2,8 @@ module Site exposing (canonicalUrl, config)
import DataSource exposing (DataSource)
import Head
import Route exposing (Route)
import Route
import SiteConfig exposing (SiteConfig)
import Sitemap
type alias Data =
@ -28,19 +27,3 @@ head =
[ Head.sitemapLink "/sitemap.xml"
]
|> DataSource.succeed
siteMap :
List (Maybe Route)
-> { path : List String, content : String }
siteMap allRoutes =
allRoutes
|> List.filterMap identity
|> List.map
(\route ->
{ path = Route.routeToPath route |> String.join "/"
, lastMod = Nothing
}
)
|> Sitemap.build { siteUrl = "https://elm-pages.com" }
|> (\sitemapXmlString -> { path = [ "sitemap.xml" ], content = sitemapXmlString })

View File

@ -13,14 +13,12 @@
"dependencies": {
"direct": {
"MartinSStewart/elm-nonempty-string": "2.0.0",
"MartinSStewart/elm-serialize": "1.2.5",
"avh4/elm-color": "1.0.0",
"danfishgold/base64-bytes": "1.1.0",
"danyx23/elm-mimetype": "4.0.1",
"dillonkearns/elm-bcp47-language-tag": "1.0.1",
"dillonkearns/elm-graphql": "5.0.9",
"dillonkearns/elm-markdown": "6.0.1",
"dillonkearns/elm-sitemap": "1.0.1",
"elm/browser": "1.0.2",
"elm/bytes": "1.0.8",
"elm/core": "1.0.5",
@ -42,19 +40,13 @@
"mgold/elm-nonempty-list": "4.2.0",
"miniBill/elm-codec": "1.2.0",
"noahzgordon/elm-color-extra": "1.0.2",
"pablohirafuji/elm-syntax-highlight": "3.4.0",
"robinheghan/fnv1a": "1.0.0",
"robinheghan/murmur3": "1.0.0",
"rtfeldman/elm-css": "16.1.1",
"rtfeldman/elm-iso8601-date-strings": "1.1.4",
"tripokey/elm-fuzzy": "5.2.1",
"turboMaCk/non-empty-list-alias": "1.2.0",
"vito/elm-ansi": "10.0.1",
"zwilias/json-decode-exploration": "6.0.0"
"vito/elm-ansi": "10.0.1"
},
"indirect": {
"bburdette/toop": "1.0.1",
"billstclair/elm-xml-eeue56": "1.0.3",
"elm/file": "1.0.5",
"elm/random": "1.0.0",
"fredcy/elm-parseint": "2.0.1",

View File

@ -3,7 +3,7 @@ module Timestamps exposing (Timestamps, data, format)
import DataSource exposing (DataSource)
import DataSource.Port
import DateFormat
import Json.Decode as Decode exposing (Decoder)
import Json.Decode as Decode
import Json.Decode.Extra
import Json.Encode
import List.Extra

View File

@ -12,7 +12,6 @@ import Bytes exposing (Bytes)
import Bytes.Encode
import Codec
import DataSource exposing (DataSource)
import DataSource.Http exposing (RequestDetails)
import Dict
import Head
import Html exposing (Html)
@ -67,7 +66,6 @@ type Msg
}
)
| GotBuildError BuildError
| Continue
{-| -}
@ -562,17 +560,6 @@ update site config msg model =
Nothing
|> nextStepToEffect site config updatedModel
Continue ->
let
updatedModel : Model route
updatedModel =
model
in
StaticResponses.nextStep
updatedModel
Nothing
|> nextStepToEffect site config updatedModel
GotBuildError buildError ->
let
updatedModel : Model route

View File

@ -1,7 +1,6 @@
module Pages.Internal.Platform.Effect exposing (Effect(..))
import Bytes exposing (Bytes)
import DataSource.Http exposing (RequestDetails)
import Pages.Internal.Platform.ToJsPayload exposing (ToJsSuccessPayloadNewCombined)
import Pages.StaticHttp.Request as StaticHttp

View File

@ -3,20 +3,11 @@ module Pages.StaticHttpRequest exposing (Error(..), MockResolver, RawRequest(..)
import BuildError exposing (BuildError)
import Dict
import List.Extra
import Pages.Internal.StaticHttpBody
import Pages.StaticHttp.Request
import RequestsAndPending exposing (RequestsAndPending)
import TerminalText as Terminal
type alias RequestDetails =
{ url : String
, method : String
, headers : List ( String, String )
, body : Pages.Internal.StaticHttpBody.Body
}
type alias MockResolver =
Pages.StaticHttp.Request.Request
-> Maybe RequestsAndPending.Response

View File

@ -12,7 +12,6 @@ module Test.Html.Internal.ElmHtml.Markdown exposing
-}
import Json.Decode exposing (field)
import Json.Encode
import Test.Internal.KernelConstants exposing (kernelConstants)

View File

@ -11,7 +11,7 @@ module Test.Html.Internal.ElmHtml.ToString exposing
-}
import Dict exposing (Dict)
import Dict
import String
import Test.Html.Internal.ElmHtml.InternalTypes exposing (..)

View File

@ -544,7 +544,7 @@ config apiRoutes pages =
, subscriptions = \_ _ _ -> Sub.none
, routeToPath = \(Route route) -> route |> String.split "/"
, sharedData = DataSource.succeed ()
, onPageChange = \_ -> Continue
, onPageChange = \_ -> GotDataBatch []
, apiRoutes = \_ -> apiRoutes
, pathPatterns = []
, byteDecodePageData = \_ -> Bytes.Decode.fail