Skip to content
Permalink
Browse files
[JENKINS-31162] iconClassName field has been remove from Category ent…
…ity. name field has been renamed to displayName
  • Loading branch information
recena committed Mar 15, 2016
1 parent d204d57 commit 2bdcd5b7a988540ab09a236bce5b8a20dacf0683
Showing 3 changed files with 12 additions and 27 deletions.
@@ -351,9 +351,8 @@ public static Categories getCategories(Authentication a, ItemGroup c) {

// Information about Item.
metadata.put("class", effectiveClazz);
metadata.put("iconClassName", "item-icon-" + effectiveClazz.substring(descriptor.clazz.getName().lastIndexOf(".") + 1).toLowerCase());
metadata.put("weight", ItemCategoryConfigurator.getWeight(descriptor));
metadata.put("name", descriptor.getDisplayName());
metadata.put("displayName", descriptor.getDisplayName());
metadata.put("description", ItemCategoryConfigurator.getDescription(descriptor));

Category category = categories.getItem(ic.getId());
@@ -362,13 +361,20 @@ public static Categories getCategories(Authentication a, ItemGroup c) {
} else {
List<Map<String, Serializable>> temp = new ArrayList<Map<String, Serializable>>();
temp.add(metadata);
category = new Category(ic.getId(), ic.getDisplayName(), ic.getDescription(), ic.getIconClassName(),
ic.getWeight(), ic.getMinToShow(), temp);
category = new Category(ic.getId(), ic.getDisplayName(), ic.getDescription(), ic.getWeight(), ic.getMinToShow(), temp);
categories.getItems().add(category);
}
}
if (Jenkins.getInstance().getAllItems().size() > 0) {
Category copy = new Category("category-id-copy", "Copy existing Item", "", "category-icon-copy",
Map<String, Serializable> metadata = new HashMap<String, Serializable>();

// Information about Item.
metadata.put("class", "copy");
metadata.put("weight", Integer.MIN_VALUE);
metadata.put("displayName", "");
metadata.put("description", "");

Category copy = new Category("category-id-copy", "Copy existing Item", "Use an existing item as a starting point for creating a new item configuration.",
ItemCategory.MIN_WEIGHT, ItemCategory.MIN_TOSHOW, new ArrayList<Map<String, Serializable>>());
categories.getItems().add(copy);
}
@@ -22,20 +22,16 @@ public class Category implements Serializable {

private String description;

private String iconClassName;

private int weight;

private int minToShow;

private List<Map<String, Serializable>> items;

public Category(String id, String name, String description, String iconClassName, int weight, int minToShow,
List<Map<String, Serializable>> items) {
public Category(String id, String name, String description, int weight, int minToShow, List<Map<String, Serializable>> items) {
this.id= id;
this.name = name;
this.description = description;
this.iconClassName = iconClassName;
this.weight = weight;
this.minToShow = minToShow;
this.items = items;
@@ -56,11 +52,6 @@ public String getDescription() {
return description;
}

@Exported
public String getIconClassName() {
return iconClassName;
}

@Exported
public int getWeight() {
return weight;
@@ -23,13 +23,6 @@ public abstract class ItemCategory implements ModelObject, ExtensionPoint {
*/
public abstract String getId();

/**
* The icon class specification e.g. 'category-icon-folder', 'category-icon-basicprojects', etc.
*
* @return the icon class specification
*/
public abstract String getIconClassName();

/**
* The description in plain text
*
@@ -62,11 +55,6 @@ public String getId() {
return "category-id-basicprojects";
}

@Override
public String getIconClassName() {
return "category-icon-basicprojects";
}

@Override
public String getDescription() {
return Messages.ItemCategory_BasicProjects_Description();

0 comments on commit 2bdcd5b

Please sign in to comment.