提交 d6622b32 编写于 作者: A Andrew Bayer

Added autocompletion to aggregated test job textbox.

上级 c40507f4
......@@ -25,6 +25,7 @@ package hudson.tasks.test;
import hudson.model.AbstractBuild;
import hudson.model.AbstractProject;
import hudson.model.AutoCompletionCandidates;
import hudson.Extension;
import hudson.Launcher;
import hudson.Util;
......@@ -33,6 +34,7 @@ import hudson.model.BuildListener;
import hudson.model.Fingerprint.RangeSet;
import hudson.model.Hudson;
import hudson.model.Item;
import hudson.model.Job;
import hudson.model.Result;
import hudson.model.Run;
import hudson.model.TaskListener;
......@@ -348,6 +350,20 @@ public class AggregatedTestResultPublisher extends Recorder {
else
return new AggregatedTestResultPublisher(s.getString("jobs"));
}
public AutoCompletionCandidates doAutoCompleteJobs(@QueryParameter String value) {
AutoCompletionCandidates candidates = new AutoCompletionCandidates();
List<Job> jobs = Hudson.getInstance().getItems(Job.class);
for (Job job: jobs) {
if (job.getFullName().startsWith(value)) {
if (job.hasPermission(Item.READ)) {
candidates.add(job.getFullName());
}
}
}
return candidates;
}
}
}
......@@ -32,12 +32,14 @@ THE SOFTWARE.
<f:entry title="${%Jobs to aggregate}"
help="/help/tasks/aggregate-test/manual-list.html">
<f:textbox name="aggragatedTestResult.jobs" value="${instance.jobs}"
checkUrl="'descriptorByName/AggregatedTestResultPublisher/check?value='+encodeURIComponent(this.value)"/>
checkUrl="'descriptorByName/AggregatedTestResultPublisher/check?value='+encodeURIComponent(this.value)"
field="jobs"
autoCompleteDelimChar="," />
</f:entry>
</f:optionalBlock>
<f:entry field="includeFailedBuilds" title="">
<f:checkbox name="includeFailedBuilds" checked="${instance.includeFailedBuilds}" title="${%Include failed bulds in results}" />
</f:entry>
</table>
</f:nested>
<f:entry field="includeFailedBuilds" title="">
<f:checkbox name="includeFailedBuilds" checked="${instance.includeFailedBuilds}" title="${%Include failed bulds in results}" />
</f:entry>
</j:jelly>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册