Skip to content

Commit

Permalink
Merge pull request #29 from timja/refresh-plugin
Browse files Browse the repository at this point in the history
[JENKINS-65511] Refresh plugin, fixing UI issues
  • Loading branch information
jglick authored Mar 22, 2023
2 parents 620601c + c40cd43 commit 48a3338
Show file tree
Hide file tree
Showing 23 changed files with 162 additions and 355 deletions.
44 changes: 14 additions & 30 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.55</version>
<version>4.56</version>
<relativePath/>
</parent>

Expand All @@ -13,11 +13,11 @@
<version>${changelist}</version>
<name>View Job Filters</name>
<url>https://github.com/jenkinsci/${project.artifactId}-plugin</url>
<scm>
<connection>scm:git:git://github.com/${gitHubRepo}.git</connection>
<developerConnection>scm:git:[email protected]:${gitHubRepo}.git</developerConnection>
<url>https://github.com/${gitHubRepo}</url>
<scm child.scm.connection.inherit.append.path="false" child.scm.developerConnection.inherit.append.path="false" child.scm.url.inherit.append.path="false">
<connection>scm:git:https://github.com/${gitHubRepo}</connection>
<developerConnection>scm:git:https://github.com/${gitHubRepo}</developerConnection>
<tag>${scmTag}</tag>
<url>https://github.com/${gitHubRepo}</url>
</scm>
<licenses>
<license>
Expand All @@ -40,9 +40,9 @@
<type>pom</type>
</dependency>
<dependency>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>maven-plugin</artifactId>
<version>3.5</version>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
<version>3.9.0</version>
</dependency>
</dependencies>
</dependencyManagement>
Expand Down Expand Up @@ -72,30 +72,14 @@
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>m2-extra-steps</artifactId>
<version>1.1.8</version>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>maven-plugin</artifactId>
<version>3.21</version>
<optional>true</optional>
<exclusions>
<exclusion>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-http</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</exclusion>
<exclusion>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-webdav-jackrabbit</artifactId>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
</exclusion>
</exclusions>
</dependency>
Expand Down Expand Up @@ -187,7 +171,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-invoker-plugin</artifactId>
<version>3.1.0</version>
<version>3.4.0</version>
<executions>
<execution>
<id>integration-test-install</id>
Expand Down
40 changes: 0 additions & 40 deletions src/main/java/hudson/views/MavenExtraStepsValuesHelper.java

This file was deleted.

14 changes: 0 additions & 14 deletions src/main/java/hudson/views/MavenValuesHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public class MavenValuesHelper {
* If I add any more helpers, switch to a better design first.
*/
public static final MavenProjectValuesHelper MODULESET_HELPER = buildMavenProjectValuesHelper();
public static final MavenExtraStepsValuesHelper EXTRASTEPS_HELPER = buildMavenExtraStepsValuesHelper();
public static final MatrixProjectBuildersHelper MATRIX_PROJECT_HELPER = buildMatrixProjectBuildersHelper();

@SuppressWarnings({ "unchecked" })
Expand All @@ -33,10 +32,6 @@ public static List<String> getValues(TopLevelItem item) {
List<String> more = MODULESET_HELPER.getValues(item);
values.addAll(more);
}
if (EXTRASTEPS_HELPER != null) {
List<String> more = EXTRASTEPS_HELPER.getValues(item);
values.addAll(more);
}
return values;
}

Expand Down Expand Up @@ -81,15 +76,6 @@ private static MavenProjectValuesHelper buildMavenProjectValuesHelper() {
}
}

private static MavenExtraStepsValuesHelper buildMavenExtraStepsValuesHelper() {
try {
return PluginHelperUtils.validateAndThrow(new MavenExtraStepsValuesHelper());
} catch (Throwable t) {
// necessary maven plugins not installed
return null;
}
}

