Skip to content

Commit

Permalink
Revert "Update Search.java"
Browse files Browse the repository at this point in the history
This reverts commit 24837ea.
  • Loading branch information
janfaracik committed Dec 10, 2024
1 parent 24837ea commit a9aadba
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions core/src/main/java/hudson/search/Search.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,19 +160,14 @@ public void doSuggestOpenSearch(StaplerRequest2 req, StaplerResponse2 rsp, @Quer
public void doSuggest(StaplerRequest2 req, StaplerResponse2 rsp, @QueryParameter String query) throws IOException, ServletException {
Result r = new Result();
for (SuggestedItem item : getSuggestions(req, query)) {
String icon = item.item.getSearchIcon();
String iconXml = null;

if (icon == null) {
iconXml = Symbol.get(new SymbolRequest.Builder().withRaw("symbol-search").build());
} else if (icon.startsWith("symbol-")) {
icon = null;
iconXml = Symbol.get(new SymbolRequest.Builder().withRaw(icon).build());
} else {
icon = item.item.getSearchIcon();
String symbolName = item.item.getSearchIcon();

if (symbolName == null || !symbolName.startsWith("symbol-")) {
symbolName = "symbol-search";
}

r.suggestions.add(new Item(item.getPath(), item.getUrl(), icon, iconXml));
r.suggestions.add(new Item(item.getPath(), item.getUrl(), "",
Symbol.get(new SymbolRequest.Builder().withRaw(symbolName).build())));
}
rsp.serveExposedBean(req, r, Flavor.JSON);
}
Expand Down

0 comments on commit a9aadba

Please sign in to comment.