Skip to content

Commit

Permalink
Display a notice when there are plugins installed or updates available (
Browse files Browse the repository at this point in the history
jenkinsci#8208)

Co-authored-by: Alexander Brandes <brandes.alexander@web.de>
Co-authored-by: Alexander Brandes <mc.cache@web.de>
Co-authored-by: Tim Jacomb <21194782+timja@users.noreply.github.com>
  • Loading branch information
4 people authored and yaroslavafenkin committed Sep 5, 2023
1 parent fb0ad4a commit 934e557
Show file tree
Hide file tree
Showing 7 changed files with 244 additions and 239 deletions.
4 changes: 1 addition & 3 deletions core/src/main/resources/hudson/PluginManager/_installed.js
Expand Up @@ -36,9 +36,7 @@
function updateMsg() {
// has anything changed since its original state?
let e = Array.from(
document
.getElementById("plugins")
.querySelectorAll("input[type='checkbox']"),
document.querySelectorAll("#plugins input[type='checkbox']"),
).find(function (e) {
return String(e.checked) !== e.getAttribute("original");
});
Expand Down
47 changes: 21 additions & 26 deletions core/src/main/resources/hudson/PluginManager/installed.jelly
Expand Up @@ -36,13 +36,17 @@ THE SOFTWARE.
<l:main-panel>
<l:app-bar title="${%Plugins}" />

<j:set var="noPlugins"
value="${empty(app.pluginManager.plugins) and empty(app.pluginManager.failedPlugins)}" />

<div class="jenkins-app-bar jenkins-app-bar--sticky">
<div class="jenkins-app-bar__content">
<l:search-bar clazz="jenkins-search--app-bar"
placeholder="${%Search installed plugins}"
id="filter-box"
autofocus="true"
value="${request.getParameter('filter')}" />
value="${request.getParameter('filter')}"
enabled="${!noPlugins}" />
</div>
</div>

Expand All @@ -67,29 +71,20 @@ THE SOFTWARE.
data-detached-possible-dependents="${%detached-possible-dependents}"
data-uninstall-description="${%uninstall-description}" />

<table id="plugins" class="jenkins-table sortable">
<j:choose>
<j:when test="${empty(app.pluginManager.plugins) and empty(app.pluginManager.failedPlugins)}">
<thead>
<tr>
<th>${%Installed plugins}</th>
</tr>
</thead>
<tbody>
<tr>
<td align="center">${%No plugins installed.}</td>
</tr>
</tbody>
</j:when>
<j:otherwise>
<j:choose>
<j:when test="${noPlugins}">
<l:notice icon="symbol-plugins" text="${%No plugins installed}" />
</j:when>
<j:otherwise>
<table id="plugins" class="jenkins-table sortable">
<thead>
<tr>
<th initialSortDir="down">${%Name}</th>
<th class="jenkins-table__cell--tight">${%Enabled}</th>
<l:isAdmin>
<th data-sort-disable="true"/>
</l:isAdmin>
</tr>
<tr>
<th initialSortDir="down">${%Name}</th>
<th class="jenkins-table__cell--tight">${%Enabled}</th>
<l:isAdmin>
<th data-sort-disable="true"/>
</l:isAdmin>
</tr>
</thead>
<tbody>
<j:forEach var="p" items="${app.pluginManager.plugins}">
Expand Down Expand Up @@ -274,9 +269,9 @@ THE SOFTWARE.
</tr>
</j:forEach>
</tbody>
</j:otherwise>
</j:choose>
</table>
</table>
</j:otherwise>
</j:choose>

<div class="warning" id="needRestart" style="display:none; margin: 1em; height: 1em">
<form method="post" action="${rootURL}/safeRestart">
Expand Down

0 comments on commit 934e557

Please sign in to comment.