mirror of https://github.com/jenkinsci/jenkins.git
[JENKINS-71744] Fix context menu (#8322)
[JENKINS-71744] fix context menu
This commit is contained in:
parent
eb96b8e07b
commit
a53112d63f
|
@ -79,13 +79,13 @@ public class ManageJenkinsAction implements RootAction, StaplerFallback, ModelOb
|
|||
* menu.
|
||||
*/
|
||||
@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)) {
|
||||
// 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;
|
||||
}
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue