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

Sort list of available dashboards alphabetically

    Details

    • Similar Issues:

      Description

      When selecting a dashboard using the list box, the order of portlets is somewhat random. It would be nice if the portlets would be sorted alphabetically by the localized name.

        Attachments

          Issue Links

            Activity

            Hide
            mambu Marco Ambu added a comment -

            Any hints?

            I tried with the following but the list is always empty.

             
            public DescriptorExtensionList<DashboardPortlet, Descriptor<DashboardPortlet>> getDashboardPortletDescriptors() {
                DescriptorExtensionList<DashboardPortlet, Descriptor<DashboardPortlet>> list = DashboardPortlet.all();
            //    Collections.sort(list);
                Collections.sort(list, new Comparator<Descriptor<DashboardPortlet>>() {
                  public int compare(Descriptor<DashboardPortlet> p1, Descriptor<DashboardPortlet> p2) {
                    return p1.getDisplayName().compareTo(p2.getDisplayName());
                  }
                });
                return list;
              }
            
            Show
            mambu Marco Ambu added a comment - Any hints? I tried with the following but the list is always empty. public DescriptorExtensionList<DashboardPortlet, Descriptor<DashboardPortlet>> getDashboardPortletDescriptors() { DescriptorExtensionList<DashboardPortlet, Descriptor<DashboardPortlet>> list = DashboardPortlet.all(); // Collections.sort(list); Collections.sort(list, new Comparator<Descriptor<DashboardPortlet>>() { public int compare(Descriptor<DashboardPortlet> p1, Descriptor<DashboardPortlet> p2) { return p1.getDisplayName().compareTo(p2.getDisplayName()); } }); return list; }
            Hide
            drulli Ulli Hafner added a comment -

            I haven't yet used such a list in the code, maybe that's a good question for the dev list.

            Show
            drulli Ulli Hafner added a comment - I haven't yet used such a list in the code, maybe that's a good question for the dev list.
            Hide
            mambu Marco Ambu added a comment -

            If we change the selection mechanism, we may solve this problem too.

            Show
            mambu Marco Ambu added a comment - If we change the selection mechanism, we may solve this problem too.
            Show
            sogabe sogabe added a comment - See https://github.com/jenkinsci/dashboard-view-plugin/commit/cbc20ccc00ee160ed9490dcd1bcbe74338033769

              People

              • Assignee:
                sogabe sogabe
                Reporter:
                drulli Ulli Hafner
              • Votes:
                1 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: