Make iconXml private, rename to icon

This commit is contained in:
Jan Faracik 2024-12-11 21:37:47 +00:00
parent 1b9faa8fb0
commit 809d2e6120
3 changed files with 9 additions and 9 deletions

View File

@ -277,23 +277,23 @@ public class Search implements StaplerProxy {
private final String type; private final String type;
public final String iconXml; private final String icon;
public Item(String name) { public Item(String name) {
this(name, null, null); this(name, null, null);
} }
public Item(String name, String url, String iconXml) { public Item(String name, String url, String icon) {
this.name = name; this.name = name;
this.url = url; this.url = url;
this.iconXml = iconXml; this.icon = icon;
this.type = "symbol"; this.type = "symbol";
} }
public Item(String name, String url, String iconXml, String type) { public Item(String name, String url, String icon, String type) {
this.name = name; this.name = name;
this.url = url; this.url = url;
this.iconXml = iconXml; this.icon = icon;
this.type = type; this.type = type;
} }
@ -303,8 +303,8 @@ public class Search implements StaplerProxy {
} }
@Exported @Exported
public String getIconXml() { public String getIcon() {
return iconXml; return icon;
} }
@Exported @Exported

View File

@ -17,7 +17,7 @@ export const JenkinsSearchSource = {
rsp.json().then((data) => { rsp.json().then((data) => {
return data["suggestions"].slice().map((e) => return data["suggestions"].slice().map((e) =>
LinkResult({ LinkResult({
icon: e.iconXml, icon: e.icon,
type: e.type, type: e.type,
label: e.name, label: e.name,
url: correctAddress(e.url), url: correctAddress(e.url),

View File

@ -5,7 +5,7 @@ import { xmlEscape } from "@/util/security";
* @param {Object} params * @param {Object} params
* @param {string} params.icon * @param {string} params.icon
* @param {string} params.label * @param {string} params.label
* @param {string} params.type * @param {'symbol' | 'image'} params.type
* @param {string} params.url * @param {string} params.url
* @param {boolean | undefined} params.isExternal * @param {boolean | undefined} params.isExternal
*/ */