Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-9113

"Copy existing job" autocompletion does not work

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • core
    • None
    • Jenkins 1.403

      I'm trying to create a new job as a copy of an existing job.
      When I enter the name of the job to copy:

      • the suggestion list only displays a few (exactly 10) of the available jobs
      • the suggestion list does not change to match the typed prefix
      • tabbing out of the input box replaces its contents with the first suggestion (which does not match what I typed at all) unless I use the arrows to choose another suggestion

      So I can only copy one of the alphabetically first 10 jobs defined in Jenkins and even that is not easy.

          [JENKINS-9113] "Copy existing job" autocompletion does not work

          mdp added a comment -

          Workaround: actually I have a workaround for the third point. Pressing the up arrow makes the suggestion box disappear and then tabbing out of the input box does not destroy its contents.

          mdp added a comment - Workaround: actually I have a workaround for the third point. Pressing the up arrow makes the suggestion box disappear and then tabbing out of the input box does not destroy its contents.

          What's the browser?

          Kohsuke Kawaguchi added a comment - What's the browser?

          mdp added a comment -

          It happens with Firefox 3.5.17 and with Epiphany 2.30.6
          I will try to test my other browsers too.

          mdp added a comment - It happens with Firefox 3.5.17 and with Epiphany 2.30.6 I will try to test my other browsers too.

          pmv added a comment -

          Doesn't appear to be browser specific. The suggestions don't change on any of the browsers I tested. (Firefox 4, Chrome 10.0.648.151, IE 8)

          pmv added a comment - Doesn't appear to be browser specific. The suggestions don't change on any of the browsers I tested. (Firefox 4, Chrome 10.0.648.151, IE 8)

          sogabe added a comment -

          ViewDescriptor.java #67

              public AutoCompletionCandidates doAutoCompleteCopyNewItemFrom(@QueryParameter final String value) {
                  final AutoCompletionCandidates r = new AutoCompletionCandidates();
          
                  new ItemVisitor() {
                      @Override
                      public void onItemGroup(ItemGroup<?> group) {
                          // only dig deep when the path matches what's typed.
                          // for example, if 'foo/bar' is typed, we want to show 'foo/barcode'
                          if (value.startsWith(group.getFullName()))                                                    <-- (A)
                                  super.onItemGroup(group);
                       }
          
                      @Override
                      public void onItem(Item i) {
                          r.add(i.getFullName());
                          super.onItem(i);
                      }
                  }.onItemGroup(Hudson.getInstance());
          
                  return r;
              }
          

          (A) is always "true" because Hudson.getInstace().getFullName() is empty string.

          sogabe added a comment - ViewDescriptor.java #67 public AutoCompletionCandidates doAutoCompleteCopyNewItemFrom(@QueryParameter final String value) { final AutoCompletionCandidates r = new AutoCompletionCandidates(); new ItemVisitor() { @Override public void onItemGroup(ItemGroup<?> group) { // only dig deep when the path matches what's typed. // for example, if 'foo/bar' is typed, we want to show 'foo/barcode' if (value.startsWith(group.getFullName())) <-- (A) super .onItemGroup(group); } @Override public void onItem(Item i) { r.add(i.getFullName()); super .onItem(i); } }.onItemGroup(Hudson.getInstance()); return r; } (A) is always "true" because Hudson.getInstace().getFullName() is empty string.

          tonioska added a comment -

          Hi Sogabe,

          Please mark JENKINS 9384 as duplicate of 9113 and not the other way around.

          Its seems now that the issue is one day old instead of 1 month old.

          Thanks.

          tonioska added a comment - Hi Sogabe, Please mark JENKINS 9384 as duplicate of 9113 and not the other way around. Its seems now that the issue is one day old instead of 1 month old. Thanks.

            Unassigned Unassigned
            mdp mdp
            Votes:
            4 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: