Skip to content

Commit

Permalink
Merge pull request #5388 from concourse/issue/5384
Browse files Browse the repository at this point in the history
web: behaviour: fix log highlighting on OneOffBuild page
  • Loading branch information
aoldershaw committed Mar 31, 2020
2 parents 2d98220 + 2dca729 commit 810ad39
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 0 deletions.
4 changes: 4 additions & 0 deletions release-notes/v6.0.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@

* Fix pipeline tooltips being hidden behind other cards. #5377

#### <sub><sup><a name="5384" href="#5384">:link:</a></sup></sub> fix

* Fix log highlighting on the one-off-build page. Previously, highlighting any log lines would cause the page to reload. #5384

3 changes: 3 additions & 0 deletions web/elm/src/Application/Application.elm
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,9 @@ routeMatchesModel route model =
( Routes.Build _, SubPage.BuildModel _ ) ->
True

( Routes.OneOffBuild _, SubPage.BuildModel _ ) ->
True

( Routes.Job _, SubPage.JobModel _ ) ->
True

Expand Down
13 changes: 13 additions & 0 deletions web/elm/src/SubPage/SubPage.elm
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,19 @@ urlUpdate routes =
Nothing
}

Routes.OneOffBuild { id, highlight } ->
Build.changeToBuild
{ pageType = Build.Header.Models.OneOffBuildPage id
, highlight = highlight
, fromBuildPage =
case routes.from of
Routes.OneOffBuild params ->
Just <| Build.Header.Models.OneOffBuildPage params.id

_ ->
Nothing
}

_ ->
identity
)
Expand Down
25 changes: 25 additions & 0 deletions web/elm/tests/BuildTests.elm
Original file line number Diff line number Diff line change
Expand Up @@ -1264,6 +1264,31 @@ all =
|> Tuple.second
|> Common.notContains
(Effects.FetchJobBuild <| buildParams.id)
, test "does not reload one off build page when highlight is modified" <|
\_ ->
let
buildParams =
{ id = 1
, highlight = Routes.HighlightNothing
}
in
Common.init "/"
|> Application.handleDelivery
(RouteChanged <|
Routes.OneOffBuild
buildParams
)
|> Tuple.first
|> Application.handleDelivery
(RouteChanged <|
Routes.OneOffBuild
{ buildParams
| highlight = Routes.HighlightLine "step" 1
}
)
|> Tuple.second
|> Common.notContains
(Effects.FetchBuild 0 buildParams.id)
, test "gets current timezone on page load" <|
\_ ->
Application.init
Expand Down

0 comments on commit 810ad39

Please sign in to comment.