Skip to content

Commit b0e298b

Browse files
committed
Merge branch 'master' into new-reorderable-list-component
2 parents b53a3d6 + 8eeb6ef commit b0e298b

23 files changed

Lines changed: 391 additions & 286 deletions

File tree

.mvn/extensions.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
<extension>
33
<groupId>io.jenkins.tools.incrementals</groupId>
44
<artifactId>git-changelist-maven-extension</artifactId>
5-
<version>1.8</version>
5+
<version>1.10</version>
66
</extension>
77
</extensions>

cli/pom.xml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,6 @@
4343
<artifactId>commons-lang</artifactId>
4444
<optional>true</optional>
4545
</dependency>
46-
<dependency>
47-
<!-- ed25519 algorithm, see JENKINS-45318 -->
48-
<groupId>net.i2p.crypto</groupId>
49-
<artifactId>eddsa</artifactId>
50-
<version>0.3.0</version>
51-
<optional>true</optional>
52-
</dependency>
5346
<dependency>
5447
<groupId>org.apache.sshd</groupId>
5548
<artifactId>sshd-common</artifactId>
@@ -62,6 +55,12 @@
6255
<version>${mina-sshd.version}</version>
6356
<optional>true</optional>
6457
</dependency>
58+
<dependency>
59+
<groupId>org.bouncycastle</groupId>
60+
<artifactId>bcprov-jdk18on</artifactId>
61+
<version>1.81</version>
62+
<optional>true</optional>
63+
</dependency>
6564
<dependency>
6665
<groupId>org.glassfish.tyrus.bundles</groupId>
6766
<artifactId>tyrus-standalone-client-jdk</artifactId>
@@ -155,6 +154,17 @@
155154
</transformer>
156155
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
157156
</transformers>
157+
<filters>
158+
<filter>
159+
<!-- signature might cause some trouble -->
160+
<artifact>*:*</artifact>
161+
<excludes>
162+
<exclude>META-INF/*.SF</exclude>
163+
<exclude>META-INF/*.DSA</exclude>
164+
<exclude>META-INF/*.RSA</exclude>
165+
</excludes>
166+
</filter>
167+
</filters>
158168
</configuration>
159169
</execution>
160170
</executions>

core/src/main/java/hudson/model/AsyncPeriodicWork.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ protected Level getErrorLoggingLevel() {
278278

279279
/**
280280
* @return true if a new run should be queued if it is already running while called.
281-
* @since TODO
281+
* @since 2.517
282282
*/
283283
protected boolean queueIfAlreadyRunning() {
284284
return false;

core/src/main/java/hudson/model/RootAction.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,11 @@ public interface RootAction extends Action, ExtensionPoint {
5454
/**
5555
* Identifies if the action is a primary action.
5656
* Primary actions may be handled differently in the UI (for example, by always showing on the header rather than in an actions dropdown).
57-
* In almost all cases this should return {@code false} which is the default
58-
* @return {@code true} iff this action should be considered primary.
57+
* In almost all cases this should return {@code false} which is the default.
58+
* Examples of a Primary action would be where actions would be used regularly or they would need to be prominent to convey some status.
59+
* As a concrete example, an action that provides a Help action with a submenu containing various different links, would be a prime candidate for this to return {@code true}.
60+
* If your action has the possibility of a {@link #getBadge() badge} then this is another indicator that the action should return {@code true} (or otherwise restructured).
61+
* @return {@code true} if and only if this action should be considered primary.
5962
* @since 2.516
6063
*/
6164
default boolean isPrimaryAction() {

core/src/main/resources/jenkins/model/Jenkins/_script.jelly

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ THE SOFTWARE.
2727
-->
2828
<?jelly escape-by-default='true'?>
2929
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
30-
<t:scriptConsole>
30+
<t:scriptConsole layout="one-column">
3131
<pre>println(Jenkins.instance.pluginManager.plugins)</pre>
3232
</t:scriptConsole>
3333
</j:jelly>

core/src/main/resources/lib/hudson/scriptConsole.jelly

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,19 @@ THE SOFTWARE.
2727
-->
2828
<?jelly escape-by-default='true'?>
2929
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:f="/lib/form">
30-
<l:layout permission="${app.ADMINISTER}" title="${%scriptConsole}" type="one-column">
30+
<st:documentation>
31+
<st:attribute name="layout" use="optional">
32+
Specify which layout to be use for the page.
33+
See the type in layout for more details.
34+
By default, it is `two-column`.
35+
</st:attribute>
36+
</st:documentation>
37+
38+
<j:set var="layout" value="${attrs.layout != null ? attrs.layout : 'two-column'}" />
39+
<l:layout permission="${app.ADMINISTER}" title="${%scriptConsole}" type="${layout}">
40+
<j:if test="${layout == 'two-column'}">
41+
<st:include page="sidepanel.jelly" />
42+
</j:if>
3143

3244
<l:breadcrumb title="${%scriptConsole}"/>
3345
<l:main-panel>

core/src/main/resources/lib/layout/dropdowns/item.jelly

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,32 @@ THE SOFTWARE.
4040
<st:attribute name="clazz">
4141
Optional class for the menu item
4242
</st:attribute>
43+
<st:attribute name="badge">
44+
Optional jenkins.management.Badge to also show in the item
45+
</st:attribute>
4346
</st:documentation>
4447

4548
<j:set var="icon">
4649
<l:icon src="${attrs.icon}" />
4750
</j:set>
4851

49-
<template data-dropdown-type="ITEM"
50-
data-dropdown-id="${attrs.id}"
51-
data-dropdown-icon="${icon}"
52-
data-dropdown-text="${attrs.text}"
53-
data-dropdown-href="${attrs.href}"
54-
data-dropdown-clazz="${attrs.clazz}"
55-
/>
52+
<j:if test="${action.badge == null}">
53+
<template data-dropdown-type="ITEM"
54+
data-dropdown-id="${attrs.id}"
55+
data-dropdown-icon="${icon}"
56+
data-dropdown-text="${attrs.text}"
57+
data-dropdown-href="${attrs.href}"
58+
data-dropdown-clazz="${attrs.clazz}"/>
59+
</j:if>
60+
<j:if test="${action.badge != null}">
61+
<template data-dropdown-type="ITEM"
62+
data-dropdown-id="${attrs.id}"
63+
data-dropdown-icon="${icon}"
64+
data-dropdown-text="${attrs.text}"
65+
data-dropdown-href="${attrs.href}"
66+
data-dropdown-clazz="${attrs.clazz}"
67+
data-dropdown-badge-text="${attrs.badge.text}"
68+
data-dropdown-badge-tooltip="${attrs.badge.tooltip}"
69+
data-dropdown-badge-severity="${attrs.badge.severity}"/>
70+
</j:if>
5671
</j:jelly>

core/src/main/resources/lib/layout/header/actions.jelly

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,47 @@
2020

2121
<!-- we only want the hamburger menu if there is something to display -->
2222
<!-- render all non primary non current actions -->
23+
<j:set var="hamburgerHasBadgeWithSeverityError" value="false" />
24+
<j:set var="hamburgerHasBadgeWithSeverityWarning" value="false" />
25+
<j:set var="hamburgerHasBadgeWithSeverityInfo" value="false" />
2326
<j:set var="hamburgerEntries">
2427
<j:forEach var="action" items="${allActions}">
2528
<j:set var="isCurrent" value="${h.hyperlinkMatchesCurrentPage(action.urlName)}" />
2629
<j:set var="isPrimary" value="${h.showInPrimaryHeader(action)}"/>
2730
<j:if test="${!isCurrent and !isPrimary}">
2831
<h:secondaryAction action="${action}"/>
32+
<j:set var="currentBadge" value="${action.badge}"/>
33+
<j:if test="${currentBadge != null}">
34+
<j:choose>
35+
<j:when test="${currentBadge.severity == 'danger'}">
36+
<j:set var="hamburgerHasBadgeWithSeverityError" value="true" />
37+
</j:when>
38+
<j:when test="${currentBadge.severity == 'warning'}">
39+
<j:set var="hamburgerHasBadgeWithSeverityWarning" value="true" />
40+
</j:when>
41+
<j:otherwise>
42+
<j:set var="hamburgerHasBadgeWithSeverityInfo" value="true" />
43+
</j:otherwise>
44+
</j:choose>
45+
</j:if>
2946
</j:if>
3047
</j:forEach>
3148
</j:set>
3249
<j:if test="${hamburgerEntries.length() gt 0}">
33-
<l:overflowButton icon="symbol-menu-hamburger" id="header-more-actions">
50+
<j:set var="hamburgerBadge">
51+
<j:choose>
52+
<j:when test="${hamburgerHasBadgeWithSeverityError}">
53+
<span class="jenkins-badge jenkins-!-danger-color" />
54+
</j:when>
55+
<j:when test="${hamburgerHasBadgeWithSeverityWarning}">
56+
<span class="jenkins-badge jenkins-!-warning-color" />
57+
</j:when>
58+
<j:when test="${hamburgerHasBadgeWithSeverityInfo}">
59+
<span class="jenkins-badge jenkins-!-info-color" />
60+
</j:when>
61+
</j:choose>
62+
</j:set>
63+
<l:overflowButton icon="symbol-menu-hamburger" id="header-more-actions" html="${hamburgerBadge}" clazz="jenkins-button--tertiary">
3464
<j:out value="${hamburgerEntries}" />
3565
</l:overflowButton>
3666
</j:if>

core/src/main/resources/lib/layout/header/secondaryAction.jelly

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,11 @@
2222
<j:otherwise>
2323
<j:set var="icon" value="${action.iconClassName != null ? action.iconClassName : action.iconFileName}"/>
2424
<j:if test="${icon != null}">
25-
<j:set var="badge" value="${action.badge}"/>
26-
<j:set var="badgeClazz" value="${badge != null ? 'jenkins-badge jenkins-!-${badge.severity}-color' : ''}"/>
2725

2826
<dd:item icon="${action.iconClassName != null ? action.iconClassName : action.iconFileName}"
2927
text="${action.displayName}"
3028
href="${h.getActionUrl(app.url, action)}"
31-
clazz="${badgeClazz}">
29+
badge="${action.badge}">
3230
</dd:item>
3331
</j:if>
3432
</j:otherwise>

core/src/main/resources/lib/layout/overflowButton.jelly

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ THE SOFTWARE.
3131
<st:attribute name="text">
3232
Optional text to be displayed on the button
3333
</st:attribute>
34+
<st:attribute name="html">
35+
Optional html to be displayed on the button (only used if 'text' is not provided)
36+
</st:attribute>
37+
3438
<st:attribute name="tooltip">
3539
Optional tooltip of the button, defaults to 'More actions'
3640
</st:attribute>
@@ -62,8 +66,14 @@ THE SOFTWARE.
6266
</div>
6367
</j:otherwise>
6468
</j:choose>
65-
66-
${attrs.text}
69+
<j:choose>
70+
<j:when test="${attrs.text != null}">
71+
${attrs.text}
72+
</j:when>
73+
<j:when test="${attrs.html != null}">
74+
<j:out value="${attrs.html}" />
75+
</j:when>
76+
</j:choose>
6777
</button>
6878
<template>
6979
<div class="jenkins-dropdown">

0 commit comments

Comments
 (0)