Skip to content

Commit

Permalink
Remove some search entries, make icons smaller
Browse files Browse the repository at this point in the history
  • Loading branch information
janfaracik committed May 30, 2022
1 parent 9ef136f commit 0037021
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 65 deletions.
46 changes: 0 additions & 46 deletions core/src/main/java/hudson/model/Job.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@
import hudson.model.listeners.ItemListener;
import hudson.scm.ChangeLogSet;
import hudson.scm.SCM;
import hudson.search.QuickSilver;
import hudson.search.SearchIndex;
import hudson.search.SearchIndexBuilder;
import hudson.search.SearchItem;
import hudson.search.SearchItems;
import hudson.security.ACL;
import hudson.tasks.LogRotator;
import hudson.util.AlternativeUiTextProvider;
Expand Down Expand Up @@ -478,31 +473,6 @@ public boolean supportsLogRotator() {
return true;
}

@Override
protected SearchIndexBuilder makeSearchIndex() {
return super.makeSearchIndex().add(new SearchIndex() {
@Override
public void find(String token, List<SearchItem> result) {
try {
if (token.startsWith("#"))
token = token.substring(1); // ignore leading '#'
int n = Integer.parseInt(token);
Run b = getBuildByNumber(n);
if (b == null)
return; // no such build
result.add(SearchItems.create("#" + n, "" + n, b));
} catch (NumberFormatException e) {
// not a number.
}
}

@Override
public void suggest(String token, List<SearchItem> result) {
find(token, result);
}
}).add("configure", "config", "configure");
}

@Override
public Collection<? extends Job> getAllJobs() {
return Collections.<Job>singleton(this);
Expand Down Expand Up @@ -910,8 +880,6 @@ public File getBuildDir() {
* Returns the last build.
* @see LazyBuildMixIn#getLastBuild
*/
@Exported
@QuickSilver
public RunT getLastBuild() {
SortedMap<Integer, ? extends RunT> runs = _getRuns();

Expand All @@ -924,8 +892,6 @@ public RunT getLastBuild() {
* Returns the oldest build in the record.
* @see LazyBuildMixIn#getFirstBuild
*/
@Exported
@QuickSilver
public RunT getFirstBuild() {
SortedMap<Integer, ? extends RunT> runs = _getRuns();

Expand All @@ -940,8 +906,6 @@ public RunT getFirstBuild() {
*
* @see #getLastStableBuild()
*/
@Exported
@QuickSilver
public RunT getLastSuccessfulBuild() {
return (RunT) Permalink.LAST_SUCCESSFUL_BUILD.resolve(this);
}
Expand All @@ -950,8 +914,6 @@ public RunT getLastSuccessfulBuild() {
* Returns the last build that was anything but stable, if any. Otherwise null.
* @see #getLastSuccessfulBuild
*/
@Exported
@QuickSilver
public RunT getLastUnsuccessfulBuild() {
return (RunT) Permalink.LAST_UNSUCCESSFUL_BUILD.resolve(this);
}
Expand All @@ -960,8 +922,6 @@ public RunT getLastUnsuccessfulBuild() {
* Returns the last unstable build, if any. Otherwise null.
* @see #getLastSuccessfulBuild
*/
@Exported
@QuickSilver
public RunT getLastUnstableBuild() {
return (RunT) Permalink.LAST_UNSTABLE_BUILD.resolve(this);
}
Expand All @@ -970,26 +930,20 @@ public RunT getLastUnstableBuild() {
* Returns the last stable build, if any. Otherwise null.
* @see #getLastSuccessfulBuild
*/
@Exported
@QuickSilver
public RunT getLastStableBuild() {
return (RunT) Permalink.LAST_STABLE_BUILD.resolve(this);
}

/**
* Returns the last failed build, if any. Otherwise null.
*/
@Exported
@QuickSilver
public RunT getLastFailedBuild() {
return (RunT) Permalink.LAST_FAILED_BUILD.resolve(this);
}

/**
* Returns the last completed build, if any. Otherwise null.
*/
@Exported
@QuickSilver
public RunT getLastCompletedBuild() {
return (RunT) Permalink.LAST_COMPLETED_BUILD.resolve(this);
}
Expand Down
12 changes: 0 additions & 12 deletions core/src/main/java/hudson/model/Run.java
Original file line number Diff line number Diff line change
Expand Up @@ -1574,18 +1574,6 @@ public void writeWholeLogTo(@NonNull OutputStream out) throws IOException, Inter
return new AnnotatedLargeText(getLogFile(), getCharset(), !isLogUpdated(), this);
}

@Override
protected @NonNull SearchIndexBuilder makeSearchIndex() {
SearchIndexBuilder builder = super.makeSearchIndex()
.add("console")
.add("changes");
for (Action a : getAllActions()) {
if (a.getIconFileName() != null)
builder.add(a.getUrlName());
}
return builder;
}

public @NonNull Api getApi() {
return new Api(this);
}
Expand Down
5 changes: 0 additions & 5 deletions core/src/main/java/jenkins/model/Jenkins.java
Original file line number Diff line number Diff line change
Expand Up @@ -2380,11 +2380,6 @@ public String getSearchUrl() {
@Override
public SearchIndexBuilder makeSearchIndex() {
SearchIndexBuilder builder = super.makeSearchIndex();
// 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
4 changes: 2 additions & 2 deletions war/src/main/less/modules/command-palette.less
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,8 @@

svg,
img {
width: 1.4rem;
height: 1.4rem;
width: 1.2rem;
height: 1.2rem;
}
}

Expand Down

0 comments on commit 0037021

Please sign in to comment.