From 0d8e1a2eca754f5025d7fc3c91df745a8d997178 Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Wed, 23 Aug 2023 21:35:06 +0100 Subject: [PATCH 01/25] Init --- core/src/main/java/hudson/Functions.java | 12 ++++ .../lib/layout/keyboard-shortcut.jelly | 56 +++++++++++++++++ .../resources/lib/layout/search-bar.jelly | 7 ++- war/src/main/scss/components/_tooltips.scss | 60 +++++++++++++++++++ 4 files changed, 134 insertions(+), 1 deletion(-) create mode 100644 core/src/main/resources/lib/layout/keyboard-shortcut.jelly diff --git a/core/src/main/java/hudson/Functions.java b/core/src/main/java/hudson/Functions.java index 7f3411406780..8e6ac5683c48 100644 --- a/core/src/main/java/hudson/Functions.java +++ b/core/src/main/java/hudson/Functions.java @@ -2455,4 +2455,16 @@ static String guessIcon(String iconGuess, String rootURL) { public static String generateItemId() { return String.valueOf(Math.floor(Math.random() * 3000)); } + + @Restricted(NoExternalUse.class) + public static String translateModifierKeysForUsersPlatform(String keyboardShortcut) { + StaplerRequest currentRequest = Stapler.getCurrentRequest(); + currentRequest.getWebApp().getDispatchValidator().allowDispatch(currentRequest, Stapler.getCurrentResponse()); + String userAgent = currentRequest.getHeader("User-Agent"); + + List platformsThatUseCommand = List.of("MAC", "IPHONE", "IPAD"); + boolean useCmdKey = platformsThatUseCommand.stream().anyMatch(e -> userAgent.toUpperCase().contains(e)); + + return keyboardShortcut.replace("CMD", useCmdKey ? "⌘" : "CTRL"); + } } diff --git a/core/src/main/resources/lib/layout/keyboard-shortcut.jelly b/core/src/main/resources/lib/layout/keyboard-shortcut.jelly new file mode 100644 index 000000000000..92bbf4a59470 --- /dev/null +++ b/core/src/main/resources/lib/layout/keyboard-shortcut.jelly @@ -0,0 +1,56 @@ + + + + + + + Optional prefix to the shortcut + + + Optional suffix to the shortcut + + Displays a keyboard shortcut chip based on the component's body. + CMD/CTRL will automatically be translated to the user's operating system's appropriate variant. + + +
+ + + ${attrs.prefix} + + +
+ + + + +
+ + + ${attrs.suffix} + + +
+
diff --git a/core/src/main/resources/lib/layout/search-bar.jelly b/core/src/main/resources/lib/layout/search-bar.jelly index b86a15fef0d6..8dbe681fef93 100644 --- a/core/src/main/resources/lib/layout/search-bar.jelly +++ b/core/src/main/resources/lib/layout/search-bar.jelly @@ -58,7 +58,12 @@ THE SOFTWARE. spellcheck="false" disabled="${attrs.enabled == false ? true : null}" /> -
+ + + + + +
diff --git a/war/src/main/scss/components/_tooltips.scss b/war/src/main/scss/components/_tooltips.scss index 80a030b8c9c3..566093bb98fd 100644 --- a/war/src/main/scss/components/_tooltips.scss +++ b/war/src/main/scss/components/_tooltips.scss @@ -51,3 +51,63 @@ .jenkins-table .healthReportDetails { display: none !important; } + +.jenkins-tooltip__keyboard-shortcut { + display: flex; + align-items: center; + justify-content: center; + gap: 0.6ch; + + &__symbol { + position: relative; + display: inline-flex; + align-items: center; + justify-content: center; + min-width: 1.7em; + height: 1.7em; + padding-inline: 0.5ch; + + &::before, + &::after { + content: ""; + position: absolute; + inset: 0; + border-radius: 0.375rem; + border: 0.1rem solid var(--text-color-secondary); + opacity: 0.3; + } + + &::after { + mask-image: linear-gradient( + -45deg, + transparent 40%, + white, + transparent 60% + ); + mask-size: 200% 200%; + mask-position: center; + animation: shortcut-glow-animation 1.25s forwards linear; + } + + svg { + width: 1em; + height: 1em; + } + + @keyframes shortcut-glow-animation { + 0% { + opacity: 0; + mask-position: 100% 100%; + } + + 50% { + opacity: 1; + } + + 100% { + opacity: 0; + mask-position: 0; + } + } + } +} From 1783029921aa722b37fd59f58e027fd84fc0ec09 Mon Sep 17 00:00:00 2001 From: Tim Jacomb Date: Fri, 25 Aug 2023 22:03:11 +0100 Subject: [PATCH 02/25] yarn lint:fix --- war/src/main/scss/components/_tooltips.scss | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/war/src/main/scss/components/_tooltips.scss b/war/src/main/scss/components/_tooltips.scss index 566093bb98fd..972db7310a36 100644 --- a/war/src/main/scss/components/_tooltips.scss +++ b/war/src/main/scss/components/_tooltips.scss @@ -79,10 +79,10 @@ &::after { mask-image: linear-gradient( - -45deg, - transparent 40%, - white, - transparent 60% + -45deg, + transparent 40%, + white, + transparent 60% ); mask-size: 200% 200%; mask-position: center; From 3996dc06fb0238b4eee2d71d8f67a8f10b320067 Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Mon, 20 Nov 2023 15:26:36 +0000 Subject: [PATCH 03/25] Address comments --- core/src/main/java/hudson/Functions.java | 4 ++++ core/src/main/resources/lib/layout/keyboard-shortcut.jelly | 6 +++--- war/src/main/scss/components/_tooltips.scss | 1 - 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/hudson/Functions.java b/core/src/main/java/hudson/Functions.java index c12d1846181e..86d9e9c55d29 100644 --- a/core/src/main/java/hudson/Functions.java +++ b/core/src/main/java/hudson/Functions.java @@ -2475,6 +2475,10 @@ public static String generateItemId() { return String.valueOf(Math.floor(Math.random() * 3000)); } + /** + * @param keyboardShortcut the shortcut to be translated + * @return the translated shortcut, e.g. CMD+K -> ⌘+K for macOS, CTRL+K for Windows + */ @Restricted(NoExternalUse.class) public static String translateModifierKeysForUsersPlatform(String keyboardShortcut) { StaplerRequest currentRequest = Stapler.getCurrentRequest(); diff --git a/core/src/main/resources/lib/layout/keyboard-shortcut.jelly b/core/src/main/resources/lib/layout/keyboard-shortcut.jelly index 92bbf4a59470..56dfa40c128e 100644 --- a/core/src/main/resources/lib/layout/keyboard-shortcut.jelly +++ b/core/src/main/resources/lib/layout/keyboard-shortcut.jelly @@ -32,11 +32,11 @@ THE SOFTWARE. Optional suffix to the shortcut Displays a keyboard shortcut chip based on the component's body. - CMD/CTRL will automatically be translated to the user's operating system's appropriate variant. + CMD will automatically be translated to the user's operating system's appropriate variant.
- + ${attrs.prefix} @@ -47,7 +47,7 @@ THE SOFTWARE.
- + ${attrs.suffix} diff --git a/war/src/main/scss/components/_tooltips.scss b/war/src/main/scss/components/_tooltips.scss index 972db7310a36..6743f6c88180 100644 --- a/war/src/main/scss/components/_tooltips.scss +++ b/war/src/main/scss/components/_tooltips.scss @@ -85,7 +85,6 @@ transparent 60% ); mask-size: 200% 200%; - mask-position: center; animation: shortcut-glow-animation 1.25s forwards linear; } From 8c2ef1a2aafd7f258128e503c3323253ce65b659 Mon Sep 17 00:00:00 2001 From: Tim Jacomb Date: Sat, 16 Dec 2023 21:48:24 +0000 Subject: [PATCH 04/25] Update localisation --- core/src/main/resources/lib/layout/search-bar_pl.properties | 3 ++- core/src/main/resources/lib/layout/search-bar_pt_BR.properties | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/main/resources/lib/layout/search-bar_pl.properties b/core/src/main/resources/lib/layout/search-bar_pl.properties index 1404a046d112..981d1139e20b 100644 --- a/core/src/main/resources/lib/layout/search-bar_pl.properties +++ b/core/src/main/resources/lib/layout/search-bar_pl.properties @@ -20,4 +20,5 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -Press\ /\ on\ your\ keyboard\ to\ focus=Naciśnij / na klawiaturze, aby przesunąć tutaj kursor +Press=Naciśnij +on\ your\ keyboard\ to\ focus=na klawiaturze, aby przesunąć tutaj kursor diff --git a/core/src/main/resources/lib/layout/search-bar_pt_BR.properties b/core/src/main/resources/lib/layout/search-bar_pt_BR.properties index b676df91ce65..3f18e2c77e31 100644 --- a/core/src/main/resources/lib/layout/search-bar_pt_BR.properties +++ b/core/src/main/resources/lib/layout/search-bar_pt_BR.properties @@ -21,4 +21,5 @@ # THE SOFTWARE. Search=Busca -Press\ /\ on\ your\ keyboard\ to\ focus=Digite /\ no seu teclado para realçar +Press=Digite +on\ your\ keyboard\ to\ focus=no seu teclado para realçar From ce09ad88d41086e7ebaed94c7397ac9aa669e695 Mon Sep 17 00:00:00 2001 From: Tim Jacomb <21194782+timja@users.noreply.github.com> Date: Sun, 17 Dec 2023 08:07:48 +0000 Subject: [PATCH 05/25] Update core/src/main/java/hudson/Functions.java --- core/src/main/java/hudson/Functions.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/Functions.java b/core/src/main/java/hudson/Functions.java index b22f32c2a8d7..a923ada89c9e 100644 --- a/core/src/main/java/hudson/Functions.java +++ b/core/src/main/java/hudson/Functions.java @@ -2481,7 +2481,7 @@ public static String generateItemId() { /** * @param keyboardShortcut the shortcut to be translated - * @return the translated shortcut, e.g. CMD+K -> ⌘+K for macOS, CTRL+K for Windows + * @return the translated shortcut, e.g. CMD+K to ⌘+K for macOS, CTRL+K for Windows */ @Restricted(NoExternalUse.class) public static String translateModifierKeysForUsersPlatform(String keyboardShortcut) { From 5551fc91f2ec11e3115249223f79b3b0d2bd8526 Mon Sep 17 00:00:00 2001 From: Tim Jacomb Date: Wed, 3 Apr 2024 14:36:29 +0100 Subject: [PATCH 06/25] Allow setting empty prefix or suffix --- core/src/main/resources/lib/layout/keyboard-shortcut.jelly | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/resources/lib/layout/keyboard-shortcut.jelly b/core/src/main/resources/lib/layout/keyboard-shortcut.jelly index 56dfa40c128e..4445b3d188bb 100644 --- a/core/src/main/resources/lib/layout/keyboard-shortcut.jelly +++ b/core/src/main/resources/lib/layout/keyboard-shortcut.jelly @@ -36,7 +36,7 @@ THE SOFTWARE.
- + ${attrs.prefix} @@ -47,7 +47,7 @@ THE SOFTWARE.
- + ${attrs.suffix} From f925849ca72c2bdb34497cbed87d9ac05088ce9d Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Sun, 21 Apr 2024 00:08:51 +0200 Subject: [PATCH 07/25] Combine into one format string with escaped format placeholder --- core/src/main/java/hudson/Functions.java | 6 +++++ .../lib/layout/keyboard-shortcut.jelly | 27 +++++-------------- .../resources/lib/layout/search-bar.jelly | 2 +- .../lib/layout/search-bar_pl.properties | 3 +-- .../lib/layout/search-bar_pt_BR.properties | 3 +-- 5 files changed, 16 insertions(+), 25 deletions(-) diff --git a/core/src/main/java/hudson/Functions.java b/core/src/main/java/hudson/Functions.java index f4bd61351e97..b02bd2b54695 100644 --- a/core/src/main/java/hudson/Functions.java +++ b/core/src/main/java/hudson/Functions.java @@ -117,6 +117,7 @@ import java.nio.charset.StandardCharsets; import java.text.DateFormat; import java.text.DecimalFormat; +import java.text.MessageFormat; import java.time.ZoneId; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; @@ -2505,4 +2506,9 @@ public static String translateModifierKeysForUsersPlatform(String keyboardShortc return keyboardShortcut.replace("CMD", useCmdKey ? "⌘" : "CTRL"); } + + @Restricted(NoExternalUse.class) + public static String formatMessage(String format, Object args) { + return MessageFormat.format(format, args); + } } diff --git a/core/src/main/resources/lib/layout/keyboard-shortcut.jelly b/core/src/main/resources/lib/layout/keyboard-shortcut.jelly index 4445b3d188bb..bd41355559ad 100644 --- a/core/src/main/resources/lib/layout/keyboard-shortcut.jelly +++ b/core/src/main/resources/lib/layout/keyboard-shortcut.jelly @@ -25,32 +25,19 @@ THE SOFTWARE. - - Optional prefix to the shortcut - - - Optional suffix to the shortcut + + Optional message for the shortcut Displays a keyboard shortcut chip based on the component's body. CMD will automatically be translated to the user's operating system's appropriate variant.
- - - ${attrs.prefix} - - -
- + +
- - -
- - - ${attrs.suffix} - - +
+ +
diff --git a/core/src/main/resources/lib/layout/search-bar.jelly b/core/src/main/resources/lib/layout/search-bar.jelly index 8dbe681fef93..1e77c2be8a21 100644 --- a/core/src/main/resources/lib/layout/search-bar.jelly +++ b/core/src/main/resources/lib/layout/search-bar.jelly @@ -59,7 +59,7 @@ THE SOFTWARE. disabled="${attrs.enabled == false ? true : null}" /> - + diff --git a/core/src/main/resources/lib/layout/search-bar_pl.properties b/core/src/main/resources/lib/layout/search-bar_pl.properties index 981d1139e20b..b9de372589b4 100644 --- a/core/src/main/resources/lib/layout/search-bar_pl.properties +++ b/core/src/main/resources/lib/layout/search-bar_pl.properties @@ -20,5 +20,4 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -Press=Naciśnij -on\ your\ keyboard\ to\ focus=na klawiaturze, aby przesunąć tutaj kursor +shortcut=Naciśnij '{0}' na klawiaturze, aby przesunąć tutaj kursor diff --git a/core/src/main/resources/lib/layout/search-bar_pt_BR.properties b/core/src/main/resources/lib/layout/search-bar_pt_BR.properties index 3f18e2c77e31..3d3b237a71f2 100644 --- a/core/src/main/resources/lib/layout/search-bar_pt_BR.properties +++ b/core/src/main/resources/lib/layout/search-bar_pt_BR.properties @@ -21,5 +21,4 @@ # THE SOFTWARE. Search=Busca -Press=Digite -on\ your\ keyboard\ to\ focus=no seu teclado para realçar +shortcut=Digite '{0}' no seu teclado para realçar From b0d87b9ada3710aa35ce6bf3a90c7e88af15080c Mon Sep 17 00:00:00 2001 From: Tim Jacomb Date: Wed, 29 May 2024 21:29:14 +0100 Subject: [PATCH 08/25] Add english default message --- .../lib/layout/search-bar.properties | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 core/src/main/resources/lib/layout/search-bar.properties diff --git a/core/src/main/resources/lib/layout/search-bar.properties b/core/src/main/resources/lib/layout/search-bar.properties new file mode 100644 index 000000000000..5a17184bb037 --- /dev/null +++ b/core/src/main/resources/lib/layout/search-bar.properties @@ -0,0 +1,23 @@ +# The MIT License +# +# Copyright (c) 2023, Damian Szczepanik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +shortcut=Press '{0}' on your keyboard to focus From 02a8466f6bd0861a3a11cca8362ccd413e536f51 Mon Sep 17 00:00:00 2001 From: Tim Jacomb Date: Mon, 3 Jun 2024 16:22:25 +0100 Subject: [PATCH 09/25] More detailed wording for message attribute --- core/src/main/resources/lib/layout/keyboard-shortcut.jelly | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/resources/lib/layout/keyboard-shortcut.jelly b/core/src/main/resources/lib/layout/keyboard-shortcut.jelly index bd41355559ad..209ffabcf993 100644 --- a/core/src/main/resources/lib/layout/keyboard-shortcut.jelly +++ b/core/src/main/resources/lib/layout/keyboard-shortcut.jelly @@ -26,7 +26,7 @@ THE SOFTWARE. - Optional message for the shortcut + Tooltip message for the shortcut. Use the placeholder {0} escaped (wrapped in '). A minimal message consisting of only the shortcut would be '{0}'. Displays a keyboard shortcut chip based on the component's body. CMD will automatically be translated to the user's operating system's appropriate variant. From 08c24de7f4552bf1ed25c875b5251b50a24bbb4b Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Sun, 4 Aug 2024 15:53:50 +0100 Subject: [PATCH 10/25] Update keyboard shortcut component --- .../lib/layout/keyboard-shortcut.jelly | 49 +++++++-- .../resources/lib/layout/search-bar.jelly | 9 +- war/src/main/scss/components/_tooltips.scss | 100 ++++++++++-------- war/src/main/scss/form/_search-bar.scss | 43 +++----- 4 files changed, 105 insertions(+), 96 deletions(-) diff --git a/core/src/main/resources/lib/layout/keyboard-shortcut.jelly b/core/src/main/resources/lib/layout/keyboard-shortcut.jelly index 209ffabcf993..0e9ebf9395ab 100644 --- a/core/src/main/resources/lib/layout/keyboard-shortcut.jelly +++ b/core/src/main/resources/lib/layout/keyboard-shortcut.jelly @@ -23,21 +23,48 @@ THE SOFTWARE. --> - + + + The shortcut to display + + CMD will automatically be translated to the user's operating system's appropriate variant + + This attribute also supports Jenkins Symbols, values prefixed with 'symbol-' will be displayed as expected + - Tooltip message for the shortcut. Use the placeholder {0} escaped (wrapped in '). A minimal message consisting of only the shortcut would be '{0}'. + Optional tooltip message for the shortcut. Use the placeholder {0} escaped (wrapped in '). A minimal message consisting of + only the shortcut would be '{0}' - Displays a keyboard shortcut chip based on the component's body. - CMD will automatically be translated to the user's operating system's appropriate variant. + Displays a keyboard shortcut chip -
- -
- -
-
- + +
+ +
+ + + + + + ${attrs.shortcut} + + +
+
+ +
+
+ +
+ + + + + + ${h.translateModifierKeysForUsersPlatform(attrs.shortcut)} + +
diff --git a/core/src/main/resources/lib/layout/search-bar.jelly b/core/src/main/resources/lib/layout/search-bar.jelly index 3998c8c3634c..2d67a3512f7f 100644 --- a/core/src/main/resources/lib/layout/search-bar.jelly +++ b/core/src/main/resources/lib/layout/search-bar.jelly @@ -58,14 +58,7 @@ THE SOFTWARE. spellcheck="false" disabled="${attrs.enabled == false ? true : null}" /> - - - - - -
- -
+
diff --git a/war/src/main/scss/components/_tooltips.scss b/war/src/main/scss/components/_tooltips.scss index 9cec0576d88e..a88e40bedc3d 100644 --- a/war/src/main/scss/components/_tooltips.scss +++ b/war/src/main/scss/components/_tooltips.scss @@ -29,45 +29,8 @@ margin: 0; width: 450px; } -} - -.tippy-box[data-animation="tooltip"][data-state="hidden"] { - opacity: 0; - transform: scale(0.995); - &[data-placement^="top"] { - transform-origin: bottom; - transform: translateY(2px) scale(0.995); - } - - &[data-placement^="bottom"] { - transform-origin: top; - transform: translateY(-2px) scale(0.995); - } -} - -// Workaround for NG Warnings which supports modern Tippy tooltips and a custom solution, -// hide the custom solution -.jenkins-table .healthReportDetails { - display: none !important; -} - -.jenkins-tooltip__keyboard-shortcut { - display: flex; - align-items: center; - justify-content: center; - gap: 0.6ch; - - &__symbol { - position: relative; - display: inline-flex; - align-items: center; - justify-content: center; - min-width: 1.7em; - height: 1.7em; - padding-inline: 0.5ch; - - &::before, + .jenkins-keyboard-shortcut { &::after { content: ""; position: absolute; @@ -75,9 +38,6 @@ border-radius: 0.375rem; border: 0.1rem solid var(--text-color-secondary); opacity: 0.3; - } - - &::after { mask-image: linear-gradient( -45deg, transparent 40%, @@ -88,11 +48,6 @@ animation: shortcut-glow-animation 1.25s forwards linear; } - svg { - width: 1em; - height: 1em; - } - @keyframes shortcut-glow-animation { 0% { opacity: 0; @@ -110,3 +65,56 @@ } } } + +.tippy-box[data-animation="tooltip"][data-state="hidden"] { + opacity: 0; + transform: scale(0.995); + + &[data-placement^="top"] { + transform-origin: bottom; + transform: translateY(2px) scale(0.995); + } + + &[data-placement^="bottom"] { + transform-origin: top; + transform: translateY(-2px) scale(0.995); + } +} + +// Workaround for NG Warnings which supports modern Tippy tooltips and a custom solution, +// hide the custom solution +.jenkins-table .healthReportDetails { + display: none !important; +} + +.jenkins-keyboard-shortcut { + position: relative; + display: inline-flex; + align-items: center; + justify-content: center; + min-width: 1.7em; + min-height: 1.7em; + padding-inline: 0.55ch; + + &::before { + content: ""; + position: absolute; + inset: 0; + border-radius: 0.375rem; + border: 0.1rem solid var(--text-color-secondary); + opacity: 0.3; + } + + svg { + width: 1em; + height: 1em; + } +} + +.jenkins-keyboard-shortcut__tooltip { + position: relative; + display: inline-flex; + align-items: center; + justify-content: center; + gap: 0.6ch; +} diff --git a/war/src/main/scss/form/_search-bar.scss b/war/src/main/scss/form/_search-bar.scss index ed552e85c987..1cff381003ed 100644 --- a/war/src/main/scss/form/_search-bar.scss +++ b/war/src/main/scss/form/_search-bar.scss @@ -130,37 +130,14 @@ } } - &__shortcut { + .jenkins-keyboard-shortcut { position: absolute; - aspect-ratio: 1 / 1; - top: 0; - right: 0; - bottom: 0; - display: flex; - align-items: center; - justify-content: center; - transition: 0.25s ease; - text-align: center; - font-size: 0.6875rem; - font-weight: 500; - line-height: 1; + top: calc(50% - 0.6875rem); + right: 0.5rem; + min-width: 1.375rem; + min-height: 1.375rem; + padding: 0; color: var(--text-color-secondary); - - &::after { - content: ""; - position: absolute; - top: calc(50% - 1em); - right: calc(50% - 1em); - width: 2em; - height: 2em; - border: 0.1rem solid var(--item-background--active); - border-radius: 0.3rem; - } - - svg { - width: 1.2em; - height: 1.2em; - } } &--loading { @@ -190,6 +167,10 @@ max-width: 50vw; margin-block: -6px; + .jenkins-keyboard-shortcut { + right: 0.8125rem; + } + &::before { content: ""; position: absolute; @@ -210,7 +191,7 @@ fill: var(--focus-input-border); } - .jenkins-search__shortcut { + .jenkins-keyboard-shortcut { opacity: 0; transform: scale(0.9); pointer-events: none; @@ -221,7 +202,7 @@ color: var(--text-color-secondary); opacity: 0.5; - .jenkins-search__shortcut { + .jenkins-keyboard-shortcut { display: none; } } From f3913dd62c28ae7eebb193a33da5371f7e2a6aec Mon Sep 17 00:00:00 2001 From: Tim Jacomb <21194782+timja@users.noreply.github.com> Date: Mon, 16 Sep 2024 14:15:02 +0100 Subject: [PATCH 11/25] Update core/src/main/java/hudson/Functions.java --- core/src/main/java/hudson/Functions.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/Functions.java b/core/src/main/java/hudson/Functions.java index 0fb0267a4850..7ed2ddbc96a4 100644 --- a/core/src/main/java/hudson/Functions.java +++ b/core/src/main/java/hudson/Functions.java @@ -2584,7 +2584,7 @@ public static String generateItemId() { */ @Restricted(NoExternalUse.class) public static String translateModifierKeysForUsersPlatform(String keyboardShortcut) { - StaplerRequest currentRequest = Stapler.getCurrentRequest(); + StaplerRequest2 currentRequest = Stapler.getCurrentRequest(); currentRequest.getWebApp().getDispatchValidator().allowDispatch(currentRequest, Stapler.getCurrentResponse()); String userAgent = currentRequest.getHeader("User-Agent"); From b89371727b3ca4a9db15a3e741687c6c33f9b752 Mon Sep 17 00:00:00 2001 From: Tim Jacomb Date: Mon, 16 Sep 2024 15:00:33 +0100 Subject: [PATCH 12/25] Adapt for Java EE upgrade --- core/src/main/java/hudson/Functions.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/hudson/Functions.java b/core/src/main/java/hudson/Functions.java index 7ed2ddbc96a4..64add7b35193 100644 --- a/core/src/main/java/hudson/Functions.java +++ b/core/src/main/java/hudson/Functions.java @@ -2584,8 +2584,8 @@ public static String generateItemId() { */ @Restricted(NoExternalUse.class) public static String translateModifierKeysForUsersPlatform(String keyboardShortcut) { - StaplerRequest2 currentRequest = Stapler.getCurrentRequest(); - currentRequest.getWebApp().getDispatchValidator().allowDispatch(currentRequest, Stapler.getCurrentResponse()); + StaplerRequest2 currentRequest = Stapler.getCurrentRequest2(); + currentRequest.getWebApp().getDispatchValidator().allowDispatch(currentRequest, Stapler.getCurrentResponse2()); String userAgent = currentRequest.getHeader("User-Agent"); List platformsThatUseCommand = List.of("MAC", "IPHONE", "IPAD"); From d017d30898a4c2d9caf6a30cfc7b0d5bd8307594 Mon Sep 17 00:00:00 2001 From: Tim Jacomb Date: Mon, 11 Nov 2024 15:09:21 +0000 Subject: [PATCH 13/25] [JENKINS-37241] Support for query parameters in autocomplete --- .../main/java/hudson/model/Descriptor.java | 6 +++++ eslint.config.cjs | 2 ++ .../js/components/dropdowns/autocomplete.js | 27 ++++++++++++++++--- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/hudson/model/Descriptor.java b/core/src/main/java/hudson/model/Descriptor.java index 33c981d657f5..c55b7982695e 100644 --- a/core/src/main/java/hudson/model/Descriptor.java +++ b/core/src/main/java/hudson/model/Descriptor.java @@ -474,6 +474,12 @@ public void calcAutoCompleteSettings(String field, Map attribute if (method == null) return; // no auto-completion + // build query parameter line by figuring out what should be submitted + List depends = buildFillDependencies(method, new ArrayList<>()); + if (!depends.isEmpty()) { + attributes.put("fillDependsOn", String.join(" ", depends)); + } + attributes.put("autoCompleteUrl", String.format("%s/%s/autoComplete%s", getCurrentDescriptorByNameUrl(), getDescriptorUrl(), capitalizedFieldName)); } diff --git a/eslint.config.cjs b/eslint.config.cjs index 0362bf627a7a..dcbd22d73060 100644 --- a/eslint.config.cjs +++ b/eslint.config.cjs @@ -61,6 +61,7 @@ module.exports = [ object: "readonly", objectToUrlFormEncoded: "readonly", onSetupWizardInitialized: "readonly", + qs: "readonly", refillOnChange: "readonly", refreshPart: "readonly", registerSortableDragDrop: "readonly", @@ -72,6 +73,7 @@ module.exports = [ shortenName: "readonly", Sortable: "readonly", toQueryString: "readonly", + TryEach: "readonly", ts_refresh: "readonly", updateOptionalBlock: "readonly", Utilities: "readonly", diff --git a/src/main/js/components/dropdowns/autocomplete.js b/src/main/js/components/dropdowns/autocomplete.js index b6d982c44911..068313f84b36 100644 --- a/src/main/js/components/dropdowns/autocomplete.js +++ b/src/main/js/components/dropdowns/autocomplete.js @@ -59,9 +59,30 @@ function init() { } return; } - const url = - e.getAttribute("autoCompleteUrl") + "?value=" + encodeURIComponent(word); - fetch(url) + + const url = e.getAttribute("autoCompleteUrl"); + + const depends = e.getAttribute("fillDependsOn"); + const q = qs(e).addThis(); + if (depends && depends.length > 0) { + depends.split(" ").forEach( + TryEach(function (n) { + q.nearBy(n); + }), + ); + } + + const queryString = q.toString(); + const idx = queryString.indexOf("?"); + const parameters = queryString.substring(idx + 1); + + fetch(url, { + method: "post", + headers: crumb.wrap({ + "Content-Type": "application/x-www-form-urlencoded", + }), + body: parameters, + }) .then((rsp) => (rsp.ok ? rsp.json() : {})) .then((response) => createAndShowDropdown(e, response.suggestions || [])); } From 28f0d59d1e8fd284db99c5219dda951ec7f4af51 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 4 Dec 2024 22:08:57 +0000 Subject: [PATCH 14/25] Update dependency globals to v15.13.0 --- package.json | 2 +- yarn.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index bfcb2bd931a2..d704dfacb224 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "eslint": "9.16.0", "eslint-config-prettier": "9.1.0", "eslint-formatter-checkstyle": "8.40.0", - "globals": "15.12.0", + "globals": "15.13.0", "handlebars-loader": "1.7.3", "mini-css-extract-plugin": "2.9.2", "postcss": "8.4.49", diff --git a/yarn.lock b/yarn.lock index 1597ad34a3b7..79a87edc2dd8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3961,10 +3961,10 @@ __metadata: languageName: node linkType: hard -"globals@npm:15.12.0": - version: 15.12.0 - resolution: "globals@npm:15.12.0" - checksum: 10c0/f34e0a1845b694f45188331742af9f488b07ba7440a06e9d2039fce0386fbbfc24afdbb9846ebdccd4092d03644e43081c49eb27b30f4b88e43af156e1c1dc34 +"globals@npm:15.13.0": + version: 15.13.0 + resolution: "globals@npm:15.13.0" + checksum: 10c0/640365115ca5f81d91e6a7667f4935021705e61a1a5a76a6ec5c3a5cdf6e53f165af7f9db59b7deb65cf2e1f83d03ac8d6660d0b14c569c831a9b6483eeef585 languageName: node linkType: hard @@ -4380,7 +4380,7 @@ __metadata: eslint: "npm:9.16.0" eslint-config-prettier: "npm:9.1.0" eslint-formatter-checkstyle: "npm:8.40.0" - globals: "npm:15.12.0" + globals: "npm:15.13.0" handlebars: "npm:4.7.8" handlebars-loader: "npm:1.7.3" hotkeys-js: "npm:3.12.2" From e7a8779cc51d355461a4ce5fc75765377cc444d6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 7 Dec 2024 14:10:26 +0000 Subject: [PATCH 15/25] Update dependency sass to v1.82.0 (#10030) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index bfcb2bd931a2..fd3ae217613e 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "postcss-preset-env": "10.1.1", "postcss-scss": "4.0.9", "prettier": "3.4.1", - "sass": "1.81.0", + "sass": "1.82.0", "sass-loader": "16.0.3", "style-loader": "4.0.0", "stylelint": "16.11.0", diff --git a/yarn.lock b/yarn.lock index 1597ad34a3b7..b7db2bbac7cb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4392,7 +4392,7 @@ __metadata: postcss-preset-env: "npm:10.1.1" postcss-scss: "npm:4.0.9" prettier: "npm:3.4.1" - sass: "npm:1.81.0" + sass: "npm:1.82.0" sass-loader: "npm:16.0.3" sortablejs: "npm:1.15.6" style-loader: "npm:4.0.0" @@ -6381,9 +6381,9 @@ __metadata: languageName: node linkType: hard -"sass@npm:1.81.0": - version: 1.81.0 - resolution: "sass@npm:1.81.0" +"sass@npm:1.82.0": + version: 1.82.0 + resolution: "sass@npm:1.82.0" dependencies: "@parcel/watcher": "npm:^2.4.1" chokidar: "npm:^4.0.0" @@ -6394,7 +6394,7 @@ __metadata: optional: true bin: sass: sass.js - checksum: 10c0/9c59b3c9b4231c18fcb4583cc232dbc4de501ddc11101b7a025e44833e3f3ce6031546dc1cd109ee9f04ebcfb1fe30ff870810af33b8feb9aa9e36dfba9ec1ef + checksum: 10c0/7f86fe6ade4f6018862c448ed69d5c52f485b0125c9dab24e63f679739a04cc7c56562d588e3cf16b5efb4d2c4d0530e62740e1cfd273e2e3707d04d11011736 languageName: node linkType: hard From 82d6b6bfaf709d4bcc65c8b56fcbb4515044972c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 7 Dec 2024 14:11:54 +0000 Subject: [PATCH 16/25] Update dependency sass-loader to v16.0.4 --- package.json | 2 +- yarn.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index fd3ae217613e..c72a8b8f7aa2 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "postcss-scss": "4.0.9", "prettier": "3.4.1", "sass": "1.82.0", - "sass-loader": "16.0.3", + "sass-loader": "16.0.4", "style-loader": "4.0.0", "stylelint": "16.11.0", "stylelint-checkstyle-reporter": "1.0.0", diff --git a/yarn.lock b/yarn.lock index b7db2bbac7cb..837e498e7ec4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4393,7 +4393,7 @@ __metadata: postcss-scss: "npm:4.0.9" prettier: "npm:3.4.1" sass: "npm:1.82.0" - sass-loader: "npm:16.0.3" + sass-loader: "npm:16.0.4" sortablejs: "npm:1.15.6" style-loader: "npm:4.0.0" stylelint: "npm:16.11.0" @@ -6355,9 +6355,9 @@ __metadata: languageName: node linkType: hard -"sass-loader@npm:16.0.3": - version: 16.0.3 - resolution: "sass-loader@npm:16.0.3" +"sass-loader@npm:16.0.4": + version: 16.0.4 + resolution: "sass-loader@npm:16.0.4" dependencies: neo-async: "npm:^2.6.2" peerDependencies: @@ -6377,7 +6377,7 @@ __metadata: optional: true webpack: optional: true - checksum: 10c0/2dc188dd0d5276ed0251eee7f245848ccf9df6ec121227462403f322c17a3dbe100fb60d47968f078e585e4aced452eb7fa1a8e55b415d5de3151fa1bbf2d561 + checksum: 10c0/d57c5fa35620e9022cfa3e5d49f3f9b3e54fb8b2fa9d021c10fe26c8c2f77103e038b6540eb20123a6f73aef23d2beb04033d3b7772588ca3f3c0ba2a4ee40ac languageName: node linkType: hard From 4b53f46ae1cebdc0ee0c13241174c1661e64b33b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 7 Dec 2024 14:13:07 +0000 Subject: [PATCH 17/25] Update dependency prettier to v3.4.2 --- package.json | 2 +- yarn.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index fd3ae217613e..f54b7d6bec29 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "postcss-loader": "8.1.1", "postcss-preset-env": "10.1.1", "postcss-scss": "4.0.9", - "prettier": "3.4.1", + "prettier": "3.4.2", "sass": "1.82.0", "sass-loader": "16.0.3", "style-loader": "4.0.0", diff --git a/yarn.lock b/yarn.lock index b7db2bbac7cb..10e5b4ff364f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4391,7 +4391,7 @@ __metadata: postcss-loader: "npm:8.1.1" postcss-preset-env: "npm:10.1.1" postcss-scss: "npm:4.0.9" - prettier: "npm:3.4.1" + prettier: "npm:3.4.2" sass: "npm:1.82.0" sass-loader: "npm:16.0.3" sortablejs: "npm:1.15.6" @@ -6113,12 +6113,12 @@ __metadata: languageName: node linkType: hard -"prettier@npm:3.4.1": - version: 3.4.1 - resolution: "prettier@npm:3.4.1" +"prettier@npm:3.4.2": + version: 3.4.2 + resolution: "prettier@npm:3.4.2" bin: prettier: bin/prettier.cjs - checksum: 10c0/2d6cc3101ad9de72b49c59339480b0983e6ff6742143da0c43f476bf3b5ef88ede42ebd9956d7a0a8fa59f7a5990e8ef03c9ad4c37f7e4c9e5db43ee0853156c + checksum: 10c0/99e076a26ed0aba4ebc043880d0f08bbb8c59a4c6641cdee6cdadf2205bdd87aa1d7823f50c3aea41e015e99878d37c58d7b5f0e663bba0ef047f94e36b96446 languageName: node linkType: hard From 43e0849ac233dde2cfdc917c80fdad21173d69c1 Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Sat, 7 Dec 2024 19:05:09 +0000 Subject: [PATCH 18/25] Fix toggleswitch attributes --- .../src/main/resources/lib/form/toggleSwitch.jelly | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core/src/main/resources/lib/form/toggleSwitch.jelly b/core/src/main/resources/lib/form/toggleSwitch.jelly index 2a2da3e94eb4..b0c9fcf5f835 100644 --- a/core/src/main/resources/lib/form/toggleSwitch.jelly +++ b/core/src/main/resources/lib/form/toggleSwitch.jelly @@ -76,19 +76,19 @@ THE SOFTWARE. disabled="${readOnlyMode ? 'true' : null}" checked="${value ? 'true' : null}"/> - - ${description} + + ${attrs.description} From 74ac9582c10819814657b9561f58e6387900ee9f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 7 Dec 2024 19:24:08 +0000 Subject: [PATCH 19/25] Update dependency webpack to v5.97.0 (#10031) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 200 +++++++++++++++++++++++++-------------------------- 2 files changed, 101 insertions(+), 101 deletions(-) diff --git a/package.json b/package.json index b0e7442ef1d2..f1d27f1258ab 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "stylelint": "16.11.0", "stylelint-checkstyle-reporter": "1.0.0", "stylelint-config-standard": "36.0.1", - "webpack": "5.96.1", + "webpack": "5.97.0", "webpack-cli": "5.1.4", "webpack-remove-empty-scripts": "1.0.4" }, diff --git a/yarn.lock b/yarn.lock index 0f691cfbd857..ca94cf7169e0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2212,154 +2212,154 @@ __metadata: languageName: node linkType: hard -"@webassemblyjs/ast@npm:1.12.1, @webassemblyjs/ast@npm:^1.12.1": - version: 1.12.1 - resolution: "@webassemblyjs/ast@npm:1.12.1" +"@webassemblyjs/ast@npm:1.14.1, @webassemblyjs/ast@npm:^1.14.1": + version: 1.14.1 + resolution: "@webassemblyjs/ast@npm:1.14.1" dependencies: - "@webassemblyjs/helper-numbers": "npm:1.11.6" - "@webassemblyjs/helper-wasm-bytecode": "npm:1.11.6" - checksum: 10c0/ba7f2b96c6e67e249df6156d02c69eb5f1bd18d5005303cdc42accb053bebbbde673826e54db0437c9748e97abd218366a1d13fa46859b23cde611b6b409998c + "@webassemblyjs/helper-numbers": "npm:1.13.2" + "@webassemblyjs/helper-wasm-bytecode": "npm:1.13.2" + checksum: 10c0/67a59be8ed50ddd33fbb2e09daa5193ac215bf7f40a9371be9a0d9797a114d0d1196316d2f3943efdb923a3d809175e1563a3cb80c814fb8edccd1e77494972b languageName: node linkType: hard -"@webassemblyjs/floating-point-hex-parser@npm:1.11.6": - version: 1.11.6 - resolution: "@webassemblyjs/floating-point-hex-parser@npm:1.11.6" - checksum: 10c0/37fe26f89e18e4ca0e7d89cfe3b9f17cfa327d7daf906ae01400416dbb2e33c8a125b4dc55ad7ff405e5fcfb6cf0d764074c9bc532b9a31a71e762be57d2ea0a +"@webassemblyjs/floating-point-hex-parser@npm:1.13.2": + version: 1.13.2 + resolution: "@webassemblyjs/floating-point-hex-parser@npm:1.13.2" + checksum: 10c0/0e88bdb8b50507d9938be64df0867f00396b55eba9df7d3546eb5dc0ca64d62e06f8d881ec4a6153f2127d0f4c11d102b6e7d17aec2f26bb5ff95a5e60652412 languageName: node linkType: hard -"@webassemblyjs/helper-api-error@npm:1.11.6": - version: 1.11.6 - resolution: "@webassemblyjs/helper-api-error@npm:1.11.6" - checksum: 10c0/a681ed51863e4ff18cf38d223429f414894e5f7496856854d9a886eeddcee32d7c9f66290f2919c9bb6d2fc2b2fae3f989b6a1e02a81e829359738ea0c4d371a +"@webassemblyjs/helper-api-error@npm:1.13.2": + version: 1.13.2 + resolution: "@webassemblyjs/helper-api-error@npm:1.13.2" + checksum: 10c0/31be497f996ed30aae4c08cac3cce50c8dcd5b29660383c0155fce1753804fc55d47fcba74e10141c7dd2899033164e117b3bcfcda23a6b043e4ded4f1003dfb languageName: node linkType: hard -"@webassemblyjs/helper-buffer@npm:1.12.1": - version: 1.12.1 - resolution: "@webassemblyjs/helper-buffer@npm:1.12.1" - checksum: 10c0/0270724afb4601237410f7fd845ab58ccda1d5456a8783aadfb16eaaf3f2c9610c28e4a5bcb6ad880cde5183c82f7f116d5ccfc2310502439d33f14b6888b48a +"@webassemblyjs/helper-buffer@npm:1.14.1": + version: 1.14.1 + resolution: "@webassemblyjs/helper-buffer@npm:1.14.1" + checksum: 10c0/0d54105dc373c0fe6287f1091e41e3a02e36cdc05e8cf8533cdc16c59ff05a646355415893449d3768cda588af451c274f13263300a251dc11a575bc4c9bd210 languageName: node linkType: hard -"@webassemblyjs/helper-numbers@npm:1.11.6": - version: 1.11.6 - resolution: "@webassemblyjs/helper-numbers@npm:1.11.6" +"@webassemblyjs/helper-numbers@npm:1.13.2": + version: 1.13.2 + resolution: "@webassemblyjs/helper-numbers@npm:1.13.2" dependencies: - "@webassemblyjs/floating-point-hex-parser": "npm:1.11.6" - "@webassemblyjs/helper-api-error": "npm:1.11.6" + "@webassemblyjs/floating-point-hex-parser": "npm:1.13.2" + "@webassemblyjs/helper-api-error": "npm:1.13.2" "@xtuc/long": "npm:4.2.2" - checksum: 10c0/c7d5afc0ff3bd748339b466d8d2f27b908208bf3ff26b2e8e72c39814479d486e0dca6f3d4d776fd9027c1efe05b5c0716c57a23041eb34473892b2731c33af3 + checksum: 10c0/9c46852f31b234a8fb5a5a9d3f027bc542392a0d4de32f1a9c0075d5e8684aa073cb5929b56df565500b3f9cc0a2ab983b650314295b9bf208d1a1651bfc825a languageName: node linkType: hard -"@webassemblyjs/helper-wasm-bytecode@npm:1.11.6": - version: 1.11.6 - resolution: "@webassemblyjs/helper-wasm-bytecode@npm:1.11.6" - checksum: 10c0/79d2bebdd11383d142745efa32781249745213af8e022651847382685ca76709f83e1d97adc5f0d3c2b8546bf02864f8b43a531fdf5ca0748cb9e4e0ef2acaa5 +"@webassemblyjs/helper-wasm-bytecode@npm:1.13.2": + version: 1.13.2 + resolution: "@webassemblyjs/helper-wasm-bytecode@npm:1.13.2" + checksum: 10c0/c4355d14f369b30cf3cbdd3acfafc7d0488e086be6d578e3c9780bd1b512932352246be96e034e2a7fcfba4f540ec813352f312bfcbbfe5bcfbf694f82ccc682 languageName: node linkType: hard -"@webassemblyjs/helper-wasm-section@npm:1.12.1": - version: 1.12.1 - resolution: "@webassemblyjs/helper-wasm-section@npm:1.12.1" +"@webassemblyjs/helper-wasm-section@npm:1.14.1": + version: 1.14.1 + resolution: "@webassemblyjs/helper-wasm-section@npm:1.14.1" dependencies: - "@webassemblyjs/ast": "npm:1.12.1" - "@webassemblyjs/helper-buffer": "npm:1.12.1" - "@webassemblyjs/helper-wasm-bytecode": "npm:1.11.6" - "@webassemblyjs/wasm-gen": "npm:1.12.1" - checksum: 10c0/0546350724d285ae3c26e6fc444be4c3b5fb824f3be0ec8ceb474179dc3f4430336dd2e36a44b3e3a1a6815960e5eec98cd9b3a8ec66dc53d86daedd3296a6a2 + "@webassemblyjs/ast": "npm:1.14.1" + "@webassemblyjs/helper-buffer": "npm:1.14.1" + "@webassemblyjs/helper-wasm-bytecode": "npm:1.13.2" + "@webassemblyjs/wasm-gen": "npm:1.14.1" + checksum: 10c0/1f9b33731c3c6dbac3a9c483269562fa00d1b6a4e7133217f40e83e975e636fd0f8736e53abd9a47b06b66082ecc976c7384391ab0a68e12d509ea4e4b948d64 languageName: node linkType: hard -"@webassemblyjs/ieee754@npm:1.11.6": - version: 1.11.6 - resolution: "@webassemblyjs/ieee754@npm:1.11.6" +"@webassemblyjs/ieee754@npm:1.13.2": + version: 1.13.2 + resolution: "@webassemblyjs/ieee754@npm:1.13.2" dependencies: "@xtuc/ieee754": "npm:^1.2.0" - checksum: 10c0/59de0365da450322c958deadade5ec2d300c70f75e17ae55de3c9ce564deff5b429e757d107c7ec69bd0ba169c6b6cc2ff66293ab7264a7053c829b50ffa732f + checksum: 10c0/2e732ca78c6fbae3c9b112f4915d85caecdab285c0b337954b180460290ccd0fb00d2b1dc4bb69df3504abead5191e0d28d0d17dfd6c9d2f30acac8c4961c8a7 languageName: node linkType: hard -"@webassemblyjs/leb128@npm:1.11.6": - version: 1.11.6 - resolution: "@webassemblyjs/leb128@npm:1.11.6" +"@webassemblyjs/leb128@npm:1.13.2": + version: 1.13.2 + resolution: "@webassemblyjs/leb128@npm:1.13.2" dependencies: "@xtuc/long": "npm:4.2.2" - checksum: 10c0/cb344fc04f1968209804de4da018679c5d4708a03b472a33e0fa75657bb024978f570d3ccf9263b7f341f77ecaa75d0e051b9cd4b7bb17a339032cfd1c37f96e + checksum: 10c0/dad5ef9e383c8ab523ce432dfd80098384bf01c45f70eb179d594f85ce5db2f80fa8c9cba03adafd85684e6d6310f0d3969a882538975989919329ac4c984659 languageName: node linkType: hard -"@webassemblyjs/utf8@npm:1.11.6": - version: 1.11.6 - resolution: "@webassemblyjs/utf8@npm:1.11.6" - checksum: 10c0/14d6c24751a89ad9d801180b0d770f30a853c39f035a15fbc96266d6ac46355227abd27a3fd2eeaa97b4294ced2440a6b012750ae17bafe1a7633029a87b6bee +"@webassemblyjs/utf8@npm:1.13.2": + version: 1.13.2 + resolution: "@webassemblyjs/utf8@npm:1.13.2" + checksum: 10c0/d3fac9130b0e3e5a1a7f2886124a278e9323827c87a2b971e6d0da22a2ba1278ac9f66a4f2e363ecd9fac8da42e6941b22df061a119e5c0335f81006de9ee799 languageName: node linkType: hard -"@webassemblyjs/wasm-edit@npm:^1.12.1": - version: 1.12.1 - resolution: "@webassemblyjs/wasm-edit@npm:1.12.1" +"@webassemblyjs/wasm-edit@npm:^1.14.1": + version: 1.14.1 + resolution: "@webassemblyjs/wasm-edit@npm:1.14.1" dependencies: - "@webassemblyjs/ast": "npm:1.12.1" - "@webassemblyjs/helper-buffer": "npm:1.12.1" - "@webassemblyjs/helper-wasm-bytecode": "npm:1.11.6" - "@webassemblyjs/helper-wasm-section": "npm:1.12.1" - "@webassemblyjs/wasm-gen": "npm:1.12.1" - "@webassemblyjs/wasm-opt": "npm:1.12.1" - "@webassemblyjs/wasm-parser": "npm:1.12.1" - "@webassemblyjs/wast-printer": "npm:1.12.1" - checksum: 10c0/972f5e6c522890743999e0ed45260aae728098801c6128856b310dd21f1ee63435fc7b518e30e0ba1cdafd0d1e38275829c1e4451c3536a1d9e726e07a5bba0b + "@webassemblyjs/ast": "npm:1.14.1" + "@webassemblyjs/helper-buffer": "npm:1.14.1" + "@webassemblyjs/helper-wasm-bytecode": "npm:1.13.2" + "@webassemblyjs/helper-wasm-section": "npm:1.14.1" + "@webassemblyjs/wasm-gen": "npm:1.14.1" + "@webassemblyjs/wasm-opt": "npm:1.14.1" + "@webassemblyjs/wasm-parser": "npm:1.14.1" + "@webassemblyjs/wast-printer": "npm:1.14.1" + checksum: 10c0/5ac4781086a2ca4b320bdbfd965a209655fe8a208ca38d89197148f8597e587c9a2c94fb6bd6f1a7dbd4527c49c6844fcdc2af981f8d793a97bf63a016aa86d2 languageName: node linkType: hard -"@webassemblyjs/wasm-gen@npm:1.12.1": - version: 1.12.1 - resolution: "@webassemblyjs/wasm-gen@npm:1.12.1" +"@webassemblyjs/wasm-gen@npm:1.14.1": + version: 1.14.1 + resolution: "@webassemblyjs/wasm-gen@npm:1.14.1" dependencies: - "@webassemblyjs/ast": "npm:1.12.1" - "@webassemblyjs/helper-wasm-bytecode": "npm:1.11.6" - "@webassemblyjs/ieee754": "npm:1.11.6" - "@webassemblyjs/leb128": "npm:1.11.6" - "@webassemblyjs/utf8": "npm:1.11.6" - checksum: 10c0/1e257288177af9fa34c69cab94f4d9036ebed611f77f3897c988874e75182eeeec759c79b89a7a49dd24624fc2d3d48d5580b62b67c4a1c9bfbdcd266b281c16 + "@webassemblyjs/ast": "npm:1.14.1" + "@webassemblyjs/helper-wasm-bytecode": "npm:1.13.2" + "@webassemblyjs/ieee754": "npm:1.13.2" + "@webassemblyjs/leb128": "npm:1.13.2" + "@webassemblyjs/utf8": "npm:1.13.2" + checksum: 10c0/d678810d7f3f8fecb2e2bdadfb9afad2ec1d2bc79f59e4711ab49c81cec578371e22732d4966f59067abe5fba8e9c54923b57060a729d28d408e608beef67b10 languageName: node linkType: hard -"@webassemblyjs/wasm-opt@npm:1.12.1": - version: 1.12.1 - resolution: "@webassemblyjs/wasm-opt@npm:1.12.1" +"@webassemblyjs/wasm-opt@npm:1.14.1": + version: 1.14.1 + resolution: "@webassemblyjs/wasm-opt@npm:1.14.1" dependencies: - "@webassemblyjs/ast": "npm:1.12.1" - "@webassemblyjs/helper-buffer": "npm:1.12.1" - "@webassemblyjs/wasm-gen": "npm:1.12.1" - "@webassemblyjs/wasm-parser": "npm:1.12.1" - checksum: 10c0/992a45e1f1871033c36987459436ab4e6430642ca49328e6e32a13de9106fe69ae6c0ac27d7050efd76851e502d11cd1ac0e06b55655dfa889ad82f11a2712fb + "@webassemblyjs/ast": "npm:1.14.1" + "@webassemblyjs/helper-buffer": "npm:1.14.1" + "@webassemblyjs/wasm-gen": "npm:1.14.1" + "@webassemblyjs/wasm-parser": "npm:1.14.1" + checksum: 10c0/515bfb15277ee99ba6b11d2232ddbf22aed32aad6d0956fe8a0a0a004a1b5a3a277a71d9a3a38365d0538ac40d1b7b7243b1a244ad6cd6dece1c1bb2eb5de7ee languageName: node linkType: hard -"@webassemblyjs/wasm-parser@npm:1.12.1, @webassemblyjs/wasm-parser@npm:^1.12.1": - version: 1.12.1 - resolution: "@webassemblyjs/wasm-parser@npm:1.12.1" +"@webassemblyjs/wasm-parser@npm:1.14.1, @webassemblyjs/wasm-parser@npm:^1.14.1": + version: 1.14.1 + resolution: "@webassemblyjs/wasm-parser@npm:1.14.1" dependencies: - "@webassemblyjs/ast": "npm:1.12.1" - "@webassemblyjs/helper-api-error": "npm:1.11.6" - "@webassemblyjs/helper-wasm-bytecode": "npm:1.11.6" - "@webassemblyjs/ieee754": "npm:1.11.6" - "@webassemblyjs/leb128": "npm:1.11.6" - "@webassemblyjs/utf8": "npm:1.11.6" - checksum: 10c0/e85cec1acad07e5eb65b92d37c8e6ca09c6ca50d7ca58803a1532b452c7321050a0328c49810c337cc2dfd100c5326a54d5ebd1aa5c339ebe6ef10c250323a0e + "@webassemblyjs/ast": "npm:1.14.1" + "@webassemblyjs/helper-api-error": "npm:1.13.2" + "@webassemblyjs/helper-wasm-bytecode": "npm:1.13.2" + "@webassemblyjs/ieee754": "npm:1.13.2" + "@webassemblyjs/leb128": "npm:1.13.2" + "@webassemblyjs/utf8": "npm:1.13.2" + checksum: 10c0/95427b9e5addbd0f647939bd28e3e06b8deefdbdadcf892385b5edc70091bf9b92fa5faac3fce8333554437c5d85835afef8c8a7d9d27ab6ba01ffab954db8c6 languageName: node linkType: hard -"@webassemblyjs/wast-printer@npm:1.12.1": - version: 1.12.1 - resolution: "@webassemblyjs/wast-printer@npm:1.12.1" +"@webassemblyjs/wast-printer@npm:1.14.1": + version: 1.14.1 + resolution: "@webassemblyjs/wast-printer@npm:1.14.1" dependencies: - "@webassemblyjs/ast": "npm:1.12.1" + "@webassemblyjs/ast": "npm:1.14.1" "@xtuc/long": "npm:4.2.2" - checksum: 10c0/39bf746eb7a79aa69953f194943bbc43bebae98bd7cadd4d8bc8c0df470ca6bf9d2b789effaa180e900fab4e2691983c1f7d41571458bd2a26267f2f0c73705a + checksum: 10c0/8d7768608996a052545251e896eac079c98e0401842af8dd4de78fba8d90bd505efb6c537e909cd6dae96e09db3fa2e765a6f26492553a675da56e2db51f9d24 languageName: node linkType: hard @@ -4400,7 +4400,7 @@ __metadata: stylelint-checkstyle-reporter: "npm:1.0.0" stylelint-config-standard: "npm:36.0.1" tippy.js: "npm:6.3.7" - webpack: "npm:5.96.1" + webpack: "npm:5.97.0" webpack-cli: "npm:5.1.4" webpack-remove-empty-scripts: "npm:1.0.4" window-handle: "npm:1.0.1" @@ -7066,15 +7066,15 @@ __metadata: languageName: node linkType: hard -"webpack@npm:5.96.1": - version: 5.96.1 - resolution: "webpack@npm:5.96.1" +"webpack@npm:5.97.0": + version: 5.97.0 + resolution: "webpack@npm:5.97.0" dependencies: "@types/eslint-scope": "npm:^3.7.7" "@types/estree": "npm:^1.0.6" - "@webassemblyjs/ast": "npm:^1.12.1" - "@webassemblyjs/wasm-edit": "npm:^1.12.1" - "@webassemblyjs/wasm-parser": "npm:^1.12.1" + "@webassemblyjs/ast": "npm:^1.14.1" + "@webassemblyjs/wasm-edit": "npm:^1.14.1" + "@webassemblyjs/wasm-parser": "npm:^1.14.1" acorn: "npm:^8.14.0" browserslist: "npm:^4.24.0" chrome-trace-event: "npm:^1.0.2" @@ -7098,7 +7098,7 @@ __metadata: optional: true bin: webpack: bin/webpack.js - checksum: 10c0/ae6052fde9a546f79f14987b65823ba4024c6642a8489339ecfee7a351dff93325842aad453295bbdc6b65fb1690e4ef07529db63aa84ece55c7869e991a0039 + checksum: 10c0/a8714d42defbf52382b61c157f68e161a16d0edf228d8d9abaa7a165f3ee0ac7386a08d28d4dcf8d6740ea5bda0c4d4abfeeb838df029e636c1c28bb2454ac56 languageName: node linkType: hard From 9965f04545d0dee3473dbeddd76fcb9faa7032bc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 8 Dec 2024 09:16:25 +0100 Subject: [PATCH 20/25] Update dependency org.jenkins-ci.main:jenkins-test-harness to v2364 (#10021) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- test/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/pom.xml b/test/pom.xml index 50111b234ab0..ac3b8efc9a5f 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -178,7 +178,7 @@ THE SOFTWARE. org.jenkins-ci.main jenkins-test-harness - 2363.vf95c19b_2ca_72 + 2364.v163897b_238b_3 test From cb96c2a7b4b8f32ffa7003347b93320bc842049d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 8 Dec 2024 18:08:01 +0100 Subject: [PATCH 21/25] Update dependency webpack to v5.97.1 (#10037) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index f1d27f1258ab..5de7d953fe87 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "stylelint": "16.11.0", "stylelint-checkstyle-reporter": "1.0.0", "stylelint-config-standard": "36.0.1", - "webpack": "5.97.0", + "webpack": "5.97.1", "webpack-cli": "5.1.4", "webpack-remove-empty-scripts": "1.0.4" }, diff --git a/yarn.lock b/yarn.lock index ca94cf7169e0..9f287c2dd39e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4400,7 +4400,7 @@ __metadata: stylelint-checkstyle-reporter: "npm:1.0.0" stylelint-config-standard: "npm:36.0.1" tippy.js: "npm:6.3.7" - webpack: "npm:5.97.0" + webpack: "npm:5.97.1" webpack-cli: "npm:5.1.4" webpack-remove-empty-scripts: "npm:1.0.4" window-handle: "npm:1.0.1" @@ -7066,9 +7066,9 @@ __metadata: languageName: node linkType: hard -"webpack@npm:5.97.0": - version: 5.97.0 - resolution: "webpack@npm:5.97.0" +"webpack@npm:5.97.1": + version: 5.97.1 + resolution: "webpack@npm:5.97.1" dependencies: "@types/eslint-scope": "npm:^3.7.7" "@types/estree": "npm:^1.0.6" @@ -7098,7 +7098,7 @@ __metadata: optional: true bin: webpack: bin/webpack.js - checksum: 10c0/a8714d42defbf52382b61c157f68e161a16d0edf228d8d9abaa7a165f3ee0ac7386a08d28d4dcf8d6740ea5bda0c4d4abfeeb838df029e636c1c28bb2454ac56 + checksum: 10c0/a12d3dc882ca582075f2c4bd88840be8307427245c90a8a0e0b372d73560df13fcf25a61625c9e7edc964981d16b5a8323640562eb48347cf9dd2f8bd1b39d35 languageName: node linkType: hard From 70544d932fd9d8a0a29e601830b52b6fe36c7107 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 9 Dec 2024 07:37:27 +0000 Subject: [PATCH 22/25] Update dependency @babel/cli to v7.26.4 (#10038) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 5de7d953fe87..1989b499283c 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "lint": "yarn lint:js && yarn lint:css" }, "devDependencies": { - "@babel/cli": "7.25.9", + "@babel/cli": "7.26.4", "@babel/core": "7.26.0", "@babel/preset-env": "7.26.0", "@eslint/js": "9.16.0", diff --git a/yarn.lock b/yarn.lock index 9f287c2dd39e..2a4945df8592 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15,9 +15,9 @@ __metadata: languageName: node linkType: hard -"@babel/cli@npm:7.25.9": - version: 7.25.9 - resolution: "@babel/cli@npm:7.25.9" +"@babel/cli@npm:7.26.4": + version: 7.26.4 + resolution: "@babel/cli@npm:7.26.4" dependencies: "@jridgewell/trace-mapping": "npm:^0.3.25" "@nicolo-ribaudo/chokidar-2": "npm:2.1.8-no-fsevents.3" @@ -38,7 +38,7 @@ __metadata: bin: babel: ./bin/babel.js babel-external-helpers: ./bin/babel-external-helpers.js - checksum: 10c0/2e8228c3715e220fa902888c643ce1a89c4ee90be3d9f7a31218d5bb2500456e0cef12cb90fd5877ab3e5a4498df8f27670425d346422a3eb52052fd3184d520 + checksum: 10c0/f2d4fc3c4a34dd3001e3bd7084b78b38211003c36afaf2dc8fedf4565c0442bd59b1c64a9f91a0b7b2450e089123f197e09577ae50dc994307c3348b310ce34c languageName: node linkType: hard @@ -4369,7 +4369,7 @@ __metadata: version: 0.0.0-use.local resolution: "jenkins-ui@workspace:." dependencies: - "@babel/cli": "npm:7.25.9" + "@babel/cli": "npm:7.26.4" "@babel/core": "npm:7.26.0" "@babel/preset-env": "npm:7.26.0" "@eslint/js": "npm:9.16.0" From 3b3a6376d65ce97f824202ab537a2fe1989cf43a Mon Sep 17 00:00:00 2001 From: Valentin Delaye Date: Mon, 9 Dec 2024 11:42:45 +0100 Subject: [PATCH 23/25] JENKINS-73355 Removal of commons-compress from core (#9958) --- .github/renovate.json | 10 ---------- bom/pom.xml | 5 ----- core/pom.xml | 11 ----------- 3 files changed, 26 deletions(-) diff --git a/.github/renovate.json b/.github/renovate.json index 90c5a18d9f6d..cfd588a66b8d 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -71,16 +71,6 @@ "org.fusesource.jansi:jansi" ] }, - { - "description": "Depends on commons-lang3 which is in progress for removal from core. See: https://issues.jenkins.io/browse/JENKINS-73355", - "matchManagers": [ - "maven" - ], - "enabled": false, - "matchPackageNames": [ - "org.apache.commons:commons-compress" - ] - }, { "description": "Contains incompatible API changes and needs compatibility work. See: https://github.com/jenkinsci/jenkins/pull/4224", "matchManagers": [ diff --git a/bom/pom.xml b/bom/pom.xml index 61de025b3e9b..f94253ce6f70 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -191,11 +191,6 @@ THE SOFTWARE. ant 1.10.15 - - org.apache.commons - commons-compress - 1.26.1 - org.apache.commons commons-fileupload2 diff --git a/core/pom.xml b/core/pom.xml index 9bff5e5ad0b2..0b9cb30d8763 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -285,17 +285,6 @@ THE SOFTWARE. org.apache.ant ant - - org.apache.commons - commons-compress - - - - org.apache.commons - commons-lang3 - - - org.apache.commons commons-fileupload2-core From f6802dd5455b0f5dd2893e8a7461b1be874344c2 Mon Sep 17 00:00:00 2001 From: frankie139506 <97017043+frankie139506@users.noreply.github.com> Date: Mon, 9 Dec 2024 18:43:00 +0800 Subject: [PATCH 24/25] =?UTF-8?q?[JENKINS-69549]=20Margins=20for=20headers?= =?UTF-8?q?=20and=20paragraphs=20make=20descriptions=20=E2=80=A6=20(#7078)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Alexander Brandes Co-authored-by: Tim Jacomb Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com> --- .../java/jenkins/telemetry/Telemetry.java | 5 ++ .../model/UsageStatistics/global.groovy | 2 +- .../help-usageStatisticsCollected.jelly | 52 +++++++++++-------- src/main/scss/base/_style.scss | 20 +++++++ 4 files changed, 57 insertions(+), 22 deletions(-) diff --git a/core/src/main/java/jenkins/telemetry/Telemetry.java b/core/src/main/java/jenkins/telemetry/Telemetry.java index 1f60e319f97d..de081c16954b 100644 --- a/core/src/main/java/jenkins/telemetry/Telemetry.java +++ b/core/src/main/java/jenkins/telemetry/Telemetry.java @@ -130,6 +130,11 @@ public static ExtensionList all() { return ExtensionList.lookup(Telemetry.class); } + @Restricted(NoExternalUse.class) // called by jelly + public static boolean isAnyTrialActive() { + return all().stream().anyMatch(Telemetry::isActivePeriod); + } + /** * @since 2.147 * @return whether to collect telemetry diff --git a/core/src/main/resources/hudson/model/UsageStatistics/global.groovy b/core/src/main/resources/hudson/model/UsageStatistics/global.groovy index 5506a37a67d5..7254eb283a60 100644 --- a/core/src/main/resources/hudson/model/UsageStatistics/global.groovy +++ b/core/src/main/resources/hudson/model/UsageStatistics/global.groovy @@ -8,7 +8,7 @@ def f=namespace(lib.FormTagLib) f.section(title: _("Usage Statistics")) { if (UsageStatistics.DISABLED) { - span(class: "jenkins-not-applicable") { + div(class: "jenkins-not-applicable jenkins-description") { raw(_("disabledBySystemProperty")) } } else if (FIPS140.useCompliantAlgorithms()) { diff --git a/core/src/main/resources/hudson/model/UsageStatistics/help-usageStatisticsCollected.jelly b/core/src/main/resources/hudson/model/UsageStatistics/help-usageStatisticsCollected.jelly index a1bef14d4e22..2d01661a175b 100644 --- a/core/src/main/resources/hudson/model/UsageStatistics/help-usageStatisticsCollected.jelly +++ b/core/src/main/resources/hudson/model/UsageStatistics/help-usageStatisticsCollected.jelly @@ -1,14 +1,14 @@ -
+

