From 5fd9f5178f9572c4c16654a45360fad560045357 Mon Sep 17 00:00:00 2001 From: Tim Jacomb Date: Mon, 30 Dec 2024 22:20:15 +0000 Subject: [PATCH 1/2] [JENKINS-74868] Use new build status symbols in multi branch projects --- .../resources/lib/hudson/ballColorTd.jelly | 67 +++++++++++-------- 1 file changed, 38 insertions(+), 29 deletions(-) diff --git a/core/src/main/resources/lib/hudson/ballColorTd.jelly b/core/src/main/resources/lib/hudson/ballColorTd.jelly index 9cbefdf3d43f..2fd299d2e496 100644 --- a/core/src/main/resources/lib/hudson/ballColorTd.jelly +++ b/core/src/main/resources/lib/hudson/ballColorTd.jelly @@ -24,9 +24,9 @@ THE SOFTWARE. - Display the ball in a TD. - - Color of the ball or null to skip drawing. + Display the build status icon in a table cell. + + Icon to be displayed. Specifies the size of the icon. If unspecified, it inherits from @@ -56,33 +56,42 @@ THE SOFTWARE. - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + From e1dff1ae2922cf995e7e2917c0d2818e60b0f0f8 Mon Sep 17 00:00:00 2001 From: Tim Jacomb Date: Tue, 31 Dec 2024 19:46:12 +0000 Subject: [PATCH 2/2] Adjust test --- test/src/test/java/lib/layout/IconTest.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/test/src/test/java/lib/layout/IconTest.java b/test/src/test/java/lib/layout/IconTest.java index 033d8f161a7e..ef5043ee4309 100644 --- a/test/src/test/java/lib/layout/IconTest.java +++ b/test/src/test/java/lib/layout/IconTest.java @@ -93,11 +93,14 @@ public void testBallColorTd() throws Exception { HtmlPage p = j.createWebClient().goTo("testBallColorTd"); DomElement ballColorAborted = p.getElementById("ballColorAborted"); - List ballIcons = StreamSupport.stream(ballColorAborted.getChildElements().spliterator(), false).collect(Collectors.toList()); - assertIconToSvgIconOkay(ballIcons.get(0).getFirstElementChild(), "icon-aborted icon-md"); + assertThat("Aborted", is(ballColorAborted.getTextContent())); + HtmlElement symbol = ballColorAborted.getElementsByTagName("svg").get(0); + assertThat("icon-md", is(symbol.getAttribute("class"))); + + assertIconToSymbolOkay(symbol); DomElement statusIcons = p.getElementById("statusIcons"); - List statusIconsList = StreamSupport.stream(statusIcons.getChildElements().spliterator(), false).collect(Collectors.toList()); + List statusIconsList = StreamSupport.stream(statusIcons.getChildElements().spliterator(), false).toList(); assertIconToSvgOkay(statusIconsList.get(0).getFirstElementChild().getNextElementSibling(), "icon-user icon-xlg"); @@ -182,13 +185,6 @@ private void assertIconToSvgOkay(DomElement icon, String classSpec) { } } - private void assertIconToSvgIconOkay(DomElement icon, String classSpec) { - assertThat(icon.getTagName(), is("span")); - if (classSpec != null) { - assertThat(icon.getAttribute("class"), endsWith(classSpec)); - } - } - private void assertIconToSymbolOkay(DomElement icon) { assertThat("svg", is(icon.getTagName())); }