Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-31162] A CopyCategory is returned when it makes sense
  • Loading branch information
recena committed Mar 15, 2016
1 parent c0bf2de commit d204d57
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions core/src/main/java/hudson/model/ItemGroupMixIn.java
Expand Up @@ -367,6 +367,11 @@ public static Categories getCategories(Authentication a, ItemGroup c) {
categories.getItems().add(category);
}
}
if (Jenkins.getInstance().getAllItems().size() > 0) {
Category copy = new Category("category-id-copy", "Copy existing Item", "", "category-icon-copy",
ItemCategory.MIN_WEIGHT, ItemCategory.MIN_TOSHOW, new ArrayList<Map<String, Serializable>>());
categories.getItems().add(copy);
}
return categories;
}

Expand Down
Expand Up @@ -85,7 +85,7 @@ public static Integer getWeight(@Nonnull TopLevelItemDescriptor descriptor) {
protected abstract String getDescriptionFor(@Nonnull TopLevelItemDescriptor descriptor);

/**
* Finds the description specified by the first configurator.
* Finds the weight specified by the first configurator.
* If none can be found a empty string is returned. {@see DefaultConfigurator#getDescriptionFor}.
*
* @param descriptor the item to categorize.
Expand Down

0 comments on commit d204d57

Please sign in to comment.