For any project, it's critical to know how the software is used, but tracking usage data is inherently difficult in open-source projects. Anonymous usage statistics address this need. When enabled, Jenkins periodically sends information to the Jenkins project. The Jenkins project uses this information to set development priorities. -

+

-

General usage statistics

+

General usage statistics

Jenkins reports the following general usage statistics:

    @@ -24,7 +24,7 @@

-

Telemetry collection

+

Telemetry collection

@@ -38,24 +38,34 @@ Each trial has a specific purpose and a defined end date, after which collection stops, independent of the installed versions of Jenkins or plugins. Once a trial is complete, the trial results may be aggregated and shared with the developer community.

-

- The following trials defined on this instance are active now or in the future: -

+ + -
- - -
${collector.displayName}
-
- -

- Start date: ${collector.start}
- End date: ${collector.end} -

-
-
-
-
+ + +

${%There are currently no active trials.}

+
+ +

+ The following trials defined on this instance are active now or in the future: +

+
+ + +
${collector.displayName}
+
+ +

+ Start date: ${collector.start} +
+ End date: ${collector.end} +

+
+
+
+
+
+
diff --git a/src/main/scss/base/_style.scss b/src/main/scss/base/_style.scss index 273d583d4ca9..98807c6e5401 100644 --- a/src/main/scss/base/_style.scss +++ b/src/main/scss/base/_style.scss @@ -372,6 +372,8 @@ pre.console { border-radius: 6px; z-index: 0; + --section-padding: 0.8rem; + &::before { content: ""; position: absolute; @@ -389,6 +391,24 @@ pre.console { p:last-of-type { margin-bottom: 0; } + + // add spacing above headings except for when its the first element in the help + // the need for this is caused by p:last-of-type setting margin-bottom to 0 + // unfortunately because of the varied markup I wasn't able to find a way to avoid this + h1:not(:first-child), + .h1:not(:first-child), + h2:not(:first-child), + .h2:not(:first-child), + h3:not(:first-child), + .h3:not(:first-child), + h4:not(:first-child), + .h4:not(:first-child), + h5:not(:first-child), + .h5:not(:first-child), + h6:not(:first-child), + .h6:not(:first-child) { + margin-top: var(--section-padding); + } } .help .from-plugin { From 930c7ffe7da6bc1d655db837feaa8a6bd2a06ac3 Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Mon, 9 Dec 2024 22:19:12 +0000 Subject: [PATCH 25/25] Overhaul search with a Command Palette (#7569) Co-authored-by: Wadeck Follonier Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com> Co-authored-by: Alexander Brandes Co-authored-by: Tim Jacomb --- core/src/main/java/hudson/Functions.java | 10 + core/src/main/java/hudson/model/Job.java | 2 +- core/src/main/java/hudson/search/Search.java | 15 +- .../java/hudson/search/SuggestedItem.java | 2 +- core/src/main/java/jenkins/model/Jenkins.java | 4 +- .../jenkins/views/JenkinsHeader/search-box.js | 6 - .../lib/layout/command-palette.jelly | 47 +++++ .../lib/layout/header/searchbox.jelly | 38 ++-- .../main/resources/lib/layout/layout.jelly | 1 + eslint.config.cjs | 1 - src/main/js/api/search.js | 10 + src/main/js/app.js | 2 + .../components/command-palette/datasources.js | 29 +++ .../js/components/command-palette/index.js | 155 +++++++++++++++ .../js/components/command-palette/models.js | 27 +++ .../js/components/command-palette/symbols.js | 3 + src/main/js/keyboard-shortcuts.js | 24 +-- src/main/scss/abstracts/_mixins.scss | 1 + src/main/scss/abstracts/_theme.scss | 13 ++ .../scss/components/_command-palette.scss | 176 ++++++++++++++++++ src/main/scss/components/_index.scss | 1 + src/main/scss/components/_page-header.scss | 11 ++ src/main/scss/form/_search-bar.scss | 44 +++-- .../hudson/model/AbstractProjectTest.java | 1 + .../test/java/hudson/search/SearchTest.java | 76 +++----- .../hudson/widgets/HistoryWidgetTest.java | 4 +- .../test/java/jenkins/model/JenkinsTest.java | 3 +- .../main/webapp/scripts/hudson-behavior.js | 57 +----- 28 files changed, 600 insertions(+), 163 deletions(-) delete mode 100644 core/src/main/resources/jenkins/views/JenkinsHeader/search-box.js create mode 100644 core/src/main/resources/lib/layout/command-palette.jelly create mode 100644 src/main/js/api/search.js create mode 100644 src/main/js/components/command-palette/datasources.js create mode 100644 src/main/js/components/command-palette/index.js create mode 100644 src/main/js/components/command-palette/models.js create mode 100644 src/main/js/components/command-palette/symbols.js create mode 100644 src/main/scss/components/_command-palette.scss diff --git a/core/src/main/java/hudson/Functions.java b/core/src/main/java/hudson/Functions.java index 64add7b35193..67801475233d 100644 --- a/core/src/main/java/hudson/Functions.java +++ b/core/src/main/java/hudson/Functions.java @@ -62,6 +62,7 @@ import hudson.model.View; import hudson.scm.SCM; import hudson.scm.SCMDescriptor; +import hudson.search.SearchFactory; import hudson.search.SearchableModelObject; import hudson.security.ACL; import hudson.security.AccessControlled; @@ -2578,6 +2579,11 @@ public static String generateItemId() { return String.valueOf(Math.floor(Math.random() * 3000)); } + @Restricted(NoExternalUse.class) + public static ExtensionList getSearchFactories() { + return SearchFactory.all(); + } + /** * @param keyboardShortcut the shortcut to be translated * @return the translated shortcut, e.g. CMD+K to ⌘+K for macOS, CTRL+K for Windows @@ -2596,6 +2602,10 @@ public static String translateModifierKeysForUsersPlatform(String keyboardShortc @Restricted(NoExternalUse.class) public static String formatMessage(String format, Object args) { + if (format == null) { + return args.toString(); + } + return MessageFormat.format(format, args); } } diff --git a/core/src/main/java/hudson/model/Job.java b/core/src/main/java/hudson/model/Job.java index d22c25e98e3d..7d140656e363 100644 --- a/core/src/main/java/hudson/model/Job.java +++ b/core/src/main/java/hudson/model/Job.java @@ -541,7 +541,7 @@ public void find(String token, List result) { public void suggest(String token, List result) { find(token, result); } - }).add("configure", "config", "configure"); + }); } @Override diff --git a/core/src/main/java/hudson/search/Search.java b/core/src/main/java/hudson/search/Search.java index 7773d9e9d696..9bd624e34742 100644 --- a/core/src/main/java/hudson/search/Search.java +++ b/core/src/main/java/hudson/search/Search.java @@ -158,7 +158,7 @@ public void doSuggestOpenSearch(StaplerRequest2 req, StaplerResponse2 rsp, @Quer public void doSuggest(StaplerRequest2 req, StaplerResponse2 rsp, @QueryParameter String query) throws IOException, ServletException { Result r = new Result(); for (SuggestedItem item : getSuggestions(req, query)) - r.suggestions.add(new Item(item.getPath())); + r.suggestions.add(new Item(item.getPath(), item.getUrl())); rsp.serveExposedBean(req, r, Flavor.JSON); } @@ -252,12 +252,25 @@ public static class Result { @ExportedBean(defaultVisibility = 999) public static class Item { + @Exported @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD", justification = "read by Stapler") public String name; + private final String url; + public Item(String name) { + this(name, null); + } + + public Item(String name, String url) { this.name = name; + this.url = url; + } + + @Exported + public String getUrl() { + return url; } } diff --git a/core/src/main/java/hudson/search/SuggestedItem.java b/core/src/main/java/hudson/search/SuggestedItem.java index 9ba455270e58..6911d002fe50 100644 --- a/core/src/main/java/hudson/search/SuggestedItem.java +++ b/core/src/main/java/hudson/search/SuggestedItem.java @@ -62,7 +62,7 @@ private void getPath(StringBuilder buf) { buf.append(item.getSearchName()); else { parent.getPath(buf); - buf.append(' ').append(item.getSearchName()); + buf.append(" » ").append(item.getSearchName()); } } diff --git a/core/src/main/java/jenkins/model/Jenkins.java b/core/src/main/java/jenkins/model/Jenkins.java index bedbea0af7c4..eee96b5bca05 100644 --- a/core/src/main/java/jenkins/model/Jenkins.java +++ b/core/src/main/java/jenkins/model/Jenkins.java @@ -2346,9 +2346,7 @@ public String getSearchUrl() { public SearchIndexBuilder makeSearchIndex() { SearchIndexBuilder builder = super.makeSearchIndex(); if (hasPermission(ADMINISTER)) { - builder.add("configure", "config", "configure") - .add("manage") - .add("log"); + builder.add("manage", Messages.ManageJenkinsAction_DisplayName()); } builder.add(new CollectionSearchIndex() { @Override diff --git a/core/src/main/resources/jenkins/views/JenkinsHeader/search-box.js b/core/src/main/resources/jenkins/views/JenkinsHeader/search-box.js deleted file mode 100644 index 91e805c4ceaf..000000000000 --- a/core/src/main/resources/jenkins/views/JenkinsHeader/search-box.js +++ /dev/null @@ -1,6 +0,0 @@ -(function () { - var element = document.getElementById("search-box-completion"); - if (element) { - createSearchBox(element.getAttribute("data-search-url")); - } -})(); diff --git a/core/src/main/resources/lib/layout/command-palette.jelly b/core/src/main/resources/lib/layout/command-palette.jelly new file mode 100644 index 000000000000..3d454f88a8c1 --- /dev/null +++ b/core/src/main/resources/lib/layout/command-palette.jelly @@ -0,0 +1,47 @@ + + + + + + The command palette overlay + + +
+ + +
+
+ +
+
+
+
+
+
+ diff --git a/core/src/main/resources/lib/layout/header/searchbox.jelly b/core/src/main/resources/lib/layout/header/searchbox.jelly index 916f5ad49c22..033dc2ab0407 100644 --- a/core/src/main/resources/lib/layout/header/searchbox.jelly +++ b/core/src/main/resources/lib/layout/header/searchbox.jelly @@ -1,25 +1,27 @@ - -