From 0519e386b476ba45c415ccaa618001ec4a35f066 Mon Sep 17 00:00:00 2001 From: David May <1301201+wass3r@users.noreply.github.com> Date: Tue, 4 Feb 2020 18:27:59 +0000 Subject: [PATCH] refactor(html): ensure content is in landmarks (#87) we got dinged for this in the a11y test (https://dequeuniversity.com/rules/axe/3.4/region?application=axeAPI) it will still fail in dev/ci, because of the Elm debug dialog in the bottom right corner, but we'll pass in production bundle. Co-authored-by: David Vader <48764154+davidvader@users.noreply.github.com> Co-authored-by: Kelly Merrick --- src/elm/Main.elm | 25 +++++++++++++++++++------ src/scss/_main.scss | 2 -- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/elm/Main.elm b/src/elm/Main.elm index db50eeb4e..866355137 100644 --- a/src/elm/Main.elm +++ b/src/elm/Main.elm @@ -24,6 +24,7 @@ import Html , button , details , div + , footer , h1 , header , li @@ -41,7 +42,7 @@ import Html.Attributes , href ) import Html.Events exposing (onClick) -import Html.Lazy exposing (lazy, lazy2, lazy3, lazy4) +import Html.Lazy exposing (lazy, lazy2, lazy3, lazy4, lazy7) import Http exposing (Error(..)) import Http.Detailed import Interop @@ -1154,11 +1155,12 @@ view model = { title = "Vela - " ++ title , body = [ lazy2 viewHeader model.session { feedbackLink = model.velaFeedbackURL, docsLink = model.velaDocsURL, theme = model.theme } - , lazy2 Nav.view model navMsgs - , div [ class "util" ] [ Pages.Build.viewBuildHistory model.time model.zone model.page model.builds.org model.builds.repo model.builds.builds 10 ] - , main_ [] - [ div [ class "content-wrap" ] [ content ] ] - , div [ Util.testAttribute "alerts", class "alerts" ] [ Alerting.view Alerts.config Alerts.view AlertsUpdate model.toasties ] + , lazy2 Nav.view { page = model.page, user = model.user, sourceRepos = model.sourceRepos } navMsgs + , main_ [ class "content-wrap" ] + [ viewUtil model + , content + ] + , footer [] [ lazy viewAlerts model.toasties ] ] } @@ -1321,6 +1323,17 @@ viewHeader maybeSession { feedbackLink, docsLink, theme } = ] +viewUtil : Model -> Html Msg +viewUtil model = + div [ class "util" ] + [ lazy7 Pages.Build.viewBuildHistory model.time model.zone model.page model.builds.org model.builds.repo model.builds.builds 10 ] + + +viewAlerts : Stack Alert -> Html Msg +viewAlerts toasties = + div [ Util.testAttribute "alerts", class "alerts" ] [ Alerting.view Alerts.config Alerts.view AlertsUpdate toasties ] + + viewThemeToggle : Theme -> Html Msg viewThemeToggle theme = let diff --git a/src/scss/_main.scss b/src/scss/_main.scss index d9c1e5835..b626af990 100644 --- a/src/scss/_main.scss +++ b/src/scss/_main.scss @@ -553,8 +553,6 @@ nav { display: flex; flex-direction: row; align-items: center; - - margin-left: 3em; } .recent-build {