private static MatrixProjectBuildersHelper buildMatrixProjectBuildersHelper() {
try {
return PluginHelperUtils.validateAndThrow(new MatrixProjectBuildersHelper());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form"
xmlns:i="jelly:fmt" xmlns:p="/lib/hudson/project">
<f:entry title="${%How far back to check}:">
<st:nbsp />
<input type="text" name="amount" value="${instance.amount}" size="10" maxlength="10" />
<st:nbsp />
<select name="amountTypeString" class="amountType">
<f:option value="Hours" selected="${instance.amountTypeString == 'Hours'}">${%Hours}</f:option>
<f:option value="Days" selected="${instance.amountTypeString == 'Days'}">${%Days}</f:option>
<f:option value="Builds" selected="${instance.amountTypeString == 'Builds'}">${%Builds}</f:option>
</select>
<input class="jenkins-input jenkins-!-margin-bottom-1" type="text" name="amount" value="${instance.amount}" size="10" maxlength="10" />
<div class="jenkins-select">
<select name="amountTypeString" class="jenkins-select__input amountType">
<f:option value="Hours" selected="${instance.amountTypeString == 'Hours'}">${%Hours}</f:option>
<f:option value="Days" selected="${instance.amountTypeString == 'Days'}">${%Days}</f:option>
<f:option value="Builds" selected="${instance.amountTypeString == 'Builds'}">${%Builds}</f:option>
</select>
</div>
</f:entry>
<st:include page="config.jelly" class="hudson.views.AbstractIncludeExcludeJobFilter" optional="false"/>
</j:jelly>
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form"
xmlns:i="jelly:fmt" xmlns:p="/lib/hudson/project">
<f:entry title="${%Match Type}:">
<select name="includeExcludeTypeString" class="setting-input">
<f:option value="includeMatched" selected="${instance.includeMatched}">${%Include Matched - Add jobs that match this filter}</f:option>
<f:option value="includeUnmatched" selected="${instance.includeUnmatched}">${%Include Unmatched - Add jobs that don't match this filter}</f:option>
<f:option value="excludeMatched" selected="${instance.excludeMatched}">${%Exclude Matched - Filter out jobs that match this filter}</f:option>
<f:option value="excludeUnmatched" selected="${instance.excludeUnmatched}">${%Exclude Unmatched - Filter out jobs that don't match this filter}</f:option>
</select>
<div class="jenkins-select">
<select name="includeExcludeTypeString" class="jenkins-select__input">
<f:option value="includeMatched" selected="${instance.includeMatched}">${%Include Matched - Add jobs that match this filter}</f:option>
<f:option value="includeUnmatched" selected="${instance.includeUnmatched}">${%Include Unmatched - Add jobs that don't match this filter}</f:option>
<f:option value="excludeMatched" selected="${instance.excludeMatched}">${%Exclude Matched - Filter out jobs that match this filter}</f:option>
<f:option value="excludeUnmatched" selected="${instance.excludeUnmatched}">${%Exclude Unmatched - Filter out jobs that don't match this filter}</f:option>
</select>
</div>
</f:entry>
</j:jelly>
12 changes: 9 additions & 3 deletions src/main/resources/hudson/views/BuildStatusFilter/config.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@
xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form"
xmlns:i="jelly:fmt" xmlns:p="/lib/hudson/project">
<f:entry title="${%Build Statuses}:">
<f:checkbox name="building" field="building"/> ${%Currently Building}
<f:checkbox name="neverBuilt" field="neverBuilt"/> ${%Never Built}
<f:checkbox name="inBuildQueue" field="inBuildQueue"/> ${%In Build Queue}
<div>
<f:checkbox title="${%Currently Building}" field="building"/>
</div>
<div>
<f:checkbox title="${%Never Built}" name="neverBuilt" field="neverBuilt"/>
</div>
<div>
<f:checkbox title="${%In Build Queue}" field="inBuildQueue"/>
</div>
</f:entry>
<st:include page="config.jelly" class="hudson.views.AbstractIncludeExcludeJobFilter" optional="false"/>
</j:jelly>
20 changes: 15 additions & 5 deletions src/main/resources/hudson/views/JobStatusFilter/config.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,21 @@
xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form"
xmlns:i="jelly:fmt" xmlns:p="/lib/hudson/project">
<f:entry title="${%Job Statuses}:">
<f:checkbox name="stable" field="stable"/> ${%Stable}
<f:checkbox name="failed" field="failed"/> ${%Failed}
<f:checkbox name="unstable" field="unstable"/> ${%Unstable}
<f:checkbox name="aborted" field="aborted"/> ${%Aborted}
<f:checkbox name="disabled" field="disabled"/> ${%Disabled}
<div>
<f:checkbox title="${%Stable}" field="stable"/>
</div>
<div>
<f:checkbox title="${%Failed}" field="failed"/>
</div>
<div>
<f:checkbox title="${%Unstable}" field="unstable"/>
</div>
<div>
<f:checkbox title="${%Aborted}" field="aborted"/>
</div>
<div>
<f:checkbox title="${%Disabled}" field="disabled"/>
</div>
</f:entry>
<st:include page="config.jelly" class="hudson.views.AbstractIncludeExcludeJobFilter" optional="false"/>
</j:jelly>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<f:entry title="${%Number of jobs to include}:">
<f:textbox name="maxToInclude" field="maxToInclude" />
</f:entry>
<f:entry title="${%Use job start time instead of completion time}:">
<f:entry title="${%Use job start time instead of completion time}">
<f:checkbox name="checkStartTime" field="checkStartTime"/>
</f:entry>
</j:jelly>
11 changes: 6 additions & 5 deletions src/main/resources/hudson/views/ParameterFilter/config.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@
<f:textbox name="valueRegex" field="valueRegex" />
</f:entry>
<f:entry help="/plugin/view-job-filters/parameter-default-help.html">
<f:checkbox name="useDefaultValue" field="useDefaultValue"/> ${%Match the configured default values instead of the actual value from last successful build}
<f:checkbox title="${%Match the configured default values instead of the actual value from last successful build}" field="useDefaultValue"/>
</f:entry>
<f:entry>
<f:checkbox name="matchAllBuilds" field="matchAllBuilds"/> ${%Match against this many previous builds} (${%blank or 0 for all}):
<st:nbsp />
<input type="text" name="maxBuildsToMatch" value="${instance.maxBuildsToMatch}" size="10" maxlength="10" />
<f:checkbox title="${%Match against this many previous builds} (${%blank or 0 for all})" field="matchAllBuilds"/>
<div>
<input class="jenkins-input" name="maxBuildsToMatch" value="${instance.maxBuildsToMatch}" size="10" maxlength="10" />
</div>
</f:entry>
<f:entry>
<f:checkbox name="matchBuildsInProgress" field="matchBuildsInProgress"/> ${%Match against builds in progress}
<f:checkbox title="${%Match against builds in progress}" field="matchBuildsInProgress"/>
</f:entry>
<f:entry title="${%Description}:">
<f:textbox name="descriptionRegex" field="descriptionRegex" />
Expand Down
38 changes: 24 additions & 14 deletions src/main/resources/hudson/views/RegExJobFilter/config.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,31 @@
</f:entry>
<f:entry title="${%Match Value}:">
<div class="valueType">
<select name="valueTypeString" class="setting-input" onchange="this.parentElement.querySelector('.nameOptions').style.display = ((this.options[this.selectedIndex].value.match(/NAME/)) ? 'block' : 'none')">
<f:option value="NAME" selected="${instance.valueTypeString == 'NAME'}">${%Job name}</f:option>
<f:option value="FOLDER_NAME" selected="${instance.valueTypeString == 'FOLDER_NAME'}">${%Job folder name}</f:option>
<f:option value="DESCRIPTION" selected="${instance.valueTypeString == 'DESCRIPTION'}">${%Job description}</f:option>
<f:option value="SCM" selected="${instance.valueTypeString == 'SCM'}">${%Job SCM configuration}</f:option>
<f:option value="EMAIL" selected="${instance.valueTypeString == 'EMAIL'}">${%Email recipients}</f:option>
<f:option value="MAVEN" selected="${instance.valueTypeString == 'MAVEN'}">${%Maven configuration}</f:option>
<f:option value="SCHEDULE" selected="${instance.valueTypeString == 'SCHEDULE'}">${%Job schedule}</f:option>
<f:option value="NODE" selected="${instance.valueTypeString == 'NODE'}">${%Node label expression}</f:option>
</select>
<div class="jenkins-select jenkins-!-margin-bottom-2">
<select name="valueTypeString" class="jenkins-select__input" onchange="this.parentElement.querySelector('.nameOptions').style.display = ((this.options[this.selectedIndex].value.match(/NAME/)) ? 'block' : 'none')">
<f:option value="NAME" selected="${instance.valueTypeString == 'NAME'}">${%Job name}</f:option>
<f:option value="FOLDER_NAME" selected="${instance.valueTypeString == 'FOLDER_NAME'}">${%Job folder name}</f:option>
<f:option value="DESCRIPTION" selected="${instance.valueTypeString == 'DESCRIPTION'}">${%Job description}</f:option>
<f:option value="SCM" selected="${instance.valueTypeString == 'SCM'}">${%Job SCM configuration}</f:option>
<f:option value="EMAIL" selected="${instance.valueTypeString == 'EMAIL'}">${%Email recipients}</f:option>
<f:option value="MAVEN" selected="${instance.valueTypeString == 'MAVEN'}">${%Maven configuration}</f:option>
<f:option value="SCHEDULE" selected="${instance.valueTypeString == 'SCHEDULE'}">${%Job schedule}</f:option>
<f:option value="NODE" selected="${instance.valueTypeString == 'NODE'}">${%Node label expression}</f:option>
</select>
</div>
<div class="nameOptions" style="display: ${(empty instance.valueTypeString || instance.valueTypeString.contains('NAME')) ? 'block' : 'none'}">
<f:checkbox name="matchName" field="matchName" default="true" /> ${%Name}
<f:checkbox name="matchFullName" field="matchFullName" default="false" /> ${%Full name}
<f:checkbox name="matchDisplayName" field="matchDisplayName" default="false" /> ${%Display name}
<f:checkbox name="matchFullDisplayName" field="matchFullDisplayName" default="false" /> ${%Full display name}
<div>
<f:checkbox title="${%Name}" field="matchName" default="true"/>
</div>
<div>
<f:checkbox title="${%Full name}" field="matchFullName" default="false"/>
</div>
<div>
<f:checkbox title="${%Display name}" field="matchDisplayName" default="false"/>
</div>
<div>
<f:checkbox title="${%Full display name}" field="matchFullDisplayName" default="false"/>
</div>
</div>
</div>
</f:entry>
Expand Down
23 changes: 15 additions & 8 deletions src/main/resources/hudson/views/SecurityFilter/config.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,21 @@
xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form"
xmlns:i="jelly:fmt" xmlns:p="/lib/hudson/project">
<f:entry title="${%Permissions}">
<select name="permissionCheckType">
<f:option value="MustMatchAll" selected="${instance.permissionCheckType == 'MustMatchAll'}">${%Must Match All - Match jobs for which the current user has all of these permissions}</f:option>
<f:option value="AtLeastOne" selected="${instance.permissionCheckType == 'AtLeastOne'}">${%Match At Least One - Match jobs for which current user has at least one of these permissions}</f:option>
</select>
<br/>
<f:checkbox name="configure" field="configure"/> ${%Configure} <br/>
<f:checkbox name="build" field="build"/> ${%Build} <br/>
<f:checkbox name="workspace" field="workspace"/> ${%Workspace}
<div class="jenkins-select jenkins-!-margin-bottom-2">
<select class="jenkins-select__input" name="permissionCheckType">
<f:option value="MustMatchAll" selected="${instance.permissionCheckType == 'MustMatchAll'}">${%Must Match All - Match jobs for which the current user has all of these permissions}</f:option>
<f:option value="AtLeastOne" selected="${instance.permissionCheckType == 'AtLeastOne'}">${%Match At Least One - Match jobs for which current user has at least one of these permissions}</f:option>
</select>
</div>
<div>
<f:checkbox title="${%Configure}" field="configure"/>
</div>
<div>
<f:checkbox title="${%Build}" field="build"/>
</div>
<div>
<f:checkbox title="${%Workspace}" field="workspace"/>
</div>
</f:entry>
<st:include page="config.jelly" class="hudson.views.AbstractIncludeExcludeJobFilter" optional="false"/>
</j:jelly>
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@
xmlns:i="jelly:fmt" xmlns:p="/lib/hudson/project">

<f:entry>
<f:checkbox name="includeDownstream" field="includeDownstream" /> ${%Include downstream jobs} <br/>
<f:checkbox name="includeUpstream" field="includeUpstream" /> ${%Include upstream jobs} <br/>
<f:checkbox name="recursive" field="recursive" /> ${%Include upstream/downstream jobs recursively} <br/>
<f:checkbox name="excludeOriginals" field="excludeOriginals" /> ${%Do not show source jobs}
<div>
<f:checkbox title="${%Include downstream jobs}" field="includeDownstream"/>
</div>
<div>
<f:checkbox title="${%Include upstream jobs}" field="includeUpstream"/>
</div>
<div>
<f:checkbox title="${%Include upstream/downstream jobs recursively}" field="recursive"/>
</div>
<div>
<f:checkbox title="${%Do not show source jobs}" field="excludeOriginals"/>
</div>
</f:entry>

</j:jelly>
Loading

0 comments on commit 48a3338

Please sign in to comment.