[JENKINS-68137] Enable custom icon symbols for plugins (#6395)

Co-authored-by: Ullrich Hafner <ullrich.hafner@gmail.com>
Co-authored-by: Tim Jacomb <timjacomb1+github@gmail.com>
This commit is contained in:
authored and GitHub committed 2022-03-28 21:52:43 -07:00
1 parent 2716b07124
commit 04887f08ce
8 files changed
+87 -15

No files matched your search

+20
View File
@@ -2320,6 +2320,26 @@ public class Functions {
return iconMetadata;
}
@Restricted(NoExternalUse.class)
public static String extractPluginNameFromIconSrc(String iconSrc) {
if (iconSrc == null) {
return "";
}
if (!iconSrc.contains("plugin-")) {
return "";
}
String[] arr = iconSrc.split(" ");
for (String element : arr) {
if (element.startsWith("plugin-")) {
return element.replace("plugin-", "");
}
}
return "";
}
@Restricted(NoExternalUse.class)
public static String tryGetIconPath(String iconGuess, JellyContext context) {
if (iconGuess == null) {