Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow linking to pre-filtered plugin manager pages, link from labels/… #4591

Merged
merged 8 commits into from
Apr 19, 2020
18 changes: 16 additions & 2 deletions core/src/main/resources/hudson/PluginManager/_table.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,28 @@ time {
margin-top: 0.25em;
}

.plugin-manager__category-label {
.plugin-manager__category-label:link,
.plugin-manager__category-label:visited {
display: inline-block;
border: 1px solid #ccc;
background-color: #eee;
background-color: #fbfbfb;
color: #333;
border-radius: 4px;
font-size: 0.75rem;
font-weight: 500;
padding: 0 0.5rem;
margin: 0 0.25rem 0.25rem 0;
text-decoration: none;
text-align: center;
white-space: nowrap;
vertical-align: baseline;
transition: all 0.15s ease-in-out;
}
.plugin-manager__category-label:hover,
.plugin-manager__category-label:focus,
.plugin-manager__category-label:active {
background-color: #f2f2f2;
border-color: #333;
}

.plugin-manager__search-input {
Expand Down
9 changes: 8 additions & 1 deletion core/src/main/resources/hudson/PluginManager/_table.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,15 @@ Behaviour.specify("#filter-box", '_table', 0, function(e) {

layoutUpdateCallback.call();
}

e.onkeyup = applyFilter;

(function() {
var instructionsTd = document.getElementById("hidden-by-default-instructions-td");
if (instructionsTd) { // only on Available tab
instructionsTd.innerText = instructionsTd.getAttribute("data-loaded-text");
}
applyFilter();
}());
});

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ THE SOFTWARE.
class="plugin-manager__search-input"
type="text"
id="filter-box"
value="${request.getParameter('filter')}"
placeholder="${filtered == 'true' ? '%search' : '%filter'}" />
<span class="plugin-manager__icon-leading">
<l:svgIcon href="${resURL}/images/material-icons/svg-sprite-action-symbol.svg#ic_search_24px" />
Expand Down
10 changes: 6 additions & 4 deletions core/src/main/resources/hudson/PluginManager/table.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ THE SOFTWARE.
class="plugin-manager__search-input"
type="text"
id="filter-box"
value="${request.getParameter('filter')}"
placeholder="${filtered == 'true' ? '%search' : '%filter'}" />
<span class="plugin-manager__icon-leading">
<l:svgIcon href="${resURL}/images/material-icons/svg-sprite-action-symbol.svg#ic_search_24px" />
Expand Down Expand Up @@ -76,8 +77,8 @@ THE SOFTWARE.
<j:set var="cache" value="${it.createCache()}"/>
<j:if test="${filtered == 'true'}">
<tr id="hidden-by-default-instructions">
<td class="pane" colspan="5" align="center">
${%Use the search field above to search for available plugins.}
<td class="pane" colspan="5" align="center" id="hidden-by-default-instructions-td" data-loaded-text="${%instructions}">
${%loading}
</td>
</tr>
</j:if>
Expand All @@ -103,9 +104,10 @@ THE SOFTWARE.
<div class="plugin-manager__categories">
<j:forEach var="label" items="${p.categories}">
<j:if test="${!it.isMetaLabel(label)}">
<span class="plugin-manager__category-label">
<a href="?filter=${app.updateCenter.getCategoryDisplayName(label)}"
class="plugin-manager__category-label">
${app.updateCenter.getCategoryDisplayName(label)}
</span>
</a>
</j:if>
</j:forEach>
</div>
Expand Down
3 changes: 3 additions & 0 deletions core/src/main/resources/hudson/PluginManager/table.properties
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,6 @@ ago={0} ago
adoptThisPlugin=\
<strong>This plugin is up for adoption!</strong> We are looking for new maintainers. \
Visit our <a href="https://jenkins.io/doc/developer/plugin-governance/adopt-a-plugin/" target="_blank">Adopt a Plugin</a> initiative for more information.

loading=Plugin list is loading...
instructions=Use the search field above to search for available plugins.