From e75d08c68e1a4bcb9551dc083e36eeb0979d24df Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Thu, 25 Nov 2021 20:27:39 +0000 Subject: [PATCH 01/37] WIP replacement of link dropdowns --- .../resources/lib/layout/breadcrumbBar.jelly | 10 +- .../main/resources/lib/layout/breadcrumbs.css | 154 ----------------- .../main/resources/lib/layout/breadcrumbs.js | 27 +-- war/src/main/less/base-styles-v2.less | 1 + war/src/main/less/base/layout-commons.less | 7 +- war/src/main/less/base/style.less | 10 -- war/src/main/less/modules/breadcrumbs.less | 159 ++++++++++++++++++ war/src/main/less/modules/table.less | 12 +- war/src/main/less/modules/tabs.less | 6 +- 9 files changed, 182 insertions(+), 204 deletions(-) delete mode 100644 core/src/main/resources/lib/layout/breadcrumbs.css create mode 100644 war/src/main/less/modules/breadcrumbs.less diff --git a/core/src/main/resources/lib/layout/breadcrumbBar.jelly b/core/src/main/resources/lib/layout/breadcrumbBar.jelly index 182f0106b481..1be42d52423a 100644 --- a/core/src/main/resources/lib/layout/breadcrumbBar.jelly +++ b/core/src/main/resources/lib/layout/breadcrumbBar.jelly @@ -34,12 +34,12 @@ THE SOFTWARE. use the <l:breadcrumb> tag. - - + +
-
- - + + \ No newline at end of file diff --git a/core/src/main/resources/lib/layout/breadcrumbs.css b/core/src/main/resources/lib/layout/breadcrumbs.css deleted file mode 100644 index f808e93864e7..000000000000 --- a/core/src/main/resources/lib/layout/breadcrumbs.css +++ /dev/null @@ -1,154 +0,0 @@ -#left-top-nav { - text-align: left; - color: #222; -} - -#left-top-nav a { - color: black; -} - -#top-nav .a { - color: white; -} - -.breadcrumbs__wrapper { - display: flex; - justify-content: space-between; - align-items: center; - min-height: 2.5rem; - font-size: 1rem; - line-height: 1.5; - padding: 0 0.7rem; - background-color: #F8F8F8; - background-color: var(--breadcrumbs-bg); -} - -#breadcrumbs { - list-style-type: none; - margin: 0; - padding: 0; - min-height: 2.5rem; - display: block; - display: flex; - align-items: center; - flex: 1; - border-bottom: none; - flex-wrap: wrap; -} - -#breadcrumbs LI { - display:inline-block; - min-height: 2.5rem; -} - -#breadcrumbs LI A { - display: inline-block; - display: inline-flex; - align-items: center; - height: 2.5rem; - padding: 0 0.5rem; -} - -#breadcrumbs LI:hover, A.breadcrumbBarAnchor.mouseIsOverMenuSelector { - background-color: #e0e4dc; - background-color: var(--breadcrumbs-item-bg-color--hover); -} - - -#breadcrumbs LI A, #breadcrumbs LI A:link, #breadcrumbs LI A:visited { - /* is this still needed? */ - max-width: 1330px; - - text-overflow: ellipsis; - text-decoration: none; - overflow: hidden; - white-space: nowrap; - font-weight: bold; - - display: inline-block; - display: inline-flex; - color: #4d545d; - color: var(--breadcrumbs-text-color); -} - -#breadcrumbs LI A:hover, #breadcrumbs LI A:focus { - /* TODO: change hover state - add it in the LI element so that it applies to the menuSeparator */ - text-decoration: underline; - outline-color: #3FB3F7; - outline-color: var(--focus); -} - -#breadcrumbs LI A:active { - background-color: #C8CEC2; - background-color: var(--breadcrumbs-item-bg-color--hover); -} - -#breadcrumbs LI A { - cursor: pointer; -} - -#breadcrumbs LI.children, #breadcrumbs LI.separator {/* '>' separator between two items */ - width: 1.25rem; - height: 100%; - display: inline-block; - display: inline-flex; - align-items: center; - justify-content: center; -} - -#breadcrumbs LI.children:after, #breadcrumbs LI.separator:after { - /* Right arrow */ - content: ""; - border-left: 0.25em solid currentColor; - border-top: 0.25em solid transparent; - border-bottom: 0.25em solid transparent; - border-right: 0; -} - -#breadcrumbs LI.children { - cursor: pointer; -} - -#breadcrumbs LI.children:hover:after { - border-left-color: #4d545d; - border-left-color: var(--breadcrumbs-text-color); -} - -#breadcrumbs LI.separator:last-child {/* separators are for in-between only */ - display: none; -} - -#menuSelector {/* used for showing 'v' on the right of the anchor */ - width: 15px; - height:16px; - position: absolute; - visibility: hidden; - cursor: pointer; - z-index: 2000; - display: inline-block; - display: inline-flex; - align-items: center; - justify-content: center; -} -#menuSelector:after { - /* Down arrow */ - content: ""; - border-top: 0.30em solid #4d545d; - border-top: 0.30em solid var(--breadcrumbs-text-color); - border-left: 0.30em solid transparent; - border-right: 0.30em solid transparent; - border-bottom: 0; -} -#menuSelector.inverse:after { - border-top-color: #bcbcbc; -} - -A.model-link.inside, #breadcrumbs A.inside {/* additional 'inside' class allows pre-allocation of the context menu space */ - padding-right: 16px; -} - -#breadcrumb-menu .header { - font-weight: bold; - font-size: 0.875rem; -} diff --git a/core/src/main/resources/lib/layout/breadcrumbs.js b/core/src/main/resources/lib/layout/breadcrumbs.js index 98aba574d07f..f0e48a1b3f25 100644 --- a/core/src/main/resources/lib/layout/breadcrumbs.js +++ b/core/src/main/resources/lib/layout/breadcrumbs.js @@ -238,25 +238,14 @@ var breadcrumbs = (function() { return false; } -// Behaviour.specify("#breadcrumbs LI", 'breadcrumbs', 0, function (e) { -// // when the mouse hovers over LI, activate the menu -// if (e.hasClassName("no-context-menu")) return; -// e.observe("mouseover", function () { handleHover(e.firstChild) }); -// }); - - Behaviour.specify("A.model-link", 'breadcrumbs', 0, function (a) { - // ditto for model-link, but give it a larger delay to avoid unintended menus to be displayed - // $(a).observe("mouseover", function () { handleHover(a,500); }); - - a.observe("mouseover",function () { - logger("mouse entered model-link %s",this.href); - menuSelector.canceller.cancel(); - menuSelector.show(this); - }); - a.observe("mouseout",function () { - logger("mouse left model-link %s",this.href); - menuSelector.canceller.schedule(); - }); + Behaviour.specify("A.model-link", 'breadcrumbs', 0, function (link) { + const dropdownChevron = document.createElement("button") + dropdownChevron.className = "jenkins-menu-dropdown-chevron" + dropdownChevron.addEventListener("click", function(e) { + e.preventDefault(); + invokeContextMenu(link, null); + }) + link.appendChild(dropdownChevron) }); Behaviour.specify("#breadcrumbs LI.children", 'breadcrumbs', 0, function (a) { diff --git a/war/src/main/less/base-styles-v2.less b/war/src/main/less/base-styles-v2.less index 46af9a5a2c73..6e97f6c39ee8 100644 --- a/war/src/main/less/base-styles-v2.less +++ b/war/src/main/less/base-styles-v2.less @@ -27,6 +27,7 @@ html { @import './modules/app-bar'; @import './modules/badges'; +@import './modules/breadcrumbs'; @import './modules/buttons'; @import './modules/content-blocks'; @import './modules/form'; diff --git a/war/src/main/less/base/layout-commons.less b/war/src/main/less/base/layout-commons.less index 1df72a639c58..a9dccabac0ec 100644 --- a/war/src/main/less/base/layout-commons.less +++ b/war/src/main/less/base/layout-commons.less @@ -44,15 +44,10 @@ body { margin-left: 0.25rem; } -#breadcrumbBar, -#footer-container, -.top-sticker-inner { +#footer-container { background-color: var(--breadcrumbs-bg); } -.top-sticker-inner { - border-bottom: 1px solid --var(breadcrumbs-border); -} /* -------------------------------------- */ diff --git a/war/src/main/less/base/style.less b/war/src/main/less/base/style.less index 8f14974b975e..58548572db00 100644 --- a/war/src/main/less/base/style.less +++ b/war/src/main/less/base/style.less @@ -469,16 +469,6 @@ label.attach-previous { z-index: 999; } -.top-sticker-inner { - padding: 1em; -} - -.top-sticker-edge { - height: 16px; - background-image: url("../../images/top-sticker-bottom-edge.png"); - background-repeat: repeat-x; -} - .top-sticker.noedge > .top-sticker-edge { display: none; } diff --git a/war/src/main/less/modules/breadcrumbs.less b/war/src/main/less/modules/breadcrumbs.less new file mode 100644 index 000000000000..47eaa03bf60d --- /dev/null +++ b/war/src/main/less/modules/breadcrumbs.less @@ -0,0 +1,159 @@ +.jenkins-breadcrumbs { + +} + +#left-top-nav { + text-align: left; + color: #222; +} + +#left-top-nav a { + color: black; +} + +#top-nav .a { + color: white; +} + +.jenkins-breadcrumbs { + display: flex; + justify-content: space-between; + align-items: center; + min-height: 2.5rem; + font-size: 1rem; + line-height: 1.5; + padding: 0 0.7rem; +} + +#breadcrumbs { + list-style-type: none; + margin: 0; + padding: 0; + min-height: 2.5rem; + display: block; + display: flex; + align-items: center; + flex: 1; + border-bottom: none; + flex-wrap: wrap; +} + +#breadcrumbs LI { + display: inline-block; +} + +#breadcrumbs LI A { + display: inline-flex; + align-items: center; + padding: 0.5rem; + font-weight: 500; + //font-size: 0.75rem; + border-radius: 6px; +} + +#breadcrumbs LI:hover, A.breadcrumbBarAnchor.mouseIsOverMenuSelector { + background-color: var(--breadcrumbs-item-bg-color--hover); +} + + +#breadcrumbs LI A, #breadcrumbs LI A:link, #breadcrumbs LI A:visited { + /* is this still needed? */ + max-width: 1330px; + + text-overflow: ellipsis; + text-decoration: none; + overflow: hidden; + white-space: nowrap; + font-weight: bold; + + display: inline-block; + display: inline-flex; + color: var(--breadcrumbs-text-color); +} + +#breadcrumbs LI.children, #breadcrumbs LI.separator { /* '>' separator between two items */ + width: 14px; + height: 14px; + background: currentColor; + mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='ionicon' viewBox='0 0 512 512'%3E%3Ctitle%3EChevron Forward%3C/title%3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='48' d='M184 112l144 144-144 144'/%3E%3C/svg%3E"); + margin: 6px; +} + +#breadcrumbs LI.children { + cursor: pointer; +} + +#breadcrumbs LI.children:hover:after { + border-left-color: var(--breadcrumbs-text-color); +} + +#breadcrumbs LI.separator:last-child { /* separators are for in-between only */ + display: none; +} + +#menuSelector { /* used for showing 'v' on the right of the anchor */ + width: 14px; + height: 14px; + position: absolute; + visibility: hidden; + cursor: pointer; + z-index: 2000; + display: inline-flex; + align-items: center; + justify-content: center; + background: currentColor; + mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='ionicon' viewBox='0 0 512 512'%3E%3Ctitle%3EChevron Down%3C/title%3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='48' d='M112 184l144 144 144-144'/%3E%3C/svg%3E"); + transition: transform 0.2s ease, opacity 0.2s ease; + + &:active { + transform: translateY(2px); + opacity: 0.5; + } +} + +#menuSelector.inverse:after { + border-top-color: #bcbcbc; +} + +.jenkins-menu-dropdown-chevron { + display: inline; + width: 14px; + height: 14px; + opacity: 0; + margin-left: 1ch; + border: none; + outline: none; + background: var(--text-color); + mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='ionicon' viewBox='0 0 512 512'%3E%3Ctitle%3EChevron Down%3C/title%3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='48' d='M112 184l144 144 144-144'/%3E%3C/svg%3E"); + transition: transform 0.2s ease, opacity 0.2s ease; + cursor: pointer; + + &:hover { + opacity: 1 !important; + } + + &:active { + transform: translateY(2px); + opacity: 0.5; + } +} + +A.model-link.inside, #breadcrumbs A.inside { /* additional 'inside' class allows pre-allocation of the context menu space */ + transition: 0.2s ease; + margin-right: 20px; + + &:hover { + .jenkins-menu-dropdown-chevron { + opacity: 0.5; + } + } +} + +.jenkins-table__link.model-link { + margin-right: 30px; +} + +#breadcrumb-menu .header { + font-weight: bold; + font-size: 0.875rem; +} diff --git a/war/src/main/less/modules/table.less b/war/src/main/less/modules/table.less index c3698c3ee8a2..0c094aeb60f4 100644 --- a/war/src/main/less/modules/table.less +++ b/war/src/main/less/modules/table.less @@ -18,13 +18,13 @@ & > th { color: var(--table-header-foreground); text-align: left; - padding-top: calc((var(--table-padding) * 2) - 5px); - padding-bottom: calc(var(--table-padding) * 2); + padding-top: calc((var(--table-padding) * 1.75) - 5px); + padding-bottom: calc(var(--table-padding) * 1.75); padding-left: var(--table-padding); - font-weight: 700; - text-transform: uppercase; - letter-spacing: 2px; - font-size: 0.75rem; + font-weight: 600; + //text-transform: uppercase; + //letter-spacing: 2px; + font-size: 0.85rem; &[align="center"] { text-align: center; diff --git a/war/src/main/less/modules/tabs.less b/war/src/main/less/modules/tabs.less index ee8cc4a08c1a..f3e97264250a 100644 --- a/war/src/main/less/modules/tabs.less +++ b/war/src/main/less/modules/tabs.less @@ -26,10 +26,8 @@ border-radius: 100px; background: var(--tabs-item-background); color: var(--tabs-item-foreground); - font-weight: 700; - text-transform: uppercase; - letter-spacing: 2px; - font-size: 0.75rem; + font-weight: 600; + font-size: 0.85rem; transition: 0.2s ease; &:hover { From f35f0749c20ca96fae5a446049d270cc220a611f Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Thu, 25 Nov 2021 21:16:04 +0000 Subject: [PATCH 02/37] Working build - chevron menus now dead, shiny new ones working <3 --- .../View/AsynchPeople/people-resources.js | 6 ++--- .../HudsonPrivateSecurityRealm/index.jelly | 12 ++++----- .../views/LastFailureColumn/column.jelly | 2 +- .../views/LastSuccessColumn/column.jelly | 2 +- .../resources/lib/hudson/buildListTable.jelly | 2 +- .../resources/lib/layout/breadcrumbBar.jelly | 2 +- war/src/main/less/base/layout-commons.less | 1 - war/src/main/less/modules/breadcrumbs.less | 25 +++++++++++++------ 8 files changed, 29 insertions(+), 23 deletions(-) diff --git a/core/src/main/resources/hudson/model/View/AsynchPeople/people-resources.js b/core/src/main/resources/hudson/model/View/AsynchPeople/people-resources.js index 3a90ccf9d7eb..f9651a35c83f 100644 --- a/core/src/main/resources/hudson/model/View/AsynchPeople/people-resources.js +++ b/core/src/main/resources/hudson/model/View/AsynchPeople/people-resources.js @@ -27,15 +27,13 @@ function display(data) { d = document.createElement('td'); var a = document.createElement('a'); a.href = rootURL + "/" + e.url; + a.className = "jenkins-table__link" a.appendChild(document.createTextNode(e.id)); d.appendChild(a); r.appendChild(d); d = document.createElement('td'); - var a = document.createElement('a'); - a.href = rootURL + "/" + e.url; - a.appendChild(document.createTextNode(e.fullName)); - d.appendChild(a); + d.appendChild(document.createTextNode(e.fullName)); r.appendChild(d); d = document.createElement('td'); diff --git a/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/index.jelly b/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/index.jelly index 863035f7cb83..c2bb1da166b3 100644 --- a/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/index.jelly +++ b/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/index.jelly @@ -34,7 +34,7 @@ THE SOFTWARE.
-

