-
Improvement
-
Resolution: Duplicate
-
Major
If you want to add e.g. new job types dynamically for display in View/newJob.jelly, as cloudbees-template does, you have no real control over where they appear: they are sorted by display name, intermixed with built-in types. (Descriptors added using @Extension can probably specify ordinal to affect sort order, but that does not work for dynamically-registered descriptors.) It would be nice to be able to affect the sort order, or even group related things together under a header or expandable box. Possibilities include:
- Make ${jobs} in newJob.jelly—or more generically, ${descriptors} in form.jelly—be sortable or groupable by DescriptorVisibilityFilter (or a new extension point).
- Add an overridable method to Descriptor (or at least TopLevelItemDescriptor, but this could be useful e.g. for BuilderDescriptor too) specifying a sort position, or category name for grouping.
- Add a method to ExtensionList allowing a custom ExtensionComponent to be added directly; or, equivalently, an add overload taking an ordinal. Permits custom sorting (to some extent) but not grouping.
- Make form.jelly or one of its callers automatically sort by some internal criterion such as by leaf traversal of the inheritance tree. Would make sort order a bit more regular and logical, but allow no fine-tuning.
- duplicates
-
JENKINS-31162 New item categorization and dynamic choice offering
- Resolved