From c9b878f4889659b889d03e24aa8e5cb6eb763b89 Mon Sep 17 00:00:00 2001 From: Daniel Beck Date: Mon, 2 Jan 2017 19:56:59 +0100 Subject: [PATCH] [FIX JENKINS-38175] Fix various ManagementLink related bugs - In the context menu, the 'post' flag was set iff 'requiresConfirmation' was set, even though they're independent (e.g. Prepare for shutdown requires the former but not the latter) - /manage screen: The icon (t:summary) does not support POST or confirmation links, but was set to not link only if no confirmation was required (i.e. POST links did not POST when the icon was clicked -- now the icon is not clickable as a workaround) - /manage screen: All links requiring confirmation did POST, which masked the fact that the 'Reload from disk' link wasn't set up to require POST (it was only broken in the context menu). Now, confirmation and POST are separate flags, and 'Reload from disk' link now requests POST. --- core/src/main/java/jenkins/management/ReloadLink.java | 6 +++++- core/src/main/resources/jenkins/model/Jenkins/manage.jelly | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/jenkins/management/ReloadLink.java b/core/src/main/java/jenkins/management/ReloadLink.java index 9159788379ea..59fabb8ba1bf 100644 --- a/core/src/main/java/jenkins/management/ReloadLink.java +++ b/core/src/main/java/jenkins/management/ReloadLink.java @@ -56,5 +56,9 @@ public String getUrlName() { @Override public boolean getRequiresConfirmation() { return true; } - + + @Override + public boolean getRequiresPOST() { + return true; + } } diff --git a/core/src/main/resources/jenkins/model/Jenkins/manage.jelly b/core/src/main/resources/jenkins/model/Jenkins/manage.jelly index 63684e446b6e..ff56ce0eca55 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/manage.jelly +++ b/core/src/main/resources/jenkins/model/Jenkins/manage.jelly @@ -32,15 +32,15 @@ THE SOFTWARE. - ${taskTags!=null and attrs.contextMenu!='false' ? taskTags.add(href,iconUrl,title,requiresConfirmation,requiresConfirmation) : null} + ${taskTags!=null and attrs.contextMenu!='false' ? taskTags.add(href,iconUrl,title,post,requiresConfirmation) : null} + href="${requiresConfirmation || post ? null : href}" iconOnly="true">