Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

web: add red border to failing steps #4164

Merged
merged 3 commits into from Aug 1, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion web/elm/src/Build/StepTree/StepTree.elm
Expand Up @@ -555,7 +555,7 @@ viewStep model session { id, name, log, state, error, expanded, version, metadat
([ class "header"
, onClick <| Click <| StepHeader id
]
++ Styles.stepHeader
++ Styles.stepHeader state
)
[ Html.div
[ style "display" "flex" ]
Expand Down
11 changes: 9 additions & 2 deletions web/elm/src/Build/Styles.elm
Expand Up @@ -19,6 +19,7 @@ module Build.Styles exposing

import Application.Styles
import Build.Models exposing (StepHeaderType(..))
import Build.StepTree.Models exposing (StepState(..))
import Colors
import Concourse
import Dashboard.Styles exposing (striped)
Expand Down Expand Up @@ -141,10 +142,16 @@ triggerTooltip =
]


stepHeader : List (Html.Attribute msg)
stepHeader =
stepHeader : StepState -> List (Html.Attribute msg)
stepHeader state =
[ style "display" "flex"
, style "justify-content" "space-between"
, case state of
StepStateFailed ->
style "border" "1px solid #C24433"

_ ->
style "border" "none"
jamieklassen marked this conversation as resolved.
Show resolved Hide resolved
]


Expand Down
45 changes: 45 additions & 0 deletions web/elm/tests/BuildTests.elm
Expand Up @@ -3194,6 +3194,51 @@ all =
}
++ [ style "background-size" "14px 14px" ]
)
, test "successful step has no border" <|
fetchPlanWithGetStep
>> Application.handleDelivery
(EventsReceived <|
Ok <|
[ { url =
eventsUrl
, data =
STModels.FinishGet
{ source = "stdout"
, id = "plan"
}
0
Dict.empty
[]
Nothing
}
]
)
>> Tuple.first
>> Common.queryView
>> Query.find [ class "header" ]
>> Query.has
[ style "border" "none" ]
, test "failing step has a red border" <|
fetchPlanWithGetStep
>> Application.handleDelivery
(EventsReceived <|
Ok <|
[ { url = eventsUrl
, data =
STModels.FinishGet
{ source = "stdout", id = "plan" }
1
Dict.empty
[]
Nothing
}
]
)
>> Tuple.first
>> Common.queryView
>> Query.find [ class "header" ]
>> Query.has
[ style "border" "1px solid #C24433" ]
, test "network error on first event shows passport officer" <|
let
imgUrl =
Expand Down