Skip to content
Permalink
Browse files
[JENKINS-38887] Display a warning when the required field is not popu…
…lated
  • Loading branch information
stephenc committed Mar 9, 2017
1 parent 0deb44c commit 9b9e24a5097f721f9cc68bf54927e90147f983f7
@@ -133,7 +133,7 @@ public String getDisplayName() {
}

public AutoCompletionCandidates doAutoCompleteJob(@AncestorInPath ItemGroup<?> container, @QueryParameter final String value) {
// TODO remove code copy&pasted from AutoCompletionCandidates.ofJobNames when it supports union of classes
// TODO remove code copy&pasted from AutoCompletionCandidates.ofJobNames when it supports testing outside Item bound
final AutoCompletionCandidates candidates = new AutoCompletionCandidates();
class Visitor extends ItemVisitor {
String prefix;
@@ -154,7 +154,7 @@ public void onItem(Item i) {
&& i.hasPermission(Item.READ)
// and read permission required
) {
if ((i instanceof ParameterizedJobMixIn.ParameterizedJob || i instanceof Queue.Task) && n.startsWith(value))
if (i instanceof Queue.Task && n.startsWith(value))
candidates.add(n);

// recurse
@@ -218,7 +218,7 @@ public FormValidation doCheckWait(@AncestorInPath ItemGroup<?> context, @QueryPa

public FormValidation doCheckJob(@AncestorInPath ItemGroup<?> context, @QueryParameter String value) {
if (StringUtils.isBlank(value)) {
return FormValidation.ok();
return FormValidation.warning(Messages.BuildTriggerStep_no_job_configured());
}
Item item = Jenkins.getActiveInstance().getItem(value, context, Item.class);
if (item == null) {
@@ -24,6 +24,7 @@ BuildTriggerStep.explicitly_disabling_both_propagate_and_wait=\
Explicitly disabling both <code>propagate</code> and <code>wait</code> is redundant, since <code>propagate</code> is ignored when <code>wait</code> is disabled. \
For brevity, leave <code>propagate</code> at its default.
BuildTriggerStep.no_wait_for_non_jobs=Waiting for non-job items is not supported
BuildTriggerStep.no_job_configured=No job configured
BuildTriggerStep.cannot_find=No such job {0}
BuildTriggerStep.unsupported=Building a {0} is not supported
BuildTriggerStepExecution.building_=Building {0}

0 comments on commit 9b9e24a

Please sign in to comment.