Skip to content

Commit

Permalink
Reset to master
Browse files Browse the repository at this point in the history
  • Loading branch information
janfaracik committed Mar 28, 2022
1 parent c58eb41 commit b580312
Show file tree
Hide file tree
Showing 14 changed files with 30 additions and 483 deletions.
5 changes: 0 additions & 5 deletions core/src/main/java/hudson/AboutJenkins.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ public String getDescription() {
return Messages.AboutJenkins_Description();
}

// @Override
// public String getSearchDescription() {
// return "Version " + Functions.getVersion();
// }

@Restricted(NoExternalUse.class)
public URL getLicensesURL() {
return AboutJenkins.class.getResource("/META-INF/licenses.xml");
Expand Down
6 changes: 0 additions & 6 deletions core/src/main/java/hudson/model/AbstractItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import hudson.model.queue.SubTask;
import hudson.model.queue.Tasks;
import hudson.model.queue.WorkUnit;
import hudson.search.SearchItemCategory;
import hudson.security.ACL;
import hudson.security.ACLContext;
import hudson.security.AccessControlled;
Expand Down Expand Up @@ -588,11 +587,6 @@ public String getSearchUrl() {
return getShortUrl();
}

@Override
public String getSearchItemCategory() {
return SearchItemCategory.JOBS;
}

@Override
@Exported(visibility = 999, name = "url")
public final String getAbsoluteUrl() {
Expand Down
1 change: 0 additions & 1 deletion core/src/main/java/hudson/model/Action.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

import edu.umd.cs.findbugs.annotations.CheckForNull;
import hudson.Functions;
import hudson.search.SearchItemCategory;

/**
* Object that contributes additional information, behaviors, and UIs to {@link ModelObject}
Expand Down
7 changes: 0 additions & 7 deletions core/src/main/java/hudson/model/Actionable.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;

import hudson.search.SearchItem;
import hudson.search.SearchItemCategory;
import jenkins.model.ModelObjectWithContextMenu;
import jenkins.model.TransientActionFactory;
import org.kohsuke.stapler.StaplerRequest;
Expand Down Expand Up @@ -356,8 +353,4 @@ public Object getDynamic(String token, StaplerRequest req, StaplerResponse rsp)
}

private static final Logger LOGGER = Logger.getLogger(Actionable.class.getName());

public String getSearchItemCategory() {
return SearchItemCategory.OTHER;
}
}
1 change: 0 additions & 1 deletion core/src/main/java/hudson/model/ManagementLink.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import hudson.ExtensionList;
import hudson.ExtensionListView;
import hudson.ExtensionPoint;
import hudson.search.SearchItemCategory;
import hudson.security.Permission;
import java.util.List;
import java.util.logging.Level;
Expand Down
27 changes: 2 additions & 25 deletions core/src/main/java/hudson/search/Search.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
import jenkins.model.Jenkins;
import jenkins.util.MemoryReductionUtil;
import jenkins.util.SystemProperties;
import org.jenkins.ui.icon.Icon;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;
import org.kohsuke.stapler.Ancestor;
Expand Down Expand Up @@ -124,14 +123,8 @@ public void doSuggestOpenSearch(StaplerRequest req, StaplerResponse rsp, @QueryP
*/
public void doSuggest(StaplerRequest req, StaplerResponse rsp, @QueryParameter String query) throws IOException, ServletException {
Result r = new Result();
for (SuggestedItem item : getSuggestions(req, query)) {
r.suggestions.add(new Item(
item.getPath(),
item.item.getSearchDescription(),
item.item.getSearchUrl(),
item.item.getSearchItemIcon(),
item.item.getSearchItemCategory()));
}
for (SuggestedItem item : getSuggestions(req, query))
r.suggestions.add(new Item(item.getPath()));

rsp.serveExposedBean(req, r, Flavor.JSON);
}
Expand Down Expand Up @@ -202,29 +195,13 @@ public static class Result {

@ExportedBean(defaultVisibility = 999)
public static class Item {
@Exported
public String url;
@Exported
@SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD", justification = "read by Stapler")
public String name;
@Exported
public String description;
@Exported
public Icon icon;
@Exported
public String category;

public Item(String name) {
this.name = name;
}

public Item(String name, String description, String url, Icon icon, String category) {
this.name = name;
this.description = description;
this.url = url;
this.icon = icon;
this.category = category;
}
}

private enum Mode {
Expand Down
16 changes: 0 additions & 16 deletions core/src/main/java/hudson/search/SearchItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
package hudson.search;

import hudson.model.Build;
import org.jenkins.ui.icon.Icon;

/**
* Represents an item reachable from {@link SearchIndex}.
Expand Down Expand Up @@ -55,21 +54,6 @@ public interface SearchItem {

String getSearchUrl();

default String getSearchDescription() {
return null;
}

// TODO
default String getSearchItemCategory() {
return SearchItemCategory.OTHER;
}

// TODO
// Overrides the icon from search item category
default Icon getSearchItemIcon() {
return null;
}

/**
* Returns the {@link SearchIndex} to further search sub items inside this item.
*
Expand Down
13 changes: 0 additions & 13 deletions core/src/main/java/hudson/search/SearchItemCategory.java

This file was deleted.

10 changes: 5 additions & 5 deletions core/src/main/java/jenkins/model/Jenkins.java
Original file line number Diff line number Diff line change
Expand Up @@ -2377,11 +2377,11 @@ public String getSearchUrl() {
@Override
public SearchIndexBuilder makeSearchIndex() {
SearchIndexBuilder builder = super.makeSearchIndex();
// if (hasPermission(ADMINISTER)) {
// builder.add("configure", "config", "configure")
// .add("manage")
// .add("log");
// }
if (hasPermission(ADMINISTER)) {
builder.add("configure", "config", "configure")
.add("manage")
.add("log");
}
builder.add(new CollectionSearchIndex<TopLevelItem>() {
@Override
protected SearchItem get(String key) { return getItemByFullName(key, TopLevelItem.class); }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:i="jelly:fmt" xmlns:x="jelly:xml">
<j:set var="searchURL" value="${h.searchURL}"/>
<header id="page-header" class="page-header" data-search-url="${searchURL + 'suggest'}" data-search-help-url="${searchHelpUrl}">
<header id="page-header" class="page-header">
<div class="page-header__brand">
<div class="logo">
<a id="jenkins-home-link" href="${rootURL}/">
Expand All @@ -18,11 +17,29 @@
</a>
</div>

<div class="login page-header__hyperlinks">
<button id="button-spotlight" tooltip="${%Search}" data-keyboard-shortcut="CMD+K">
<l:icon src="symbol-search" />
</button>
<div class="searchbox hidden-xs">
<!-- search box -->
<j:set var="searchURL" value="${h.searchURL}"/>
<form action="${searchURL}" method="get" style="position:relative;" class="no-json" name="search" role="search">
<!-- this div is used to calculate the width of the text box -->
<div id="search-box-sizer"/>
<div id="searchform">
<input name="q" placeholder="${searchPlaceholder}" id="search-box" class="main-search__input" value="${request.getParameter('q')}" role="searchbox" />

<span class="main-search__icon-leading">
<l:icon src="symbol-search"/>
</span>
<a href="${searchHelpUrl}" class="main-search__icon-trailing">
<l:icon src="symbol-help-circle"/>
</a>

<div id="search-box-completion" />
<script>createSearchBox("${searchURL}");</script>
</div>
</form>
</div>

<div class="login page-header__hyperlinks">
<div id="visible-am-insertion" class="page-header__am-wrapper" />
<div id="visible-sec-am-insertion" class="page-header__am-wrapper" />

Expand Down
56 changes: 0 additions & 56 deletions core/src/main/resources/lib/layout/search.jelly

This file was deleted.

1 change: 0 additions & 1 deletion war/src/main/less/base-styles-v2.less
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ html {
@import './modules/breadcrumbs';
@import './modules/buttons';
@import './modules/buttons-temp';
@import "./modules/command-center";
@import './modules/content-blocks';
@import './modules/icon-size';
@import './modules/icons';
Expand Down
Loading

0 comments on commit b580312

Please sign in to comment.