Skip to content
Permalink
Browse files

[JENKINS-28094] Displays the help files of Copyartifact#getSelector f…

…or BuildSelectorParameter.
  • Loading branch information...
ikedam committed May 3, 2015
1 parent f28c554 commit 4e5cd111fc9cf6d0b85594fb02978ff3fcd61c50
@@ -111,6 +111,21 @@ public boolean apply(Descriptor<BuildSelector> input) {
}
));
}

@Override
public String getHelpFile(String fieldName) {
if ("defaultSelector".equals(fieldName) || "parameter".equals(fieldName)) {
// Display the help file of `Copyartifact#getSelector` ("which build" field)
// for `defaultSelector` ("Default Selector" field) in project configuration pages
// and the value of build parameter ("Build selector for Copy Artifact" field)
// in "This build requires parameters" pages.
Descriptor<?> d = Jenkins.getInstance().getDescriptor(CopyArtifact.class);
if (d != null) {
return d.getHelpFile("selector");
}
}
return super.getHelpFile(fieldName);
}
}

private static final XStream2 XSTREAM = new XStream2();
@@ -26,7 +26,7 @@ THE SOFTWARE.
<f:entry title="${%Name}" field="name" help="/help/parameter/name.html">
<f:textbox/>
</f:entry>
<f:dropdownDescriptorSelector field="defaultSelector" help="/plugin/copyartifact/help-buildSelector.html"
<f:dropdownDescriptorSelector field="defaultSelector"
title="${%Default Selector}" descriptors="${descriptor.availableBuildSelectorList}" />
<f:entry title="${%Description}" field="description" help="/help/parameter/description.html">
<f:textarea/>
@@ -23,12 +23,15 @@ THE SOFTWARE.
-->
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:f="/lib/form">
<f:dropdownDescriptorSelector field="parameter" help="/plugin/copyartifact/help-buildSelector.html"
<j:scope>
<j:set var="descriptor" value="${it.descriptor}" /> <!-- this enables displaying the help file. -->
<f:dropdownDescriptorSelector field="parameter"
title="${it.name}" description="${it.description}"
default="${it.defaultSelector}"
descriptors="${it.descriptor.availableBuildSelectorList}">
<j:if test="${dropdownListMode=='generateEntries'}">
<tr><td><input type="hidden" name="name" value="${it.name}"/></td></tr>
</j:if>
</f:dropdownDescriptorSelector>
</j:scope>
</j:jelly>

0 comments on commit 4e5cd11

Please sign in to comment.
You can’t perform that action at this time.