Skip to content

Commit

Permalink
Push
Browse files Browse the repository at this point in the history
  • Loading branch information
janfaracik committed Aug 16, 2024
1 parent 002dbcb commit 0b813f5
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 36 deletions.
10 changes: 5 additions & 5 deletions core/src/main/java/hudson/model/ListView.java
Original file line number Diff line number Diff line change
Expand Up @@ -442,14 +442,14 @@ public HttpResponse doRemoveJobFromView(@QueryParameter String name) throws IOEx
protected void submit(StaplerRequest req) throws ServletException, FormException, IOException {
JSONObject json = req.getSubmittedForm();
synchronized (this) {
recurse = json.optBoolean("recurse", true);
// recurse = json.optBoolean("recurse", true);
jobNames.clear();
Iterable<? extends TopLevelItem> items;
if (recurse) {
// if (recurse) {
items = getOwner().getItemGroup().getAllItems(TopLevelItem.class);
} else {
items = getOwner().getItemGroup().getItems();
}
// } else {
// items = getOwner().getItemGroup().getItems();
// }
for (TopLevelItem item : items) {
String relativeNameFrom = item.getRelativeNameFrom(getOwner().getItemGroup());
if (req.getParameter("item_" + relativeNameFrom) != null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Behaviour.specify("#recurse", "ListView", 0, function (e) {
var nestedElements = document.querySelectorAll("SPAN.nested");
e.onclick = function () {
nestedElements.forEach(function (el) {
el.style.display = e.checked ? "" : "none";
});
};
});
// Behaviour.specify("#recurse", "ListView", 0, function (e) {
// var nestedElements = document.querySelectorAll("SPAN.nested");
// e.onclick = function () {
// nestedElements.forEach(function (el) {
// el.style.display = e.checked ? "" : "none";
// });
// };
// });
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,16 @@ THE SOFTWARE.
<?jelly escape-by-default='true'?>
<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" xmlns:i="jelly:fmt">
<st:adjunct includes="hudson.model.ListView.configure-entries-resources" />

<f:section title="${%Job Filters}" description="Funniest version of us">
<f:entry field="recurse">
<f:checkbox title="${%Recurse in subfolders}" id="recurse" />
</f:entry>

<f:section title="${%Jobs}" description="Funniest version of us">
<f:entry title="${%Jobs}">
<div class="listview-jobs">
<j:forEach var="job" items="${h.getAllTopLevelItems(it.ownerItemGroup)}">
<j:set var="spanClass" value=""/>
<j:set var="spanStyle" value=""/>
<j:if test="${job.parent!=it.ownerItemGroup}">
<j:set var="spanClass" value="nested"/>
<j:set var="spanStyle" value="${it.recurse?'':'display:none'}"/>
</j:if>
<span class="${spanClass}" style="${spanStyle}">
<span class="${spanClass}">
<f:checkbox name="item_${job.getRelativeNameFromGroup(it.ownerItemGroup)}" checked="${it.jobNamesContains(job)}" title="${h.getRelativeDisplayNameFrom(job,it.ownerItemGroup)}" tooltip="${job.fullName}" json="true"/>
<br/>
</span>
</j:forEach>
</div>
Expand All @@ -56,11 +48,13 @@ THE SOFTWARE.
<f:textbox name="includeRegex" field="includeRegex" />
</f:entry>
</f:optionalBlock>
</f:section>

<j:if test="${it.hasJobFilterExtensions()}">
<f:repeatableHeteroProperty field="jobFilters" hasHeader="true" addCaption="${%Add Job Filter}" />
<f:section title="${%Filters}" description="Control which jobs show up in the view based on specific conditions">
<f:repeatableHeteroProperty field="jobFilters" hasHeader="true" addCaption="${%Add Job Filter}" />
</f:section>
</j:if>
</f:section>

<f:section title="${%Columns}" description="Customize what columns this view shows">
<f:repeatableHeteroProperty field="columns" hasHeader="true" addCaption="${%Add column}"/>
Expand Down
10 changes: 5 additions & 5 deletions core/src/main/resources/hudson/model/View/configure.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ THE SOFTWARE.
-->
<?jelly escape-by-default='true'?>
<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" xmlns:i="jelly:fmt">
<l:layout title="${%Edit View}" permission="${it.CONFIGURE}">
<l:layout title="${%Edit View}" permission="${it.CONFIGURE}" type="one-column">
<st:include page="sidepanel.jelly" />
<l:breadcrumb title="${title}" />
<l:main-panel>
Expand All @@ -40,21 +40,21 @@ THE SOFTWARE.
<f:form method="post" action="configSubmit" name="viewConfig" class="jenkins-form">
<f:section>
<f:entry title="${%Name}">
<f:textbox name="name" value="${it.viewName}" autocomplete="on"/>
<f:textbox name="name" value="${it.viewName}" autocomplete="on" />
</f:entry>
<f:entry field="description" title="${%Description}" description="TODO!">
<f:entry field="description" title="${%Description}" description="Describe the purpose of this view">
<f:textarea codemirror-mode="${app.markupFormatter.codeMirrorMode}" codemirror-config="${app.markupFormatter.codeMirrorConfig}" previewEndpoint="/markupFormatter/previewDescription"/>
</f:entry>
</f:section>

<f:section title="Filter widgets">
<f:section title="${%Widgets}">
<f:entry field="filterQueue">
<f:checkbox title="${%Filter build queue}"
description="If checked, only jobs in this view will be shown in the queue" />
</f:entry>
<f:entry field="filterExecutors">
<f:checkbox title="${%Filter build executors}"
description="If checked, only those build executors will be shown that could execute the jobs in this view." />
description="If checked, only those build executors will be shown that could execute the jobs in this view" />
</f:entry>
</f:section>

Expand Down
16 changes: 12 additions & 4 deletions war/src/main/scss/base/_style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -408,10 +408,18 @@ img.icon-help {

/* ============================ list view entries ======================== */
div.listview-jobs {
max-height: 300px;
overflow: auto;
margin-left: -15px;
padding-left: 15px;
display: flex;
flex-direction: column;
border: 2px solid red;
//max-height: 300px;
//overflow: auto;
//margin-left: -15px;
//padding-left: 15px;

.nested {
border-left: 2px solid green;
margin-left: 10px;
}
}

/* ============================ health report hover ========================== */
Expand Down
4 changes: 2 additions & 2 deletions war/src/main/scss/form/_checkbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,9 @@
}

.jenkins-checkbox__description {
margin-top: 0.3rem;
//margin-top: 0.3rem;
margin-left: 34px;
margin-bottom: 1rem;
//margin-bottom: 1rem;
color: var(--text-color-secondary);
line-height: 1.66;
}

0 comments on commit 0b813f5

Please sign in to comment.