diff --git a/changelog.html b/changelog.html index f16432cb055432a5b42506c495cf5e355324aba1..b31454c907eaae37cedb98fbe5eb3b359c35b9c9 100644 --- a/changelog.html +++ b/changelog.html @@ -58,7 +58,9 @@ Upcoming changes
  • Fixed: Human readable file size method returns ",00" for files with byte length 0 (issue 16630) - +
  • + “Build” from job context menu produced a confusing warning page. + (issue 16844) diff --git a/core/src/main/java/jenkins/model/ModelObjectWithContextMenu.java b/core/src/main/java/jenkins/model/ModelObjectWithContextMenu.java index 1f501f7746d5d4d30a1c55765ed2d1b93f694801..598cd40b20a65e8926af04395633a0ff2e330eea 100644 --- a/core/src/main/java/jenkins/model/ModelObjectWithContextMenu.java +++ b/core/src/main/java/jenkins/model/ModelObjectWithContextMenu.java @@ -95,6 +95,16 @@ public interface ModelObjectWithContextMenu extends ModelObject { return this; } + /** @since 1.504 */ + public ContextMenu add(String url, String icon, String text, boolean post) { + if (text != null && icon != null && url != null) { + MenuItem item = new MenuItem(url,icon,text); + item.post = post; + items.add(item); + } + return this; + } + /** * Default implementation of the context menu generation. * @@ -167,6 +177,12 @@ public interface ModelObjectWithContextMenu extends ModelObject { @Exported public String icon; + /** + * True to make a POST request rather than GET. + * @since 1.504 + */ + @Exported public boolean post; + /** * If this is a submenu, definition of subitems. */ diff --git a/core/src/main/resources/hudson/model/AbstractProject/sidepanel.jelly b/core/src/main/resources/hudson/model/AbstractProject/sidepanel.jelly index defffae8c1fa0902ed2a47caf1c35fba9d8b0426..4cc0c0ad2747f2bc2dfa9de44e1d99de55b11bc5 100644 --- a/core/src/main/resources/hudson/model/AbstractProject/sidepanel.jelly +++ b/core/src/main/resources/hudson/model/AbstractProject/sidepanel.jelly @@ -46,7 +46,7 @@ THE SOFTWARE. + onclick="${it.parameterized?null:'return build(this)'}" post="true" permission="${it.BUILD}"/>