${%blurb}

+

${%blurb}

@@ -49,18 +49,16 @@ THE SOFTWARE. -
+
- - - +
- ${user.id} + ${user.id} - ${user.fullName} + ${user.fullName}
diff --git a/core/src/main/resources/hudson/views/LastFailureColumn/column.jelly b/core/src/main/resources/hudson/views/LastFailureColumn/column.jelly index 51046f5886b8..cfecd8389b02 100644 --- a/core/src/main/resources/hudson/views/LastFailureColumn/column.jelly +++ b/core/src/main/resources/hudson/views/LastFailureColumn/column.jelly @@ -29,7 +29,7 @@ THE SOFTWARE. ${lfBuild.timestampString} - ${lfBuild.displayName} + ${lfBuild.displayName} ${%N/A} diff --git a/core/src/main/resources/hudson/views/LastSuccessColumn/column.jelly b/core/src/main/resources/hudson/views/LastSuccessColumn/column.jelly index 4ac61bffd584..7b951f4a1296 100644 --- a/core/src/main/resources/hudson/views/LastSuccessColumn/column.jelly +++ b/core/src/main/resources/hudson/views/LastSuccessColumn/column.jelly @@ -29,7 +29,7 @@ THE SOFTWARE. ${lsBuild.timestampString} - ${lsBuild.displayName} + ${lsBuild.displayName} ${%N/A} diff --git a/core/src/main/resources/lib/hudson/buildListTable.jelly b/core/src/main/resources/lib/hudson/buildListTable.jelly index 0329a3c99377..103c14fa6714 100644 --- a/core/src/main/resources/lib/hudson/buildListTable.jelly +++ b/core/src/main/resources/lib/hudson/buildListTable.jelly @@ -44,7 +44,7 @@ THE SOFTWARE. insert(new Element('div', {class: 'jenkins-table__cell__button-wrapper'}). insert(generateSVGIcon(e.iconName, "${iconSizeClass}")))); tr.insert(new Element('td'). - insert(new Element('a', {class: 'jenkins-table__link model-link inside', href: '${rootURL}/' + e.parentUrl}). + insert(new Element('a', {class: 'jenkins-table__link model-link', href: '${rootURL}/' + e.parentUrl}). update(e.parentFullDisplayName)). insert(new Element('a', {class: 'jenkins-table__link jenkins-table__badge model-link inside', href: '${rootURL}/' + e.url}). update(e.displayName.escapeHTML()))); diff --git a/core/src/main/resources/lib/layout/breadcrumbBar.jelly b/core/src/main/resources/lib/layout/breadcrumbBar.jelly index 1be42d52423a..a079f95bc760 100644 --- a/core/src/main/resources/lib/layout/breadcrumbBar.jelly +++ b/core/src/main/resources/lib/layout/breadcrumbBar.jelly @@ -44,7 +44,7 @@ THE SOFTWARE.
  • - + diff --git a/war/src/main/less/base/layout-commons.less b/war/src/main/less/base/layout-commons.less index a9dccabac0ec..d6697b134f6d 100644 --- a/war/src/main/less/base/layout-commons.less +++ b/war/src/main/less/base/layout-commons.less @@ -67,7 +67,6 @@ body { padding: 1rem 0 2.5rem 0; width: 300px; flex-shrink: 0; - border-right: 1px solid var(--panel-border-color); } #main-panel { diff --git a/war/src/main/less/modules/breadcrumbs.less b/war/src/main/less/modules/breadcrumbs.less index 47eaa03bf60d..e9286353e72e 100644 --- a/war/src/main/less/modules/breadcrumbs.less +++ b/war/src/main/less/modules/breadcrumbs.less @@ -120,13 +120,17 @@ width: 14px; height: 14px; opacity: 0; - margin-left: 1ch; border: none; outline: none; background: var(--text-color); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='ionicon' viewBox='0 0 512 512'%3E%3Ctitle%3EChevron Down%3C/title%3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='48' d='M112 184l144 144 144-144'/%3E%3C/svg%3E"); - transition: transform 0.2s ease, opacity 0.2s ease; + mask-position: center; + transition: 0.2s ease; cursor: pointer; + padding: 0; + margin-left: -14px; + pointer-events: none; + vertical-align: middle; &:hover { opacity: 1 !important; @@ -138,19 +142,26 @@ } } -A.model-link.inside, #breadcrumbs A.inside { /* additional 'inside' class allows pre-allocation of the context menu space */ - transition: 0.2s ease; - margin-right: 20px; +.model-link { + transition: var(--standard-transition) !important; &:hover { .jenkins-menu-dropdown-chevron { + margin-left: 1ch; opacity: 0.5; + pointer-events: all; + } + + & + a.model-link { + margin-right: calc((14px + 1ch) * -1) !important; } } } -.jenkins-table__link.model-link { - margin-right: 30px; +.inside { + &:hover { + margin-right: calc((14px + 1ch) * -1) !important; + } } #breadcrumb-menu .header { From fecfc70aca7f69cc76f4d67035fb04ddd64818d3 Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Thu, 25 Nov 2021 21:44:42 +0000 Subject: [PATCH 03/37] Final cleanup hopefully :sparkles: --- .../resources/lib/layout/breadcrumbBar.jelly | 73 ++++--- .../main/resources/lib/layout/breadcrumbs.js | 83 +------- war/src/main/less/modules/breadcrumbs.less | 191 ++++++++---------- war/src/main/less/modules/table.less | 2 - 4 files changed, 118 insertions(+), 231 deletions(-) diff --git a/core/src/main/resources/lib/layout/breadcrumbBar.jelly b/core/src/main/resources/lib/layout/breadcrumbBar.jelly index a079f95bc760..5a1003e98074 100644 --- a/core/src/main/resources/lib/layout/breadcrumbBar.jelly +++ b/core/src/main/resources/lib/layout/breadcrumbBar.jelly @@ -34,50 +34,47 @@ THE SOFTWARE. use the <l:breadcrumb> tag. - - - - \ No newline at end of file diff --git a/core/src/main/resources/lib/layout/breadcrumbs.js b/core/src/main/resources/lib/layout/breadcrumbs.js index f0e48a1b3f25..deafc163b8c0 100644 --- a/core/src/main/resources/lib/layout/breadcrumbs.js +++ b/core/src/main/resources/lib/layout/breadcrumbs.js @@ -99,84 +99,6 @@ var breadcrumbs = (function() { }; } - /** - * '>' control used to launch context menu. - */ - var menuSelector = (function() { - var menuSelector = $(document.createElement("div")); - var menuSelectorTarget; - var parentToUpdate; - - document.body.appendChild(menuSelector); - menuSelector.id = 'menuSelector'; - - /** - * @param target - * DOM node to attach this selector to. - */ - menuSelector.show = function(target) { - var xy = Dom.getXY(target); - - if ($(target).hasClassName("inside")) - xy[0] -= this.offsetWidth; // show the menu selector inside the text - - if ($(target).hasClassName("inverse")) { - menuSelector.addClassName("inverse"); - } else { - menuSelector.removeClassName("inverse"); - } - - xy[0] += target.offsetWidth; - xy[1] += target.offsetHeight/2 - this.offsetHeight/2; - Dom.setXY(this, xy); - this.target = target; - - this.style.visibility = "visible"; - - menuSelectorTarget = target; - var updateParentSelector = menuSelectorTarget.getAttribute('update-parent-class'); - if (updateParentSelector) { - parentToUpdate = $(menuSelectorTarget).up(updateParentSelector); - } - }; - menuSelector.hide = function() { - this.style.visibility = "hidden"; - menuSelectorTarget = undefined; - parentToUpdate = undefined; - }; - menuSelector.observe("click",function () { - invokeContextMenu(this.target); - }); - - // if the mouse leaves the selector, hide it - canceller = new Delayed(function () { - logger("hiding 'v'"); - menuSelector.hide(); - }.bind(menuSelector), 750); - - menuSelector.observe("mouseover",function () { - if (menuSelectorTarget) { - if (parentToUpdate) { - parentToUpdate.addClassName('model-link-active'); - } - menuSelectorTarget.addClassName('mouseIsOverMenuSelector'); - } - canceller.cancel(); - }); - menuSelector.observe("mouseout",function () { - canceller.schedule(); - if (menuSelectorTarget) { - if (parentToUpdate) { - parentToUpdate.removeClassName('model-link-active'); - } - menuSelectorTarget.removeClassName('mouseIsOverMenuSelector'); - } - }); - menuSelector.canceller = canceller; - - return menuSelector; - })(); - /** * Called when the user clicks a mouse to show a context menu. * @@ -249,10 +171,7 @@ var breadcrumbs = (function() { }); Behaviour.specify("#breadcrumbs LI.children", 'breadcrumbs', 0, function (a) { - a.observe("mouseover",function() { - menuSelector.hide(); - }); - a.observe("click",function() { + a.observe("click", function() { invokeContextMenu(this,"childrenContextMenu"); }) }); diff --git a/war/src/main/less/modules/breadcrumbs.less b/war/src/main/less/modules/breadcrumbs.less index e9286353e72e..d6a9e10682b1 100644 --- a/war/src/main/less/modules/breadcrumbs.less +++ b/war/src/main/less/modules/breadcrumbs.less @@ -1,120 +1,87 @@ -.jenkins-breadcrumbs { - -} - -#left-top-nav { - text-align: left; - color: #222; -} - -#left-top-nav a { - color: black; -} - -#top-nav .a { - color: white; -} - .jenkins-breadcrumbs { display: flex; - justify-content: space-between; align-items: center; - min-height: 2.5rem; - font-size: 1rem; - line-height: 1.5; - padding: 0 0.7rem; -} - -#breadcrumbs { - list-style-type: none; - margin: 0; - padding: 0; - min-height: 2.5rem; - display: block; - display: flex; - align-items: center; - flex: 1; - border-bottom: none; - flex-wrap: wrap; -} - -#breadcrumbs LI { - display: inline-block; -} - -#breadcrumbs LI A { - display: inline-flex; - align-items: center; - padding: 0.5rem; - font-weight: 500; - //font-size: 0.75rem; - border-radius: 6px; -} - -#breadcrumbs LI:hover, A.breadcrumbBarAnchor.mouseIsOverMenuSelector { - background-color: var(--breadcrumbs-item-bg-color--hover); -} - - -#breadcrumbs LI A, #breadcrumbs LI A:link, #breadcrumbs LI A:visited { - /* is this still needed? */ - max-width: 1330px; - - text-overflow: ellipsis; - text-decoration: none; - overflow: hidden; - white-space: nowrap; - font-weight: bold; - - display: inline-block; - display: inline-flex; - color: var(--breadcrumbs-text-color); -} - -#breadcrumbs LI.children, #breadcrumbs LI.separator { /* '>' separator between two items */ - width: 14px; - height: 14px; - background: currentColor; - mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='ionicon' viewBox='0 0 512 512'%3E%3Ctitle%3EChevron Forward%3C/title%3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='48' d='M184 112l144 144-144 144'/%3E%3C/svg%3E"); - margin: 6px; -} - -#breadcrumbs LI.children { - cursor: pointer; -} + padding: 0.5rem 0.7rem 0.5rem 0.75rem; + background: var(--table-background); + + & > ul { + display: flex; + align-items: center; + list-style-type: none; + margin: 0; + padding: 0; + flex: 1; + flex-wrap: wrap; + + & > li { + & > a { + position: relative; + display: inline-flex; + align-items: center; + justify-content: center; + padding: 0.2rem 0.4rem; + font-weight: 600; + font-size: 0.9rem; + border-radius: 6px; + color: var(--text-color); + z-index: 0; + text-decoration: none; + + &::before { + content: ""; + position: absolute; + top: -2px; + left: -4px; + bottom: -2px; + right: 0; + border-radius: 6px; + background: var(--text-color); + z-index: -1; + opacity: 0; + transition: 0.2s ease; + } + + &:hover { + &::before { + opacity: 0.05 !important; + background: var(--text-color); + } + } + + &:focus, &:active { + &::before { + opacity: 0.1 !important; + background: var(--text-color); + } + } + } + } -#breadcrumbs LI.children:hover:after { - border-left-color: var(--breadcrumbs-text-color); -} + // '>' separator between two items + .children, + .separator { + cursor: pointer; + width: 14px; + height: 14px; + background: var(--text-color); + mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='ionicon' viewBox='0 0 512 512'%3E%3Ctitle%3EChevron Forward%3C/title%3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='48' d='M184 112l144 144-144 144'/%3E%3C/svg%3E"); + margin: 6px; + opacity: 0.5; + transition: var(--standard-transition); -#breadcrumbs LI.separator:last-child { /* separators are for in-between only */ - display: none; -} + &:hover { + opacity: 1; + transform: rotate(90deg); + } -#menuSelector { /* used for showing 'v' on the right of the anchor */ - width: 14px; - height: 14px; - position: absolute; - visibility: hidden; - cursor: pointer; - z-index: 2000; - display: inline-flex; - align-items: center; - justify-content: center; - background: currentColor; - mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='ionicon' viewBox='0 0 512 512'%3E%3Ctitle%3EChevron Down%3C/title%3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='48' d='M112 184l144 144 144-144'/%3E%3C/svg%3E"); - transition: transform 0.2s ease, opacity 0.2s ease; - - &:active { - transform: translateY(2px); - opacity: 0.5; + &:active { + transform: translateY(2px) rotate(90deg); + opacity: 0.5; + } + } } } -#menuSelector.inverse:after { - border-top-color: #bcbcbc; -} - .jenkins-menu-dropdown-chevron { display: inline; width: 14px; @@ -125,7 +92,7 @@ background: var(--text-color); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='ionicon' viewBox='0 0 512 512'%3E%3Ctitle%3EChevron Down%3C/title%3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='48' d='M112 184l144 144 144-144'/%3E%3C/svg%3E"); mask-position: center; - transition: 0.2s ease; + transition: var(--standard-transition); cursor: pointer; padding: 0; margin-left: -14px; @@ -152,7 +119,10 @@ pointer-events: all; } + // For links with badges next to them, eg build monitor page, we need to shrink the margins of + // the badge so that it doesn't cause a table column resize, yet doesn't change in appearance & + a.model-link { + transform: translateX(10px); margin-right: calc((14px + 1ch) * -1) !important; } } @@ -164,7 +134,10 @@ } } +// TODO: Remove when YUI dropdowns are removed + #breadcrumb-menu .header { font-weight: bold; font-size: 0.875rem; + pointer-events: none; } diff --git a/war/src/main/less/modules/table.less b/war/src/main/less/modules/table.less index 0c094aeb60f4..e72e847a3de9 100644 --- a/war/src/main/less/modules/table.less +++ b/war/src/main/less/modules/table.less @@ -22,8 +22,6 @@ padding-bottom: calc(var(--table-padding) * 1.75); padding-left: var(--table-padding); font-weight: 600; - //text-transform: uppercase; - //letter-spacing: 2px; font-size: 0.85rem; &[align="center"] { From 384d3e8ba31eb597e373483dfc26ee4281cd9107 Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Thu, 25 Nov 2021 22:01:25 +0000 Subject: [PATCH 04/37] Update tabs.less --- war/src/main/less/modules/tabs.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/war/src/main/less/modules/tabs.less b/war/src/main/less/modules/tabs.less index f3e97264250a..ea74435f3ee0 100644 --- a/war/src/main/less/modules/tabs.less +++ b/war/src/main/less/modules/tabs.less @@ -22,7 +22,7 @@ min-width: 3rem; text-decoration: none; margin: 2.5px; - padding: 0.4rem 1.2rem; + padding: 0.3rem 1.2rem; border-radius: 100px; background: var(--tabs-item-background); color: var(--tabs-item-foreground); From deac385caf2605683f574c6a308d9f93ca5ce175 Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Sat, 27 Nov 2021 22:00:01 +0000 Subject: [PATCH 05/37] Fix missing chevron on user name in header --- core/src/main/resources/lib/layout/pageHeader.jelly | 2 +- war/src/main/less/modules/page-header.less | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/resources/lib/layout/pageHeader.jelly b/core/src/main/resources/lib/layout/pageHeader.jelly index 63d137450049..5f2c0e63b6bb 100644 --- a/core/src/main/resources/lib/layout/pageHeader.jelly +++ b/core/src/main/resources/lib/layout/pageHeader.jelly @@ -82,7 +82,7 @@ - + diff --git a/war/src/main/less/modules/page-header.less b/war/src/main/less/modules/page-header.less index 4daaaeeff10e..b566e76359b0 100644 --- a/war/src/main/less/modules/page-header.less +++ b/war/src/main/less/modules/page-header.less @@ -51,6 +51,7 @@ a.page-header__brand-link { } .page-header__hyperlinks a { + --text-color: var(--header-link-color); display: inline-flex; align-items: center; From 3470703fd616a6eaf2045b7002602f985fa7b1af Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Sun, 28 Nov 2021 16:03:19 +0000 Subject: [PATCH 06/37] Update headerContent.jelly --- .../resources/jenkins/views/JenkinsHeader/headerContent.jelly | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/resources/jenkins/views/JenkinsHeader/headerContent.jelly b/core/src/main/resources/jenkins/views/JenkinsHeader/headerContent.jelly index 6018c3b7f5b4..5b7485c60a33 100644 --- a/core/src/main/resources/jenkins/views/JenkinsHeader/headerContent.jelly +++ b/core/src/main/resources/jenkins/views/JenkinsHeader/headerContent.jelly @@ -56,7 +56,7 @@ - + From a5a24a997401b2815aad687738c519745e1a8315 Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Sun, 28 Nov 2021 22:57:39 +0000 Subject: [PATCH 07/37] Cleanup header container, use native sticky when possible --- .../views/JenkinsHeader/headerContent.jelly | 2 +- .../main/resources/lib/layout/layout.jelly | 6 +-- war/src/main/js/util/page.js | 2 +- war/src/main/less/base/layout-commons.less | 2 +- war/src/main/less/base/style.less | 2 +- war/src/main/less/modules/breadcrumbs.less | 6 +++ .../main/webapp/scripts/hudson-behavior.js | 51 +++++++++++-------- 7 files changed, 41 insertions(+), 30 deletions(-) diff --git a/core/src/main/resources/jenkins/views/JenkinsHeader/headerContent.jelly b/core/src/main/resources/jenkins/views/JenkinsHeader/headerContent.jelly index 5b7485c60a33..3d84ec708efa 100644 --- a/core/src/main/resources/jenkins/views/JenkinsHeader/headerContent.jelly +++ b/core/src/main/resources/jenkins/views/JenkinsHeader/headerContent.jelly @@ -1,6 +1,6 @@ -
  • - \ No newline at end of file + diff --git a/core/src/main/resources/lib/layout/breadcrumbs.js b/core/src/main/resources/lib/layout/breadcrumbs.js index deafc163b8c0..b33ff30c2c31 100644 --- a/core/src/main/resources/lib/layout/breadcrumbs.js +++ b/core/src/main/resources/lib/layout/breadcrumbs.js @@ -109,9 +109,7 @@ var breadcrumbs = (function() { * @param {String} contextMenuUrl * The URL that renders JSON for context menu. Optional. */ - function invokeContextMenu(e,contextMenuUrl) { - contextMenuUrl = contextMenuUrl || "contextMenu"; - + function invokeContextMenu(e) { function showMenu(items) { menu.hide(); var pos = [e, "tl", "bl"]; @@ -129,10 +127,13 @@ var breadcrumbs = (function() { if (e.items) {// use what's already loaded showMenu(e.items()); - } else {// fetch menu on demand - xhr = new Ajax.Request(combinePath(e.getAttribute("href"),contextMenuUrl), { + } else { + var items = [] + + // fetch menu on demand + xhr = new Ajax.Request(combinePath(e.getAttribute("href"), "contextMenu"), { onComplete:function (x) { - var a = x.responseText.evalJSON().items; + items = x.responseText.evalJSON().items; function fillMenuItem(e) { if (e.header) { e.text = makeMenuHtml(e.icon, "" + e.displayName + ""); @@ -149,12 +150,38 @@ var breadcrumbs = (function() { delete e.url; } } - a.each(fillMenuItem); - - e.items = function() { return a }; - showMenu(a); + items.each(fillMenuItem); } }); + + // items.append("") + + // fetch menu on demand + xhr2 = new Ajax.Request(combinePath(e.getAttribute("href"), "childrenContextMenu"), { + onComplete:function (x) { + tempItems = x.responseText.evalJSON().items; + function fillMenuItem(e) { + if (e.header) { + e.text = makeMenuHtml(e.icon, "" + e.displayName + ""); + } else { + e.text = makeMenuHtml(e.icon, e.displayName); + } + if (e.subMenu!=null) + e.subMenu = {id:"submenu"+(iota++), itemdata:e.subMenu.items.each(fillMenuItem)}; + if (e.requiresConfirmation) { + e.onclick = {fn: requireConfirmation, obj: {url: e.url, displayName: e.displayName, post: e.post}}; + delete e.url; + } else if (e.post) { + e.onclick = {fn: postRequest, obj: e.url}; + delete e.url; + } + } + tempItems.each(fillMenuItem); + } + }); + + e.items = function() { return [...items, ...tempItems] }; + showMenu([...items, ...tempItems]); } return false; @@ -172,14 +199,10 @@ var breadcrumbs = (function() { Behaviour.specify("#breadcrumbs LI.children", 'breadcrumbs', 0, function (a) { a.observe("click", function() { - invokeContextMenu(this,"childrenContextMenu"); + invokeContextMenu(this,null); }) }); - Behaviour.specify("#breadcrumbs A", 'breadcrumbs', 0, function (a) { - $(a).addClassName('breadcrumbBarAnchor'); - }); - /** * @namespace breadcrumbs * @class ContextMenu diff --git a/war/src/main/less/modules/breadcrumbs.less b/war/src/main/less/modules/breadcrumbs.less index 294c52d3256d..069796ede916 100644 --- a/war/src/main/less/modules/breadcrumbs.less +++ b/war/src/main/less/modules/breadcrumbs.less @@ -39,7 +39,7 @@ top: -2px; left: -4px; bottom: -2px; - right: 0; + right: -4px; border-radius: 6px; background: var(--text-color); z-index: -1; From 9476243af92643848609f0588c6b9f90ee506306 Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Sat, 1 Jan 2022 15:36:55 +0000 Subject: [PATCH 15/37] Minor styling changes to breadcrumb bar --- war/src/main/less/base-styles-v2.less | 1 + war/src/main/less/modules/breadcrumbs.less | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/war/src/main/less/base-styles-v2.less b/war/src/main/less/base-styles-v2.less index f903d9893c10..31b022ee3e16 100644 --- a/war/src/main/less/base-styles-v2.less +++ b/war/src/main/less/base-styles-v2.less @@ -13,6 +13,7 @@ html { // The downside is that the page does not resize with the browser's font size, // only with the zoom level. font-size: 16px !important; + letter-spacing: -0.011em; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } diff --git a/war/src/main/less/modules/breadcrumbs.less b/war/src/main/less/modules/breadcrumbs.less index 069796ede916..b0c39c421a0e 100644 --- a/war/src/main/less/modules/breadcrumbs.less +++ b/war/src/main/less/modules/breadcrumbs.less @@ -8,7 +8,15 @@ display: flex; align-items: center; padding: 0.5rem 0.7rem 0.5rem 0.75rem; - background: var(--table-background); + backdrop-filter: blur(15px); + + &::before { + content: ""; + position: absolute; + inset: 0; + background: var(--table-background); + opacity: 0.95; + } & > ul { display: flex; From d18bbc6bd344063be0e844503abb5dbcf35d2a78 Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Sat, 1 Jan 2022 20:58:54 +0000 Subject: [PATCH 16/37] Javarey menus beat loading them twice --- .../model/ModelObjectWithChildren.java | 2 +- .../model/ModelObjectWithContextMenu.java | 27 +++++++++--- .../model/ModelObjectWithPageMenu.java | 42 +++++++++++++++++++ .../main/resources/lib/layout/breadcrumbs.js | 42 ++++--------------- war/src/main/less/modules/breadcrumbs.less | 2 +- 5 files changed, 74 insertions(+), 41 deletions(-) create mode 100644 core/src/main/java/jenkins/model/ModelObjectWithPageMenu.java diff --git a/core/src/main/java/jenkins/model/ModelObjectWithChildren.java b/core/src/main/java/jenkins/model/ModelObjectWithChildren.java index c8d544e03ed8..b1c9178479ec 100644 --- a/core/src/main/java/jenkins/model/ModelObjectWithChildren.java +++ b/core/src/main/java/jenkins/model/ModelObjectWithChildren.java @@ -16,7 +16,7 @@ * @see ModelObjectWithContextMenu * @since 1.513 */ -public interface ModelObjectWithChildren extends ModelObject { +public interface ModelObjectWithChildren extends ModelObject, ModelObjectWithPageMenu { /** * Generates the context menu to list up all the children. */ diff --git a/core/src/main/java/jenkins/model/ModelObjectWithContextMenu.java b/core/src/main/java/jenkins/model/ModelObjectWithContextMenu.java index 9c43d68a3411..77a071b42a5a 100644 --- a/core/src/main/java/jenkins/model/ModelObjectWithContextMenu.java +++ b/core/src/main/java/jenkins/model/ModelObjectWithContextMenu.java @@ -47,7 +47,7 @@ * @author Kohsuke Kawaguchi * @see ModelObjectWithChildren */ -public interface ModelObjectWithContextMenu extends ModelObject { +public interface ModelObjectWithContextMenu extends ModelObject, ModelObjectWithPageMenu { /** * Generates the context menu. * @@ -139,7 +139,18 @@ public ContextMenu add(String url, String icon, String text, boolean post, boole @Restricted(DoNotUse.class) // manage.jelly only public ContextMenu addHeader(String title) { final MenuItem item = new MenuItem().withDisplayName(title); - item.header = true; + item.type = MenuItemType.HEADER; + return add(item); + } + + /** + * Add a separator row (no icon, no URL, no text). + * + * @since TODO + */ + public ContextMenu addSeparator() { + final MenuItem item = new MenuItem(); + item.type = MenuItemType.SEPARATOR; return add(item); } @@ -284,12 +295,12 @@ class MenuItem { /** - * True to display this item as a section header. - * @since 2.231 + * TODO + * @since TODO */ @Exported @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD", justification = "read by Stapler") - public boolean header; + public MenuItemType type = MenuItemType.ITEM; /** * If this is a submenu, definition of subitems. @@ -353,6 +364,12 @@ public MenuItem withDisplayName(ModelObject o) { } } + enum MenuItemType { + ITEM, + HEADER, + SEPARATOR + } + /** * Allows an action to decide whether it will be visible in a context menu. * @since 1.538 diff --git a/core/src/main/java/jenkins/model/ModelObjectWithPageMenu.java b/core/src/main/java/jenkins/model/ModelObjectWithPageMenu.java new file mode 100644 index 000000000000..1ad3fd268b8a --- /dev/null +++ b/core/src/main/java/jenkins/model/ModelObjectWithPageMenu.java @@ -0,0 +1,42 @@ +package jenkins.model; + +import hudson.Functions; +import hudson.model.ModelObject; +import jenkins.model.ModelObjectWithContextMenu.ContextMenu; +import org.kohsuke.stapler.StaplerRequest; +import org.kohsuke.stapler.StaplerResponse; + +/** + * {@link ModelObject} that has tTODO TODO TODO TODO TODO TODO TODO TODO + * + *

    + * The children context menu is to show all the immediate children that this model object owns, + * thereby providing quicker navigation to ancestors' siblings in the breadcrumb. + * + * @author Jan Faracik + * @see ModelObjectWithContextMenu + * @since ???? + */ +public interface ModelObjectWithPageMenu extends ModelObject { + default ContextMenu doPageMenu(StaplerRequest request, StaplerResponse response) throws Exception { + ContextMenu contextMenu = new ContextMenu(); + + if (Functions.isModelWithContextMenu(this)) { + ModelObjectWithContextMenu modelObjectWithContextMenu = (ModelObjectWithContextMenu) this; + contextMenu.items.addAll(modelObjectWithContextMenu.doContextMenu(request, response).items); + } + + if (Functions.isModelWithChildren(this)) { + ModelObjectWithChildren modelObjectWithChildren = (ModelObjectWithChildren) this; + ContextMenu childrenMenu = modelObjectWithChildren.doChildrenContextMenu(request, response); + + if (!contextMenu.items.isEmpty() && !childrenMenu.items.isEmpty()) { + contextMenu.addSeparator(); + } + + contextMenu.items.addAll(childrenMenu.items); + } + + return contextMenu; + } +} diff --git a/core/src/main/resources/lib/layout/breadcrumbs.js b/core/src/main/resources/lib/layout/breadcrumbs.js index b33ff30c2c31..8e8a7c578270 100644 --- a/core/src/main/resources/lib/layout/breadcrumbs.js +++ b/core/src/main/resources/lib/layout/breadcrumbs.js @@ -128,17 +128,18 @@ var breadcrumbs = (function() { if (e.items) {// use what's already loaded showMenu(e.items()); } else { - var items = [] // fetch menu on demand - xhr = new Ajax.Request(combinePath(e.getAttribute("href"), "contextMenu"), { + xhr = new Ajax.Request(combinePath(e.getAttribute("href"), "pageMenu"), { onComplete:function (x) { - items = x.responseText.evalJSON().items; + var items = x.responseText.evalJSON().items; function fillMenuItem(e) { - if (e.header) { + if (e.type === "HEADER") { e.text = makeMenuHtml(e.icon, "" + e.displayName + ""); + } else if (e.type === "SEPARATOR") { + e.text = "-------------------------"; } else { - e.text = makeMenuHtml(e.icon, e.displayName); + e.text = makeMenuHtml(e.icon, e.displayName); } if (e.subMenu!=null) e.subMenu = {id:"submenu"+(iota++), itemdata:e.subMenu.items.each(fillMenuItem)}; @@ -151,37 +152,10 @@ var breadcrumbs = (function() { } } items.each(fillMenuItem); + e.items = function() { return items }; + showMenu(items); } }); - - // items.append("") - - // fetch menu on demand - xhr2 = new Ajax.Request(combinePath(e.getAttribute("href"), "childrenContextMenu"), { - onComplete:function (x) { - tempItems = x.responseText.evalJSON().items; - function fillMenuItem(e) { - if (e.header) { - e.text = makeMenuHtml(e.icon, "" + e.displayName + ""); - } else { - e.text = makeMenuHtml(e.icon, e.displayName); - } - if (e.subMenu!=null) - e.subMenu = {id:"submenu"+(iota++), itemdata:e.subMenu.items.each(fillMenuItem)}; - if (e.requiresConfirmation) { - e.onclick = {fn: requireConfirmation, obj: {url: e.url, displayName: e.displayName, post: e.post}}; - delete e.url; - } else if (e.post) { - e.onclick = {fn: postRequest, obj: e.url}; - delete e.url; - } - } - tempItems.each(fillMenuItem); - } - }); - - e.items = function() { return [...items, ...tempItems] }; - showMenu([...items, ...tempItems]); } return false; diff --git a/war/src/main/less/modules/breadcrumbs.less b/war/src/main/less/modules/breadcrumbs.less index b0c39c421a0e..418dccaeafd9 100644 --- a/war/src/main/less/modules/breadcrumbs.less +++ b/war/src/main/less/modules/breadcrumbs.less @@ -35,7 +35,7 @@ justify-content: center; padding: 0.2rem 0.4rem; font-weight: 600; - font-size: 0.9rem; + font-size: 0.85rem; border-radius: 6px; color: var(--text-color); z-index: 0; From 8abb6c3f828e414b9d62af1c558160044657b468 Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Sun, 2 Jan 2022 19:01:40 +0000 Subject: [PATCH 17/37] Fix config page breadcrumb dropdown, adjust js doc --- .../lib/form/breadcrumb-config-outline.jelly | 4 ++-- .../lib/form/breadcrumb-config-outline/init.js | 6 +++++- core/src/main/resources/lib/layout/breadcrumb.jelly | 4 ++-- core/src/main/resources/lib/layout/breadcrumbs.js | 11 ++++++----- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/core/src/main/resources/lib/form/breadcrumb-config-outline.jelly b/core/src/main/resources/lib/form/breadcrumb-config-outline.jelly index 19434e0f843c..83e3d1e1bec5 100644 --- a/core/src/main/resources/lib/form/breadcrumb-config-outline.jelly +++ b/core/src/main/resources/lib/form/breadcrumb-config-outline.jelly @@ -29,5 +29,5 @@ THE SOFTWARE. - - \ No newline at end of file + + diff --git a/core/src/main/resources/lib/form/breadcrumb-config-outline/init.js b/core/src/main/resources/lib/form/breadcrumb-config-outline/init.js index 46dc20a9e6f6..6a74045ea3ff 100644 --- a/core/src/main/resources/lib/form/breadcrumb-config-outline/init.js +++ b/core/src/main/resources/lib/form/breadcrumb-config-outline/init.js @@ -13,5 +13,9 @@ Event.observe(window, "load", function () { $(e.section).insert({top:"#"}); menu.add('#' + id, null, caption); }); - breadcrumbs.attachMenu('inpage-nav', menu); + var inpageNav = document.getElementById("inpage-nav") + var chevron = document.createElement("li") + chevron.classList.add("children") + inpageNav.parentNode.insertBefore(chevron, inpageNav.nextSibling); + breadcrumbs.attachMenu(chevron, menu); }); diff --git a/core/src/main/resources/lib/layout/breadcrumb.jelly b/core/src/main/resources/lib/layout/breadcrumb.jelly index a9ee93907046..56117a62d83d 100644 --- a/core/src/main/resources/lib/layout/breadcrumb.jelly +++ b/core/src/main/resources/lib/layout/breadcrumb.jelly @@ -40,9 +40,9 @@ THE SOFTWARE.

  • - + ${attrs.title}
  • - \ No newline at end of file + diff --git a/core/src/main/resources/lib/layout/breadcrumbs.js b/core/src/main/resources/lib/layout/breadcrumbs.js index 8e8a7c578270..486a7880cac7 100644 --- a/core/src/main/resources/lib/layout/breadcrumbs.js +++ b/core/src/main/resources/lib/layout/breadcrumbs.js @@ -106,8 +106,6 @@ var breadcrumbs = (function() { * * @param {HTMLElement} e * anchor tag - * @param {String} contextMenuUrl - * The URL that renders JSON for context menu. Optional. */ function invokeContextMenu(e) { function showMenu(items) { @@ -166,14 +164,14 @@ var breadcrumbs = (function() { dropdownChevron.className = "jenkins-menu-dropdown-chevron" dropdownChevron.addEventListener("click", function(e) { e.preventDefault(); - invokeContextMenu(link, null); + invokeContextMenu(link); }) link.appendChild(dropdownChevron) }); Behaviour.specify("#breadcrumbs LI.children", 'breadcrumbs', 0, function (a) { a.observe("click", function() { - invokeContextMenu(this,null); + invokeContextMenu(this); }) }); @@ -209,7 +207,10 @@ var breadcrumbs = (function() { * populating the content. */ "attachMenu" : function (li,menu) { - $(li).firstChild.items = (typeof menu=="function") ? menu : function() { return menu.items }; + $(li).items = (typeof menu=="function") ? menu : function() { return menu.items }; + $(li).addEventListener("click", function() { + invokeContextMenu($(li)); + }) }, "ContextMenu" : ContextMenu From 9adbd5d8672b5c133ef54a841e27a6e1cb954aff Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Sun, 2 Jan 2022 19:09:47 +0000 Subject: [PATCH 18/37] Update Javadoc --- .../jenkins/model/ModelObjectWithContextMenu.java | 6 +++--- .../java/jenkins/model/ModelObjectWithPageMenu.java | 12 +++++++----- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/core/src/main/java/jenkins/model/ModelObjectWithContextMenu.java b/core/src/main/java/jenkins/model/ModelObjectWithContextMenu.java index 77a071b42a5a..97046b2c5c00 100644 --- a/core/src/main/java/jenkins/model/ModelObjectWithContextMenu.java +++ b/core/src/main/java/jenkins/model/ModelObjectWithContextMenu.java @@ -146,7 +146,7 @@ public ContextMenu addHeader(String title) { /** * Add a separator row (no icon, no URL, no text). * - * @since TODO + * @since TODO - Provide version */ public ContextMenu addSeparator() { final MenuItem item = new MenuItem(); @@ -295,8 +295,8 @@ class MenuItem { /** - * TODO - * @since TODO + * The type of menu item + * @since TODO - Provide version */ @Exported @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD", justification = "read by Stapler") diff --git a/core/src/main/java/jenkins/model/ModelObjectWithPageMenu.java b/core/src/main/java/jenkins/model/ModelObjectWithPageMenu.java index 1ad3fd268b8a..2a31caa97b7e 100644 --- a/core/src/main/java/jenkins/model/ModelObjectWithPageMenu.java +++ b/core/src/main/java/jenkins/model/ModelObjectWithPageMenu.java @@ -7,15 +7,17 @@ import org.kohsuke.stapler.StaplerResponse; /** - * {@link ModelObject} that has tTODO TODO TODO TODO TODO TODO TODO TODO + * {@link ModelObject} that has a page menu in the breadcrumb bar or menu in its page link * *

    - * The children context menu is to show all the immediate children that this model object owns, - * thereby providing quicker navigation to ancestors' siblings in the breadcrumb. + * The page context menu is accessible to the user via the breadcrumb bar or via a link + * to the object's page. The page menu combines the page's contextMenu and childrenContextMenu, + * making it easier for users to navigate to all the ancestor objects this model object owns, + * and its children. * - * @author Jan Faracik + * @author Jan Faracik, Lewis Birks * @see ModelObjectWithContextMenu - * @since ???? + * @since TODO - Provide version */ public interface ModelObjectWithPageMenu extends ModelObject { default ContextMenu doPageMenu(StaplerRequest request, StaplerResponse response) throws Exception { From d4eafef3b127a5fe50620808985455dd71d08abf Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Mon, 3 Jan 2022 13:00:30 +0000 Subject: [PATCH 19/37] Fix breadcrumb link --- .../src/main/resources/lib/form/breadcrumb-config-outline.jelly | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/resources/lib/form/breadcrumb-config-outline.jelly b/core/src/main/resources/lib/form/breadcrumb-config-outline.jelly index 83e3d1e1bec5..14a23b312304 100644 --- a/core/src/main/resources/lib/form/breadcrumb-config-outline.jelly +++ b/core/src/main/resources/lib/form/breadcrumb-config-outline.jelly @@ -29,5 +29,5 @@ THE SOFTWARE. - + From 279911c0f146b0975c5241648514fe307bfc7832 Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Mon, 3 Jan 2022 13:28:21 +0000 Subject: [PATCH 20/37] Update core/src/main/resources/lib/form/breadcrumb-config-outline.jelly Thanks @timja Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com> --- .../src/main/resources/lib/form/breadcrumb-config-outline.jelly | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/resources/lib/form/breadcrumb-config-outline.jelly b/core/src/main/resources/lib/form/breadcrumb-config-outline.jelly index 14a23b312304..5da94f85d051 100644 --- a/core/src/main/resources/lib/form/breadcrumb-config-outline.jelly +++ b/core/src/main/resources/lib/form/breadcrumb-config-outline.jelly @@ -29,5 +29,5 @@ THE SOFTWARE. - + From ef27fb3b68b6a484ca72e742163a91197b39a4de Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Tue, 11 Jan 2022 20:32:51 +0000 Subject: [PATCH 21/37] Update separator design --- .../main/resources/lib/layout/breadcrumbs.js | 2 +- war/src/main/less/modules/breadcrumbs.less | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/core/src/main/resources/lib/layout/breadcrumbs.js b/core/src/main/resources/lib/layout/breadcrumbs.js index 486a7880cac7..a20a0fd52a6a 100644 --- a/core/src/main/resources/lib/layout/breadcrumbs.js +++ b/core/src/main/resources/lib/layout/breadcrumbs.js @@ -135,7 +135,7 @@ var breadcrumbs = (function() { if (e.type === "HEADER") { e.text = makeMenuHtml(e.icon, "" + e.displayName + ""); } else if (e.type === "SEPARATOR") { - e.text = "-------------------------"; + e.text = "--" } else { e.text = makeMenuHtml(e.icon, e.displayName); } diff --git a/war/src/main/less/modules/breadcrumbs.less b/war/src/main/less/modules/breadcrumbs.less index 418dccaeafd9..2e381db12c6e 100644 --- a/war/src/main/less/modules/breadcrumbs.less +++ b/war/src/main/less/modules/breadcrumbs.less @@ -211,3 +211,22 @@ font-size: 0.875rem; pointer-events: none; } + +#breadcrumb-menu .separator { + position: relative; + display: block !important; + color: transparent; + overflow: hidden; + width: 100%; + + &::after { + content: ""; + position: absolute; + top: 9px; + left: -50vw; + right: -50vw; + background: var(--text-color); + height: 2px; + opacity: 0.1; + } +} From 745f51715f27f89576794f50b5d55623a2cf025e Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Tue, 11 Jan 2022 20:34:44 +0000 Subject: [PATCH 22/37] Make menu headers/separators non-clickable --- core/src/main/resources/lib/layout/breadcrumbs.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/main/resources/lib/layout/breadcrumbs.js b/core/src/main/resources/lib/layout/breadcrumbs.js index a20a0fd52a6a..e7be2da440cd 100644 --- a/core/src/main/resources/lib/layout/breadcrumbs.js +++ b/core/src/main/resources/lib/layout/breadcrumbs.js @@ -134,8 +134,10 @@ var breadcrumbs = (function() { function fillMenuItem(e) { if (e.type === "HEADER") { e.text = makeMenuHtml(e.icon, "" + e.displayName + ""); + e.disabled = true; } else if (e.type === "SEPARATOR") { - e.text = "--" + e.text = "--"; + e.disabled = true; } else { e.text = makeMenuHtml(e.icon, e.displayName); } From 7bcf1f0479d0ffa30b5445daf9cb96067ebba78c Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Tue, 11 Jan 2022 20:46:37 +0000 Subject: [PATCH 23/37] Fix build breadcrumb menu not appearing --- core/src/main/resources/lib/layout/breadcrumbBar.jelly | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/resources/lib/layout/breadcrumbBar.jelly b/core/src/main/resources/lib/layout/breadcrumbBar.jelly index fd3f2bb3741b..62940e069b91 100644 --- a/core/src/main/resources/lib/layout/breadcrumbBar.jelly +++ b/core/src/main/resources/lib/layout/breadcrumbBar.jelly @@ -56,7 +56,7 @@ THE SOFTWARE. - +

  • From c4be993214b37abaec0b912ea79214a12426f312 Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Tue, 11 Jan 2022 20:52:38 +0000 Subject: [PATCH 24/37] Update styling slightly --- war/src/main/less/modules/breadcrumbs.less | 29 ++++++++++++++++------ 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/war/src/main/less/modules/breadcrumbs.less b/war/src/main/less/modules/breadcrumbs.less index 2e381db12c6e..68798eca8efb 100644 --- a/war/src/main/less/modules/breadcrumbs.less +++ b/war/src/main/less/modules/breadcrumbs.less @@ -34,25 +34,33 @@ align-items: center; justify-content: center; padding: 0.2rem 0.4rem; - font-weight: 600; + font-weight: 500; font-size: 0.85rem; border-radius: 6px; color: var(--text-color); z-index: 0; text-decoration: none; - &::before { + &::before, + &::after { content: ""; position: absolute; - top: -2px; - left: -4px; - bottom: -2px; - right: -4px; + top: -1px; + left: -2px; + bottom: -1px; + right: -2px; border-radius: 6px; - background: var(--text-color); z-index: -1; opacity: 0; - transition: 0.2s ease; + transition: var(--standard-transition) + } + + &::before { + background: var(--text-color); + } + + &::after { + box-shadow: 0 0 0 10px transparent; } &:hover { @@ -67,6 +75,11 @@ opacity: 0.1 !important; background: var(--text-color); } + + &::after { + opacity: 0.05 !important; + box-shadow: 0 0 0 5px var(--text-color); + } } } } From ee6c5fd2bed6186526882dbc1f97aad1b932f707 Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Wed, 12 Jan 2022 19:50:21 +0000 Subject: [PATCH 25/37] Improve model links for console/text no longer moves + text now copies correctly on firefox --- .../hudson/console/ModelHyperlinkNote.java | 2 +- .../main/resources/lib/layout/breadcrumbs.js | 4 +- war/src/main/less/modules/breadcrumbs.less | 71 ++++++++++++++++++- 3 files changed, 74 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/hudson/console/ModelHyperlinkNote.java b/core/src/main/java/hudson/console/ModelHyperlinkNote.java index 51f413501634..fa5d57eedd4e 100644 --- a/core/src/main/java/hudson/console/ModelHyperlinkNote.java +++ b/core/src/main/java/hudson/console/ModelHyperlinkNote.java @@ -27,7 +27,7 @@ public ModelHyperlinkNote(String url, int length) { @Override protected String extraAttributes() { - return " class='model-link'"; + return " class='model-link model-link--float'"; } public static String encodeTo(@NonNull User u) { diff --git a/core/src/main/resources/lib/layout/breadcrumbs.js b/core/src/main/resources/lib/layout/breadcrumbs.js index e7be2da440cd..4b14c0e7a5f7 100644 --- a/core/src/main/resources/lib/layout/breadcrumbs.js +++ b/core/src/main/resources/lib/layout/breadcrumbs.js @@ -162,7 +162,9 @@ var breadcrumbs = (function() { } Behaviour.specify("A.model-link", 'breadcrumbs', 0, function (link) { - const dropdownChevron = document.createElement("button") + const isFirefox = (navigator.userAgent.indexOf("Firefox") !== -1) + // Firefox adds unwanted lines when copying buttons in text, so use a span instead + const dropdownChevron = document.createElement(isFirefox ? "span" : "button") dropdownChevron.className = "jenkins-menu-dropdown-chevron" dropdownChevron.addEventListener("click", function(e) { e.preventDefault(); diff --git a/war/src/main/less/modules/breadcrumbs.less b/war/src/main/less/modules/breadcrumbs.less index 68798eca8efb..0b43c4e6698c 100644 --- a/war/src/main/less/modules/breadcrumbs.less +++ b/war/src/main/less/modules/breadcrumbs.less @@ -136,7 +136,7 @@ .jenkins-menu-dropdown-chevron { position: relative; - display: inline; + display: inline-block; width: 14px; height: 14px; border: none; @@ -190,8 +190,18 @@ } .model-link { + position: relative; transition: var(--standard-transition) !important; + &::before { + content: ""; + position: absolute; + top: -7px; + left: -10px; + bottom: -7px; + right: -10px; + } + &:hover { .jenkins-menu-dropdown-chevron { margin-left: 1ch; @@ -217,6 +227,65 @@ } } +.model-link--float { + z-index: 0; + + &::before, + &::after { + content: ""; + position: absolute; + top: -7px; + left: -10px; + bottom: -7px; + right: -10px; + opacity: 0; + border-radius: 6px; + transition: var(--standard-transition); + } + + &::before { + z-index: -2; + background: var(--background); + } + + &::after { + z-index: -1; + background: var(--text-color); + } + + .jenkins-menu-dropdown-chevron { + position: absolute; + top: 1px; + right: 0; + margin-left: 0 !important; + } + + &:hover { + z-index: 10; + + &::before, + &::after { + right: calc((2ch + 14px) * -1); + } + + &::before { + opacity: 1; + } + + &::after { + opacity: 0.05; + } + + .jenkins-menu-dropdown-chevron { + right: calc((1ch + 14px) * -1); + + &::after { + opacity: 0.5; + } + } + } +} + // TODO: Remove when YUI dropdowns are removed #breadcrumb-menu .header { From 989a0bca3a816f26a6d647952d8eedd896b4ac93 Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Wed, 12 Jan 2022 19:58:54 +0000 Subject: [PATCH 26/37] Breadcrumb chevrons without menus no longer have hover/active states, hide non menu separators if theyre last --- war/src/main/less/modules/breadcrumbs.less | 33 ++++++++++++++-------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/war/src/main/less/modules/breadcrumbs.less b/war/src/main/less/modules/breadcrumbs.less index 0b43c4e6698c..4695de508a4c 100644 --- a/war/src/main/less/modules/breadcrumbs.less +++ b/war/src/main/less/modules/breadcrumbs.less @@ -88,11 +88,27 @@ .children, .separator { position: relative; - cursor: pointer; width: 14px; height: 14px; margin: 6px; + &::after { + content: ""; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + opacity: 0.5; + transition: var(--standard-transition); + background: var(--text-color); + mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='ionicon' viewBox='0 0 512 512'%3E%3Ctitle%3EChevron Forward%3C/title%3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='48' d='M184 112l144 144-144 144'/%3E%3C/svg%3E"); + } + } + + .children { + cursor: pointer; + &:hover { &::after { opacity: 1; @@ -117,18 +133,11 @@ right: -5px; background: transparent; } + } - &::after { - content: ""; - position: absolute; - top: 0; - left: 0; - bottom: 0; - right: 0; - opacity: 0.5; - transition: var(--standard-transition); - background: var(--text-color); - mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='ionicon' viewBox='0 0 512 512'%3E%3Ctitle%3EChevron Forward%3C/title%3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='48' d='M184 112l144 144-144 144'/%3E%3C/svg%3E"); + .separator { + &:last-of-type { + display: none; } } } From 1e3f68d8fe5044a3cce6d39809f09234df0bb014 Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Sun, 13 Feb 2022 20:13:45 +0000 Subject: [PATCH 27/37] Restore separate breadcrumb dropdowns --- .../model/ModelObjectWithChildren.java | 2 +- .../model/ModelObjectWithContextMenu.java | 2 +- .../model/ModelObjectWithPageMenu.java | 44 ------------------- .../resources/lib/layout/breadcrumbBar.jelly | 4 +- .../main/resources/lib/layout/breadcrumbs.js | 13 ++++-- 5 files changed, 14 insertions(+), 51 deletions(-) delete mode 100644 core/src/main/java/jenkins/model/ModelObjectWithPageMenu.java diff --git a/core/src/main/java/jenkins/model/ModelObjectWithChildren.java b/core/src/main/java/jenkins/model/ModelObjectWithChildren.java index b1c9178479ec..c8d544e03ed8 100644 --- a/core/src/main/java/jenkins/model/ModelObjectWithChildren.java +++ b/core/src/main/java/jenkins/model/ModelObjectWithChildren.java @@ -16,7 +16,7 @@ * @see ModelObjectWithContextMenu * @since 1.513 */ -public interface ModelObjectWithChildren extends ModelObject, ModelObjectWithPageMenu { +public interface ModelObjectWithChildren extends ModelObject { /** * Generates the context menu to list up all the children. */ diff --git a/core/src/main/java/jenkins/model/ModelObjectWithContextMenu.java b/core/src/main/java/jenkins/model/ModelObjectWithContextMenu.java index 1de447abe853..06595ab31e5b 100644 --- a/core/src/main/java/jenkins/model/ModelObjectWithContextMenu.java +++ b/core/src/main/java/jenkins/model/ModelObjectWithContextMenu.java @@ -49,7 +49,7 @@ * @author Kohsuke Kawaguchi * @see ModelObjectWithChildren */ -public interface ModelObjectWithContextMenu extends ModelObject, ModelObjectWithPageMenu { +public interface ModelObjectWithContextMenu extends ModelObject { /** * Generates the context menu. * diff --git a/core/src/main/java/jenkins/model/ModelObjectWithPageMenu.java b/core/src/main/java/jenkins/model/ModelObjectWithPageMenu.java deleted file mode 100644 index 2a31caa97b7e..000000000000 --- a/core/src/main/java/jenkins/model/ModelObjectWithPageMenu.java +++ /dev/null @@ -1,44 +0,0 @@ -package jenkins.model; - -import hudson.Functions; -import hudson.model.ModelObject; -import jenkins.model.ModelObjectWithContextMenu.ContextMenu; -import org.kohsuke.stapler.StaplerRequest; -import org.kohsuke.stapler.StaplerResponse; - -/** - * {@link ModelObject} that has a page menu in the breadcrumb bar or menu in its page link - * - *

    - * The page context menu is accessible to the user via the breadcrumb bar or via a link - * to the object's page. The page menu combines the page's contextMenu and childrenContextMenu, - * making it easier for users to navigate to all the ancestor objects this model object owns, - * and its children. - * - * @author Jan Faracik, Lewis Birks - * @see ModelObjectWithContextMenu - * @since TODO - Provide version - */ -public interface ModelObjectWithPageMenu extends ModelObject { - default ContextMenu doPageMenu(StaplerRequest request, StaplerResponse response) throws Exception { - ContextMenu contextMenu = new ContextMenu(); - - if (Functions.isModelWithContextMenu(this)) { - ModelObjectWithContextMenu modelObjectWithContextMenu = (ModelObjectWithContextMenu) this; - contextMenu.items.addAll(modelObjectWithContextMenu.doContextMenu(request, response).items); - } - - if (Functions.isModelWithChildren(this)) { - ModelObjectWithChildren modelObjectWithChildren = (ModelObjectWithChildren) this; - ContextMenu childrenMenu = modelObjectWithChildren.doChildrenContextMenu(request, response); - - if (!contextMenu.items.isEmpty() && !childrenMenu.items.isEmpty()) { - contextMenu.addSeparator(); - } - - contextMenu.items.addAll(childrenMenu.items); - } - - return contextMenu; - } -} diff --git a/core/src/main/resources/lib/layout/breadcrumbBar.jelly b/core/src/main/resources/lib/layout/breadcrumbBar.jelly index 62940e069b91..770e4ee15beb 100644 --- a/core/src/main/resources/lib/layout/breadcrumbBar.jelly +++ b/core/src/main/resources/lib/layout/breadcrumbBar.jelly @@ -43,7 +43,7 @@ THE SOFTWARE.

  • - + @@ -56,7 +56,7 @@ THE SOFTWARE.
  • - +
  • diff --git a/core/src/main/resources/lib/layout/breadcrumbs.js b/core/src/main/resources/lib/layout/breadcrumbs.js index 1ba31de0eb2c..8bf27c24a462 100644 --- a/core/src/main/resources/lib/layout/breadcrumbs.js +++ b/core/src/main/resources/lib/layout/breadcrumbs.js @@ -111,8 +111,12 @@ var breadcrumbs = (function() { * * @param {HTMLElement} e * anchor tag + * @param {String} contextMenuUrl + * The URL that renders JSON for context menu. Optional. */ - function invokeContextMenu(e) { + function invokeContextMenu(e, contextMenuUrl) { + contextMenuUrl = contextMenuUrl || "contextMenu"; + function showMenu(items) { menu.hide(); var pos = [e, "tl", "bl"]; @@ -132,8 +136,11 @@ var breadcrumbs = (function() { showMenu(e.items()); } else { + console.log("Calling") + console.log(combinePath(e.getAttribute("href"), contextMenuUrl)) + // fetch menu on demand - xhr = new Ajax.Request(combinePath(e.getAttribute("href"), "pageMenu"), { + xhr = new Ajax.Request(combinePath(e.getAttribute("href"), contextMenuUrl), { onComplete:function (x) { var items = x.responseText.evalJSON().items; function fillMenuItem(e) { @@ -180,7 +187,7 @@ var breadcrumbs = (function() { Behaviour.specify("#breadcrumbs LI.children", 'breadcrumbs', 0, function (a) { a.observe("click", function() { - invokeContextMenu(this); + invokeContextMenu(this, "childrenContextMenu"); }) }); From ea6fc46b6b96546d0414c257ed8bd6a9559144a8 Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Sun, 13 Feb 2022 20:15:16 +0000 Subject: [PATCH 28/37] Remove IE compat --- .../main/webapp/scripts/hudson-behavior.js | 46 ------------------- 1 file changed, 46 deletions(-) diff --git a/war/src/main/webapp/scripts/hudson-behavior.js b/war/src/main/webapp/scripts/hudson-behavior.js index ca50e18de7f2..e0898a12d011 100644 --- a/war/src/main/webapp/scripts/hudson-behavior.js +++ b/war/src/main/webapp/scripts/hudson-behavior.js @@ -1467,52 +1467,6 @@ function rowvgStartEachRow(recursive,f) { layoutUpdateCallback.add(adjustSticker); }); - Behaviour.specify("#top-sticker", "-top-sticker", ++p, function(sticker) {// legacy - this[".top-sticker"](sticker); - }); - - /** - * @param {HTMLElement} sticker - */ - Behaviour.specify(".top-sticker", "-top-sticker-2", ++p, function(sticker) { - // If the browser is Internet Explorer, use a fallback for stickying the breadcrumb bar - var userAgent = window.navigator.userAgent; - var isIE = /MSIE|Trident/.test(userAgent); - - if (isIE) { - var DOM = YAHOO.util.Dom; - - var shadow = document.createElement("div"); - sticker.parentNode.insertBefore(shadow, sticker); - - var edge = document.createElement("div"); - edge.className = "top-sticker-edge"; - sticker.insertBefore(edge, sticker.firstElementChild); - - var initialBreadcrumbPosition = DOM.getRegion(shadow); - - function adjustSticker() { - shadow.style.height = sticker.offsetHeight + "px"; - - var viewport = DOM.getClientRegion(); - var pos = DOM.getRegion(shadow); - - sticker.style.position = "fixed"; - if (pos.top <= initialBreadcrumbPosition.top) { - sticker.style.top = Math.max(0, pos.top - viewport.top) + "px" - } - sticker.style.left = Math.max(0, pos.left - viewport.left) + "px" - } - - // react to layout change - Element.observe(window, "scroll", adjustSticker); - Element.observe(window, "resize", adjustSticker); - // initial positioning - Element.observe(window, "load", adjustSticker); - adjustSticker(); - } - }); - /** * Function that provides compatibility to the checkboxes without title on an f:entry * From f9aa5ba6211a7f01efa27e9e7dd4315a64d44457 Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Sun, 13 Feb 2022 20:20:35 +0000 Subject: [PATCH 29/37] Remove log --- core/src/main/resources/lib/layout/breadcrumbs.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/core/src/main/resources/lib/layout/breadcrumbs.js b/core/src/main/resources/lib/layout/breadcrumbs.js index 8bf27c24a462..c30107a7a7b3 100644 --- a/core/src/main/resources/lib/layout/breadcrumbs.js +++ b/core/src/main/resources/lib/layout/breadcrumbs.js @@ -135,10 +135,6 @@ var breadcrumbs = (function() { if (e.items) {// use what's already loaded showMenu(e.items()); } else { - - console.log("Calling") - console.log(combinePath(e.getAttribute("href"), contextMenuUrl)) - // fetch menu on demand xhr = new Ajax.Request(combinePath(e.getAttribute("href"), contextMenuUrl), { onComplete:function (x) { From f0726b984ab1f9b1d989c117dd613e25a19cf4a8 Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Sun, 13 Feb 2022 20:28:59 +0000 Subject: [PATCH 30/37] Update core/src/main/java/jenkins/model/ModelObjectWithContextMenu.java Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com> --- .../src/main/java/jenkins/model/ModelObjectWithContextMenu.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/jenkins/model/ModelObjectWithContextMenu.java b/core/src/main/java/jenkins/model/ModelObjectWithContextMenu.java index 06595ab31e5b..7d1f983bd002 100644 --- a/core/src/main/java/jenkins/model/ModelObjectWithContextMenu.java +++ b/core/src/main/java/jenkins/model/ModelObjectWithContextMenu.java @@ -315,7 +315,7 @@ class MenuItem { /** * The type of menu item - * @since TODO - Provide version + * @since TODO */ @Exported @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD", justification = "read by Stapler") From c49c9e8f77b19b3619cd2fa2563dc61cc14af5f1 Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Mon, 28 Feb 2022 20:43:56 +0000 Subject: [PATCH 31/37] Update so chevrons appear for touch screen users, increase background contrast --- war/src/main/less/modules/breadcrumbs.less | 51 ++++++++++++++++------ 1 file changed, 38 insertions(+), 13 deletions(-) diff --git a/war/src/main/less/modules/breadcrumbs.less b/war/src/main/less/modules/breadcrumbs.less index 4695de508a4c..865958d2cedd 100644 --- a/war/src/main/less/modules/breadcrumbs.less +++ b/war/src/main/less/modules/breadcrumbs.less @@ -223,16 +223,35 @@ // For links with badges next to them, eg build monitor page, we need to shrink the margins of // the badge so that it doesn't cause a table column resize, yet doesn't change in appearance + @media (hover: hover) { + & + a.model-link { + transform: translateX(10px); + margin-right: calc((14px + 1ch) * -1) !important; + } + } + } + + @media (hover: none) { & + a.model-link { transform: translateX(10px); margin-right: calc((14px + 1ch) * -1) !important; } + + .jenkins-menu-dropdown-chevron { + margin-left: 1ch; + + &::after { + opacity: 0.5; + } + } } } -.inside { - &:hover { - margin-right: calc((14px + 1ch) * -1) !important; +@media (hover: hover) { + .inside { + &:hover { + margin-right: calc((14px + 1ch) * -1) !important; + } } } @@ -262,19 +281,23 @@ background: var(--text-color); } - .jenkins-menu-dropdown-chevron { - position: absolute; - top: 1px; - right: 0; - margin-left: 0 !important; + @media (hover: hover) { + .jenkins-menu-dropdown-chevron { + position: absolute; + top: 1px; + right: 0; + margin-left: 0 !important; + } } &:hover { z-index: 10; - &::before, - &::after { - right: calc((2ch + 14px) * -1); + @media (hover: hover) { + &::before, + &::after { + right: calc((2ch + 14px) * -1); + } } &::before { @@ -282,11 +305,13 @@ } &::after { - opacity: 0.05; + opacity: 0.15; } .jenkins-menu-dropdown-chevron { - right: calc((1ch + 14px) * -1); + @media (hover: hover) { + right: calc((1ch + 14px) * -1); + } &::after { opacity: 0.5; From 35c2fc558141774fb7dce4d3abfd0b0933798876 Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Mon, 28 Feb 2022 23:41:59 +0000 Subject: [PATCH 32/37] Increase hitbox --- war/src/main/less/modules/breadcrumbs.less | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/war/src/main/less/modules/breadcrumbs.less b/war/src/main/less/modules/breadcrumbs.less index 865958d2cedd..611bf77751ae 100644 --- a/war/src/main/less/modules/breadcrumbs.less +++ b/war/src/main/less/modules/breadcrumbs.less @@ -177,9 +177,9 @@ position: absolute; top: -7px; bottom: -7px; - right: -10px; - width: 24px; - background: transparent; + right: -20px; + width: 20px; + pointer-events: all; } &::after { From 806563dd97533f594049cb6cfc3b691798d45469 Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Wed, 2 Mar 2022 14:06:43 +0000 Subject: [PATCH 33/37] Update node status to align to the right --- .../main/resources/lib/hudson/executors.jelly | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/core/src/main/resources/lib/hudson/executors.jelly b/core/src/main/resources/lib/hudson/executors.jelly index 1b3ced43d993..fa8b46fa2b48 100644 --- a/core/src/main/resources/lib/hudson/executors.jelly +++ b/core/src/main/resources/lib/hudson/executors.jelly @@ -35,21 +35,22 @@ THE SOFTWARE. ${title} - - - - - ( ${%offline}) - - - (${%launching}) - - - (${%offline}) - - - - (${%suspended}) + + + + + ( ${%offline}) + + + (${%launching}) + + + (${%offline}) + + + + (${%suspended}) + From 14273f38451e550f1c73b1191e723e59d52945b9 Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Mon, 14 Mar 2022 18:51:49 +0000 Subject: [PATCH 34/37] Remove HREF from breadcrumb --- .../src/main/resources/lib/form/breadcrumb-config-outline.jelly | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/resources/lib/form/breadcrumb-config-outline.jelly b/core/src/main/resources/lib/form/breadcrumb-config-outline.jelly index 28d3048f6175..e22a5861fdc9 100644 --- a/core/src/main/resources/lib/form/breadcrumb-config-outline.jelly +++ b/core/src/main/resources/lib/form/breadcrumb-config-outline.jelly @@ -32,5 +32,5 @@ THE SOFTWARE. - + From d735301c3f5f46fdfae1f4d796a19747cc348432 Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Mon, 14 Mar 2022 19:05:51 +0000 Subject: [PATCH 35/37] Fix scroll spy header --- war/src/main/js/util/page.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/war/src/main/js/util/page.js b/war/src/main/js/util/page.js index 55dfc190dce5..629064a0f50b 100644 --- a/war/src/main/js/util/page.js +++ b/war/src/main/js/util/page.js @@ -41,7 +41,7 @@ function onWinScroll(callback) { } function pageHeaderHeight() { - return elementHeight('#page-header'); + return elementHeight('#page-header') + breadcrumbBarHeight(); } function breadcrumbBarHeight() { From 9de15cf10b5bf188b43c22502027186031c11eac Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Tue, 15 Mar 2022 00:08:32 +0000 Subject: [PATCH 36/37] Fix dropdown in console/started by --- .../hudson/model/Cause/UpstreamCause/description.properties | 4 ++-- .../model/Cause/UpstreamCause/description_bg.properties | 6 +++--- .../model/Cause/UpstreamCause/description_cs.properties | 4 ++-- .../model/Cause/UpstreamCause/description_da.properties | 4 ++-- .../model/Cause/UpstreamCause/description_de.properties | 4 ++-- .../model/Cause/UpstreamCause/description_es.properties | 4 ++-- .../model/Cause/UpstreamCause/description_fi.properties | 4 ++-- .../model/Cause/UpstreamCause/description_fr.properties | 4 ++-- .../model/Cause/UpstreamCause/description_it.properties | 6 +++--- .../model/Cause/UpstreamCause/description_ja.properties | 4 ++-- .../model/Cause/UpstreamCause/description_lv.properties | 4 ++-- .../model/Cause/UpstreamCause/description_nl.properties | 4 ++-- .../model/Cause/UpstreamCause/description_pl.properties | 4 ++-- .../model/Cause/UpstreamCause/description_pt_BR.properties | 4 ++-- .../model/Cause/UpstreamCause/description_ru.properties | 4 ++-- .../model/Cause/UpstreamCause/description_sk.properties | 4 ++-- .../model/Cause/UpstreamCause/description_sr.properties | 4 ++-- .../model/Cause/UpstreamCause/description_sv_SE.properties | 4 ++-- .../model/Cause/UpstreamCause/description_uk.properties | 4 ++-- .../model/Cause/UpstreamCause/description_zh_TW.properties | 4 ++-- war/src/main/less/modules/breadcrumbs.less | 2 +- 21 files changed, 43 insertions(+), 43 deletions(-) diff --git a/core/src/main/resources/hudson/model/Cause/UpstreamCause/description.properties b/core/src/main/resources/hudson/model/Cause/UpstreamCause/description.properties index 6465016a40c6..1deb78946fef 100644 --- a/core/src/main/resources/hudson/model/Cause/UpstreamCause/description.properties +++ b/core/src/main/resources/hudson/model/Cause/UpstreamCause/description.properties @@ -20,6 +20,6 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -started_by_project=Started by upstream project {0} build number {1} -started_by_project_with_deleted_build=Started by upstream project {0} build number {1} +started_by_project=Started by upstream project {0} build number {1} +started_by_project_with_deleted_build=Started by upstream project {0} build number {1} caused_by=originally caused by: diff --git a/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_bg.properties b/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_bg.properties index e628fd6eede0..fb6513a12ab9 100644 --- a/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_bg.properties +++ b/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_bg.properties @@ -22,10 +22,10 @@ started_by_project_with_deleted_build=\ \u0421\u0442\u0430\u0440\u0442\u0438\u0440\u0430\u043d\u043e \u0437\u0430\u0440\u0430\u0434\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043e\u0442 \u043a\u043e\u0439\u0442\u043e \u0442\u043e\u0437\u0438 \u0437\u0430\u0432\u0438\u0441\u0438:\ - {0}, \u0438\u0437\u0433\u0440\u0430\u0436\u0434\u0430\u043d\u0435 \u2116\u200a{1} + {0}, \u0438\u0437\u0433\u0440\u0430\u0436\u0434\u0430\u043d\u0435 \u2116\u200a{1} caused_by=\ \u043f\u044a\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u043d\u043e \u0441\u0442\u0430\u0440\u0442\u0438\u0440\u0430\u043d\u043e \u043f\u043e\u0440\u0430\u0434\u0438: started_by_project=\ \u0421\u0442\u0430\u0440\u0442\u0438\u0440\u0430\u043d\u043e \u0437\u0430\u0440\u0430\u0434\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043e\u0442 \u043a\u043e\u0439\u0442\u043e \u0442\u043e\u0437\u0438 \u0437\u0430\u0432\u0438\u0441\u0438:\ - {0}, \u0438\u0437\u0433\u0440\u0430\u0436\u0434\u0430\u043d\u0435\ - \u2116\u200a{1} + {0}, \u0438\u0437\u0433\u0440\u0430\u0436\u0434\u0430\u043d\u0435\ + \u2116\u200a{1} diff --git a/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_cs.properties b/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_cs.properties index 6dadacc8d5b3..a774d761620e 100644 --- a/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_cs.properties +++ b/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_cs.properties @@ -1,4 +1,4 @@ # This file is under the MIT License by authors -started_by_project=Spu\u0161t\u011Bno nad\u0159azen\u00FDm projektem {0} build \u010D\u00EDslo {1} -started_by_project_with_deleted_build=Spu\u0161t\u011Bno nad\u0159azen\u00FDm projektem {0} build \u010D\u00EDslo {1} +started_by_project=Spu\u0161t\u011Bno nad\u0159azen\u00FDm projektem {0} build \u010D\u00EDslo {1} +started_by_project_with_deleted_build=Spu\u0161t\u011Bno nad\u0159azen\u00FDm projektem {0} build \u010D\u00EDslo {1} diff --git a/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_da.properties b/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_da.properties index d5d6abbe7ecf..c6817615ff64 100644 --- a/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_da.properties +++ b/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_da.properties @@ -20,5 +20,5 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -started_by_project=Startet af upstream projekt {0} byg nummer {1} -started_by_project_with_deleted_build=Startet af upstream projekt {0} byg nummer {1} +started_by_project=Startet af upstream projekt {0} byg nummer {1} +started_by_project_with_deleted_build=Startet af upstream projekt {0} byg nummer {1} diff --git a/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_de.properties b/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_de.properties index e06ec4c0fa9a..1e8fe895152a 100644 --- a/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_de.properties +++ b/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_de.properties @@ -21,6 +21,6 @@ # THE SOFTWARE. caused_by=urspr\u00FCnglich ausgel\u00F6st durch: -started_by_project=Gestartet durch vorgelagertes Projekt {0}, Build {1} -started_by_project_with_deleted_build=Gestartet durch vorgelagertes Projekt {0}, Build {1} +started_by_project=Gestartet durch vorgelagertes Projekt {0}, Build {1} +started_by_project_with_deleted_build=Gestartet durch vorgelagertes Projekt {0}, Build {1} diff --git a/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_es.properties b/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_es.properties index 7dd9d5530e9e..119f06882497 100644 --- a/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_es.properties +++ b/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_es.properties @@ -21,5 +21,5 @@ # THE SOFTWARE. -started_by_project=Lanzado por la ejecuci\u00F3n n\u00FAmero {1} del proyecto padre\: {0} -started_by_project_with_deleted_build=Lanzado por la ejecuci\u00F3n n\u00FAmero {1} del proyecto padre\: {0} +started_by_project=Lanzado por la ejecuci\u00F3n n\u00FAmero {1} del proyecto padre\: {0} +started_by_project_with_deleted_build=Lanzado por la ejecuci\u00F3n n\u00FAmero {1} del proyecto padre\: {0} diff --git a/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_fi.properties b/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_fi.properties index 9cff3e9b6528..8c7a1c1dbc47 100644 --- a/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_fi.properties +++ b/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_fi.properties @@ -20,5 +20,5 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -started_by_project=K\u00E4ynnist\u00E4j\u00E4 yl\u00E4virran projekti {0} k\u00E4\u00E4nn\u00F6snumero {1} -started_by_project_with_deleted_build=K\u00E4ynnist\u00E4j\u00E4 yl\u00E4virran projekti {0} k\u00E4\u00E4nn\u00F6snumero {1} +started_by_project=K\u00E4ynnist\u00E4j\u00E4 yl\u00E4virran projekti {0} k\u00E4\u00E4nn\u00F6snumero {1} +started_by_project_with_deleted_build=K\u00E4ynnist\u00E4j\u00E4 yl\u00E4virran projekti {0} k\u00E4\u00E4nn\u00F6snumero {1} diff --git a/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_fr.properties b/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_fr.properties index 7f46cd410c42..740edeb2da45 100644 --- a/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_fr.properties +++ b/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_fr.properties @@ -21,6 +21,6 @@ # THE SOFTWARE. caused_by=Originellement lanc\u00E9 par: -started_by_project=Lanc\u00E9 par le projet amont {0} avec le num\u00E9ro de construction {1} -started_by_project_with_deleted_build=Lanc\u00E9 par le projet amont {0} avec le num\u00E9ro de construction {1} +started_by_project=Lanc\u00E9 par le projet amont {0} avec le num\u00E9ro de construction {1} +started_by_project_with_deleted_build=Lanc\u00E9 par le projet amont {0} avec le num\u00E9ro de construction {1} diff --git a/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_it.properties b/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_it.properties index da8d3d0d795b..b34f9c8b3a39 100644 --- a/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_it.properties +++ b/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_it.properties @@ -22,8 +22,8 @@ # THE SOFTWARE. caused_by=originariamente scatenata da: -started_by_project=Avviata dal progetto upstream {0}, compilazione numero {0}, compilazione numero {1} started_by_project_with_deleted_build=Avviata dal progetto upstream {0}, compilazione numero {1} + class="model-link model-link--float" href="{3}/{2}">{0}, compilazione numero {1} diff --git a/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_ja.properties b/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_ja.properties index 897136e18892..31abd832036b 100644 --- a/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_ja.properties +++ b/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_ja.properties @@ -20,6 +20,6 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -started_by_project=\u4e0a\u6d41\u30d7\u30ed\u30b8\u30a7\u30af\u30c8{0}\u306e#{1}\u304c\u5b9f\u884c -started_by_project_with_deleted_build=\u4e0a\u6d41\u30d7\u30ed\u30b8\u30a7\u30af\u30c8{0}\u306e#{1}\u304c\u5b9f\u884c +started_by_project=\u4e0a\u6d41\u30d7\u30ed\u30b8\u30a7\u30af\u30c8{0}\u306e#{1}\u304c\u5b9f\u884c +started_by_project_with_deleted_build=\u4e0a\u6d41\u30d7\u30ed\u30b8\u30a7\u30af\u30c8{0}\u306e#{1}\u304c\u5b9f\u884c caused_by=\u5143\u306e\u539f\u56e0: diff --git a/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_lv.properties b/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_lv.properties index d6eb00c13ed0..0cc40b263090 100644 --- a/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_lv.properties +++ b/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_lv.properties @@ -1,5 +1,5 @@ # This file is under the MIT License by authors caused_by=s\u0101kotn\u0113ji izrais\u012Bjis: -started_by_project=S\u0101kts no aug\u0161upstraumes projekta {0} b\u016Bv\u0113juma {1} -started_by_project_with_deleted_build=S\u0101kts no aug\u0161upstraumes projekta {0} b\u016Bv\u0113juma {1} +started_by_project=S\u0101kts no aug\u0161upstraumes projekta {0} b\u016Bv\u0113juma {1} +started_by_project_with_deleted_build=S\u0101kts no aug\u0161upstraumes projekta {0} b\u016Bv\u0113juma {1} diff --git a/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_nl.properties b/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_nl.properties index 8fffede35055..77a8f2b8784f 100644 --- a/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_nl.properties +++ b/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_nl.properties @@ -1,5 +1,5 @@ # This file is under the MIT License by authors caused_by=oorspronkelijk veroorzaakt door: -started_by_project=Gestart door stroomopwaarts project {0}, bouwpoging {1} -started_by_project_with_deleted_build=Gestart door stroomopwaarts project {0}, bouwpoging {1} +started_by_project=Gestart door stroomopwaarts project {0}, bouwpoging {1} +started_by_project_with_deleted_build=Gestart door stroomopwaarts project {0}, bouwpoging {1} diff --git a/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_pl.properties b/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_pl.properties index ca975f6e8e65..7d6fa87a6d70 100644 --- a/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_pl.properties +++ b/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_pl.properties @@ -20,6 +20,6 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -started_by_project=Wystartowany przez projekt nadrz\u0119dny {0} o numerze {1} -started_by_project_with_deleted_build=Wystartowany przez projekt nadrz\u0119dny {0} o numerze {1} +started_by_project=Wystartowany przez projekt nadrz\u0119dny {0} o numerze {1} +started_by_project_with_deleted_build=Wystartowany przez projekt nadrz\u0119dny {0} o numerze {1} caused_by=Pierwotnie spowodowany przez: diff --git a/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_pt_BR.properties b/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_pt_BR.properties index bcd1781af945..02fb9c7e324f 100644 --- a/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_pt_BR.properties +++ b/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_pt_BR.properties @@ -22,5 +22,5 @@ # Started by upstream project {0} build number {1} caused_by=Criado por originalidade de: -started_by_project=Iniciado pelo build {1} do projeto {0} -started_by_project_with_deleted_build=Iniciado pelo build {1} do projeto {0} +started_by_project=Iniciado pelo build {1} do projeto {0} +started_by_project_with_deleted_build=Iniciado pelo build {1} do projeto {0} diff --git a/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_ru.properties b/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_ru.properties index d3ebf3a40bb1..4447b383be74 100644 --- a/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_ru.properties +++ b/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_ru.properties @@ -1,5 +1,5 @@ # This file is under the MIT License by authors caused_by=\u043F\u0435\u0440\u0432\u043E\u043D\u0430\u0447\u0430\u043B\u044C\u043D\u043E \u0437\u0430\u043F\u0443\u0449\u0435\u043D\u0430: -started_by_project=\u0412\u044B\u0437\u0432\u0430\u043D \u0432\u043E\u0441\u0445\u043E\u0434\u044F\u0449\u0438\u043C \u043F\u0440\u043E\u0435\u043A\u0442\u043E\u043C {0}, \u0441\u0431\u043E\u0440\u043A\u0430 \u043D\u043E\u043C\u0435\u0440 {1} -started_by_project_with_deleted_build=\u0412\u044B\u0437\u0432\u0430\u043D \u0432\u043E\u0441\u0445\u043E\u0434\u044F\u0449\u0438\u043C \u043F\u0440\u043E\u0435\u043A\u0442\u043E\u043C {0}, \u0441\u0431\u043E\u0440\u043A\u0430 \u043D\u043E\u043C\u0435\u0440 {1} +started_by_project=\u0412\u044B\u0437\u0432\u0430\u043D \u0432\u043E\u0441\u0445\u043E\u0434\u044F\u0449\u0438\u043C \u043F\u0440\u043E\u0435\u043A\u0442\u043E\u043C {0}, \u0441\u0431\u043E\u0440\u043A\u0430 \u043D\u043E\u043C\u0435\u0440 {1} +started_by_project_with_deleted_build=\u0412\u044B\u0437\u0432\u0430\u043D \u0432\u043E\u0441\u0445\u043E\u0434\u044F\u0449\u0438\u043C \u043F\u0440\u043E\u0435\u043A\u0442\u043E\u043C {0}, \u0441\u0431\u043E\u0440\u043A\u0430 \u043D\u043E\u043C\u0435\u0440 {1} diff --git a/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_sk.properties b/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_sk.properties index 2027b4fb2660..6cbaae3dc1a5 100644 --- a/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_sk.properties +++ b/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_sk.properties @@ -1,5 +1,5 @@ # This file is under the MIT License by authors caused_by=p\u00F4vodn\u00E1 pr\u00ED\u010Dina: -started_by_project=Na\u0161tartovan\u00E9 upstream projektom {0} \u010D\u00EDslo zostavenia {1} -started_by_project_with_deleted_build=Na\u0161tartovan\u00E9 upstream projektom {0} \u010D\u00EDslo zostavenia {1} +started_by_project=Na\u0161tartovan\u00E9 upstream projektom {0} \u010D\u00EDslo zostavenia {1} +started_by_project_with_deleted_build=Na\u0161tartovan\u00E9 upstream projektom {0} \u010D\u00EDslo zostavenia {1} diff --git a/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_sr.properties b/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_sr.properties index 327dc4258303..6db47bf0da33 100644 --- a/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_sr.properties +++ b/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_sr.properties @@ -1,5 +1,5 @@ # This file is under the MIT License by authors -started_by_project=\u0417\u0430\u043F\u043E\u0447\u0435\u0442\u043E \u043E\u0434 \u0441\u0442\u0440\u0430\u043D\u0435 \u043F\u0440\u043E\u0458\u0435\u043A\u0442\u0430 {0} \u0431\u0440\u043E\u0458 \u0438\u0437\u0433\u0440\u0430\u0434\u045A\u0435 {1} -started_by_project_with_deleted_build=\u0417\u0430\u043F\u043E\u0447\u0435\u0442\u043E \u043E\u0434 \u0441\u0442\u0440\u0430\u043D\u0435 \u043F\u0440\u043E\u0458\u0435\u043A\u0442\u0430 {0} \u0431\u0440\u043E\u0458 \u0438\u0437\u0433\u0440\u0430\u0434\u045A\u0435 {1} +started_by_project=\u0417\u0430\u043F\u043E\u0447\u0435\u0442\u043E \u043E\u0434 \u0441\u0442\u0440\u0430\u043D\u0435 \u043F\u0440\u043E\u0458\u0435\u043A\u0442\u0430 {0} \u0431\u0440\u043E\u0458 \u0438\u0437\u0433\u0440\u0430\u0434\u045A\u0435 {1} +started_by_project_with_deleted_build=\u0417\u0430\u043F\u043E\u0447\u0435\u0442\u043E \u043E\u0434 \u0441\u0442\u0440\u0430\u043D\u0435 \u043F\u0440\u043E\u0458\u0435\u043A\u0442\u0430 {0} \u0431\u0440\u043E\u0458 \u0438\u0437\u0433\u0440\u0430\u0434\u045A\u0435 {1} caused_by=\u043F\u0440\u0432\u043E\u0431\u0438\u0442\u043D\u043E \u043F\u043E\u043A\u0440\u0435\u043D\u0443\u0442 \u0437\u0431\u043E\u0433: diff --git a/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_sv_SE.properties b/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_sv_SE.properties index 19a14d946d67..69cb7058fa97 100644 --- a/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_sv_SE.properties +++ b/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_sv_SE.properties @@ -1,5 +1,5 @@ # This file is under the MIT License by authors caused_by=ursprungligen p\u00E5 grund av: -started_by_project=Startad av projekt uppstr\u00F6ms {0} byggnummer {1} -started_by_project_with_deleted_build=Startad av projekt uppstr\u00F6ms {0} byggnummer {1} +started_by_project=Startad av projekt uppstr\u00F6ms {0} byggnummer {1} +started_by_project_with_deleted_build=Startad av projekt uppstr\u00F6ms {0} byggnummer {1} diff --git a/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_uk.properties b/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_uk.properties index a137decaa7b6..4c0f2cbed9ed 100644 --- a/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_uk.properties +++ b/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_uk.properties @@ -20,5 +20,5 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -started_by_project=\u0417\u0430\u043F\u0443\u0449\u0435\u043D\u043E \u043A\u0435\u0440\u0456\u0432\u043D\u0438\u043C \u043F\u0440\u043E\u0435\u043A\u0442\u043E\u043C {0}, \u043F\u043E\u0431\u0443\u0434\u043E\u0432\u0430 \u043D\u043E\u043C\u0435\u0440 {1} -started_by_project_with_deleted_build=\u0417\u0430\u043F\u0443\u0449\u0435\u043D\u043E \u043A\u0435\u0440\u0456\u0432\u043D\u0438\u043C \u043F\u0440\u043E\u0435\u043A\u0442\u043E\u043C {0}, \u043F\u043E\u0431\u0443\u0434\u043E\u0432\u0430 \u043D\u043E\u043C\u0435\u0440 {1} +started_by_project=\u0417\u0430\u043F\u0443\u0449\u0435\u043D\u043E \u043A\u0435\u0440\u0456\u0432\u043D\u0438\u043C \u043F\u0440\u043E\u0435\u043A\u0442\u043E\u043C {0}, \u043F\u043E\u0431\u0443\u0434\u043E\u0432\u0430 \u043D\u043E\u043C\u0435\u0440 {1} +started_by_project_with_deleted_build=\u0417\u0430\u043F\u0443\u0449\u0435\u043D\u043E \u043A\u0435\u0440\u0456\u0432\u043D\u0438\u043C \u043F\u0440\u043E\u0435\u043A\u0442\u043E\u043C {0}, \u043F\u043E\u0431\u0443\u0434\u043E\u0432\u0430 \u043D\u043E\u043C\u0435\u0440 {1} diff --git a/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_zh_TW.properties b/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_zh_TW.properties index c9e7e445a39a..2ed479cac029 100644 --- a/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_zh_TW.properties +++ b/core/src/main/resources/hudson/model/Cause/UpstreamCause/description_zh_TW.properties @@ -20,6 +20,6 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -started_by_project=\u7531\u4e0a\u6e38\u5c08\u6848 {0} \u7684\u7b2c {1} \u6b21\u5efa\u7f6e\u6240\u89f8\u767c -started_by_project_with_deleted_build=\u7531\u4e0a\u6e38\u5c08\u6848 {0} \u7684\u7b2c {1} \u6b21\u5efa\u7f6e\u6240\u89f8\u767c +started_by_project=\u7531\u4e0a\u6e38\u5c08\u6848 {0} \u7684\u7b2c {1} \u6b21\u5efa\u7f6e\u6240\u89f8\u767c +started_by_project_with_deleted_build=\u7531\u4e0a\u6e38\u5c08\u6848 {0} \u7684\u7b2c {1} \u6b21\u5efa\u7f6e\u6240\u89f8\u767c caused_by=\u8d77\u56e0: diff --git a/war/src/main/less/modules/breadcrumbs.less b/war/src/main/less/modules/breadcrumbs.less index 611bf77751ae..5a4fded18fdb 100644 --- a/war/src/main/less/modules/breadcrumbs.less +++ b/war/src/main/less/modules/breadcrumbs.less @@ -224,7 +224,7 @@ // For links with badges next to them, eg build monitor page, we need to shrink the margins of // the badge so that it doesn't cause a table column resize, yet doesn't change in appearance @media (hover: hover) { - & + a.model-link { + & + a.model-link:not(.model-link--float) { transform: translateX(10px); margin-right: calc((14px + 1ch) * -1) !important; } From 16c05857ff7f3d96ef7f776604e23afce9b8c5a0 Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Tue, 15 Mar 2022 11:00:41 +0000 Subject: [PATCH 37/37] Fix build icon not being clickable --- .../main/resources/hudson/widgets/HistoryWidget/entry.jelly | 4 ++-- war/src/main/less/modules/side-panel-widgets.less | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/main/resources/hudson/widgets/HistoryWidget/entry.jelly b/core/src/main/resources/hudson/widgets/HistoryWidget/entry.jelly index b690e2084ccc..5ed47248ad6d 100644 --- a/core/src/main/resources/hudson/widgets/HistoryWidget/entry.jelly +++ b/core/src/main/resources/hudson/widgets/HistoryWidget/entry.jelly @@ -40,14 +40,14 @@ THE SOFTWARE.
    - ${build.displayName} + ${build.displayName}
    ${%Took} ${build.durationString} - + ${h.getUserTimeZonePostfix()} diff --git a/war/src/main/less/modules/side-panel-widgets.less b/war/src/main/less/modules/side-panel-widgets.less index 4dbff43c616d..091b23e9664a 100644 --- a/war/src/main/less/modules/side-panel-widgets.less +++ b/war/src/main/less/modules/side-panel-widgets.less @@ -148,6 +148,7 @@ .build-row-cell .pane.build-name .build-icon { position: absolute; + z-index: 1; } .build-row-cell .build-stop {