From 010fef244c04536a3e7d32c316476575d4356732 Mon Sep 17 00:00:00 2001 From: Aidan Oldershaw Date: Tue, 31 Mar 2020 12:49:54 -0400 Subject: [PATCH 1/2] web: behaviour: fix log highlighting on OneOffBuild page concourse/concourse#5384 This was fixed for the JobBuild page in concourse/concourse#5275, but did not fix it for OneOffBuilds. Signed-off-by: Aidan Oldershaw --- web/elm/src/Application/Application.elm | 3 +++ web/elm/src/SubPage/SubPage.elm | 13 +++++++++++++ web/elm/tests/BuildTests.elm | 25 +++++++++++++++++++++++++ 3 files changed, 41 insertions(+) diff --git a/web/elm/src/Application/Application.elm b/web/elm/src/Application/Application.elm index e9f07030ec1..e5281e33693 100644 --- a/web/elm/src/Application/Application.elm +++ b/web/elm/src/Application/Application.elm @@ -462,6 +462,9 @@ routeMatchesModel route model = ( Routes.Build _, SubPage.BuildModel _ ) -> True + ( Routes.OneOffBuild _, SubPage.BuildModel _ ) -> + True + ( Routes.Job _, SubPage.JobModel _ ) -> True diff --git a/web/elm/src/SubPage/SubPage.elm b/web/elm/src/SubPage/SubPage.elm index 3cf303b32bd..cd02e544737 100644 --- a/web/elm/src/SubPage/SubPage.elm +++ b/web/elm/src/SubPage/SubPage.elm @@ -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 ) diff --git a/web/elm/tests/BuildTests.elm b/web/elm/tests/BuildTests.elm index 4896f7adeca..d3d8b2ad958 100644 --- a/web/elm/tests/BuildTests.elm +++ b/web/elm/tests/BuildTests.elm @@ -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 From 2dca72944087a0f7cf76ff51648d710252282aee Mon Sep 17 00:00:00 2001 From: Aidan Oldershaw Date: Tue, 31 Mar 2020 13:00:01 -0400 Subject: [PATCH 2/2] add release note Signed-off-by: Aidan Oldershaw --- release-notes/v6.0.1.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/release-notes/v6.0.1.md b/release-notes/v6.0.1.md index f884db2548f..cd9f742c0a4 100644 --- a/release-notes/v6.0.1.md +++ b/release-notes/v6.0.1.md @@ -18,3 +18,7 @@ * Fix pipeline tooltips being hidden behind other cards. #5377 +#### :link: fix + +* Fix log highlighting on the one-off-build page. Previously, highlighting any log lines would cause the page to reload. #5384 +