[JENKINS-71744] Fix context menu (#8322)

[JENKINS-71744] fix context menu
This commit is contained in:
Markus Winter 2023-08-05 12:43:28 +02:00 committed by GitHub
parent eb96b8e07b
commit a53112d63f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -79,13 +79,13 @@ public class ManageJenkinsAction implements RootAction, StaplerFallback, ModelOb
* menu. * menu.
*/ */
@Restricted(NoExternalUse.class) @Restricted(NoExternalUse.class)
public void addContextMenuItem(ContextMenu menu, String url, String icon, String iconXml, String text, boolean post, boolean requiresConfirmation, Badge badge) { public void addContextMenuItem(ContextMenu menu, String url, String icon, String iconXml, String text, boolean post, boolean requiresConfirmation, Badge badge, String message) {
if (Stapler.getCurrentRequest().findAncestorObject(this.getClass()) != null || !Util.isSafeToRedirectTo(url)) { if (Stapler.getCurrentRequest().findAncestorObject(this.getClass()) != null || !Util.isSafeToRedirectTo(url)) {
// Default behavior if the URL is absolute or scheme-relative, or the current object is an ancestor (i.e. would resolve correctly) // Default behavior if the URL is absolute or scheme-relative, or the current object is an ancestor (i.e. would resolve correctly)
menu.add(url, icon, iconXml, text, post, requiresConfirmation, badge); menu.add(url, icon, iconXml, text, post, requiresConfirmation, badge, message);
return; return;
} }
// If neither is the case, rewrite the relative URL to point to inside the /manage/ URL space // If neither is the case, rewrite the relative URL to point to inside the /manage/ URL space
menu.add("manage/" + url, icon, iconXml, text, post, requiresConfirmation, badge); menu.add("manage/" + url, icon, iconXml, text, post, requiresConfirmation, badge, message);
} }
} }