| author | akozak | 2011-11-23 10:23:28 (EST) |
|---|---|---|
| committer | Winston Prakash | 2011-12-01 20:47:14 (EST) |
| commit | 2fed4723cfa327eb18458e20901bdbde43d31f8d (patch) (side-by-side diff) | |
| tree | be3cea6cb0795ca5a162d0fcf884206669f9874f | |
| parent | 2aacc1883050fb7ed94fa5bddcecaddedd8a8319 (diff) | |
| download | org.eclipse.hudson.core-2fed4723cfa327eb18458e20901bdbde43d31f8d.zip org.eclipse.hudson.core-2fed4723cfa327eb18458e20901bdbde43d31f8d.tar.gz org.eclipse.hudson.core-2fed4723cfa327eb18458e20901bdbde43d31f8d.tar.bz2 | |
Unified checkbox names in order to match property names.
Signed-off-by: Winston Prakash <winston.prakash@gmail.com>
5 files changed, 22 insertions, 11 deletions
diff --git a/hudson-core/src/main/java/hudson/model/AbstractProject.java b/hudson-core/src/main/java/hudson/model/AbstractProject.java index 8401848..75a08d9 100644 --- a/hudson-core/src/main/java/hudson/model/AbstractProject.java +++ b/hudson-core/src/main/java/hudson/model/AbstractProject.java @@ -133,7 +133,8 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A public static final String JDK_PROPERTY_NAME = "jdk"; public static final String PROPERTY_NAME_SEPARATOR = ";"; public static final String SCM_PROPERTY_NAME = "scm"; - + public static final String HAS_QUIET_PERIOD_PROPERTY_NAME = "hasQuietPeriod"; + public static final String HAS_SCM_CHECKOUT_RETRY_COUNT_PROPERTY_NAME = "hasScmCheckoutRetryCount"; /** * {@link SCM} associated with the project. @@ -1902,9 +1903,9 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A makeDisabled(null != req.getParameter("disable")); setCascadingProjectName(StringUtils.trimToNull(req.getParameter("cascadingProjectName"))); setJDK(req.getParameter("jdk"), false); - setQuietPeriod(null != req.getParameter("hasCustomQuietPeriod") ? req.getParameter("quiet_period") : null, + setQuietPeriod(null != req.getParameter(HAS_QUIET_PERIOD_PROPERTY_NAME) ? req.getParameter("quiet_period") : null, false); - setScmCheckoutRetryCount(null != req.getParameter("hasCustomScmCheckoutRetryCount") + setScmCheckoutRetryCount(null != req.getParameter(HAS_SCM_CHECKOUT_RETRY_COUNT_PROPERTY_NAME) ? req.getParameter("scmCheckoutRetryCount") : null, false); setBlockBuildWhenDownstreamBuilding(null != req.getParameter("blockBuildWhenDownstreamBuilding"), false); setBlockBuildWhenUpstreamBuilding(null != req.getParameter("blockBuildWhenUpstreamBuilding"), false); diff --git a/hudson-core/src/main/java/hudson/model/Job.java b/hudson-core/src/main/java/hudson/model/Job.java index a5e6e5a..f82072c 100644 --- a/hudson-core/src/main/java/hudson/model/Job.java +++ b/hudson-core/src/main/java/hudson/model/Job.java @@ -121,6 +121,7 @@ import static javax.servlet.http.HttpServletResponse.SC_NO_CONTENT; public abstract class Job<JobT extends Job<JobT, RunT>, RunT extends Run<JobT, RunT>> extends AbstractItem implements ExtensionPoint, StaplerOverridable, IJob { private static transient final String HUDSON_BUILDS_PROPERTY_KEY = "HUDSON_BUILDS"; + private static transient final String PROJECT_PROPERTY_KEY_PREFIX = "has"; public static final String LOG_ROTATOR_PROPERTY_NAME = "logRotator"; @@ -1444,6 +1445,13 @@ public abstract class Job<JobT extends Job<JobT, RunT>, RunT extends Run<JobT, R public synchronized void doModifyCascadingProperty(@QueryParameter(fixEmpty = true) String propertyName) { if (null != propertyName) { + if (StringUtils.startsWith(propertyName, PROJECT_PROPERTY_KEY_PREFIX)) { + propertyName = StringUtils.substring(propertyName, 3); + propertyName = new StringBuilder(propertyName.length()) + .append(Character.toLowerCase((propertyName.charAt(0)))) + .append(propertyName.substring(1)) + .toString(); + } IProjectProperty property = getProperty(propertyName); if (null != property) { property.setModified(true); diff --git a/hudson-core/src/main/resources/lib/hudson/project/config-quietPeriod.jelly b/hudson-core/src/main/resources/lib/hudson/project/config-quietPeriod.jelly index 3c57949..29a449d 100644 --- a/hudson-core/src/main/resources/lib/hudson/project/config-quietPeriod.jelly +++ b/hudson-core/src/main/resources/lib/hudson/project/config-quietPeriod.jelly @@ -19,7 +19,7 @@ <j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form"> <j:set var="quietPeriodProperty" value="${it.getIntegerProperty(it.QUIET_PERIOD_PROPERTY_NAME)}"/> <j:set var="quietPeriod" value="${quietPeriodProperty.getValue()}"/> - <f:optionalBlock name="hasCustomQuietPeriod" title="${%Quiet period}" + <f:optionalBlock name="hasQuietPeriod" title="${%Quiet period}" checked="${quietPeriod!=null and quietPeriod!=quietPeriodProperty.getDefaultValue()}" isPropertyOverridden="${quietPeriodProperty.isOverridden()}" resetUrl="${jobUrl}/resetProjectProperty?propertyName=${it.QUIET_PERIOD_PROPERTY_NAME}" diff --git a/hudson-core/src/main/resources/lib/hudson/project/config-retryCount.jelly b/hudson-core/src/main/resources/lib/hudson/project/config-retryCount.jelly index cd593df..99c81f0 100644 --- a/hudson-core/src/main/resources/lib/hudson/project/config-retryCount.jelly +++ b/hudson-core/src/main/resources/lib/hudson/project/config-retryCount.jelly @@ -19,13 +19,13 @@ <j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form"> <j:set var="scmCheckoutRetryCountProperty" value="${it.getIntegerProperty(it.SCM_CHECKOUT_RETRY_COUNT_PROPERTY_NAME)}"/> <j:set var="scmCheckoutRetryCount" value="${scmCheckoutRetryCountProperty.getValue()}"/> - <f:optionalBlock name="hasCustomScmCheckoutRetryCount" title="${%Retry Count}" + <f:optionalBlock name="hasScmCheckoutRetryCount" title="${%Retry Count}" checked="${scmCheckoutRetryCount!=null and scmCheckoutRetryCount!=scmCheckoutRetryCountProperty.getDefaultValue()}" isPropertyOverridden="${scmCheckoutRetryCountProperty.isOverridden()}" resetUrl="${jobUrl}/resetProjectProperty?propertyName=${it.SCM_CHECKOUT_RETRY_COUNT_PROPERTY_NAME}" help="/help/project-config/scmCheckoutRetryCount.html"> - <f:entry title="${%SCM checkout retry count}" isPropertyOverridden="${scmCheckoutRetryCountProperty.isOverridden()}"> + <f:entry title="${%SCM checkout retry count}" isPropertyOverridden="${scmCheckoutRetryCountProperty.isOverridden()}"> <f:textbox name="scmCheckoutRetryCount" value="${scmCheckoutRetryCount}"/> </f:entry> </f:optionalBlock> -</j:jelly> +</j:jelly>
\ No newline at end of file diff --git a/hudson-war/src/main/webapp/scripts/cascading.js b/hudson-war/src/main/webapp/scripts/cascading.js index 43c61d2..be0d8db 100644 --- a/hudson-war/src/main/webapp/scripts/cascading.js +++ b/hudson-war/src/main/webapp/scripts/cascading.js @@ -59,10 +59,12 @@ function onProjectPropertyChanged() { var childRef = jQuery(this).parents('tr').attr('nameref'); cascadingProperty = jQuery('#'+childRef).attr('name'); } - var jobUrl = getJobUrl()+'/modifyCascadingProperty?propertyName='+cascadingProperty; - new Ajax.Request(jobUrl, { - method : 'get' - }); + if(cascadingProperty !== undefined){ + var jobUrl = getJobUrl()+'/modifyCascadingProperty?propertyName='+cascadingProperty; + new Ajax.Request(jobUrl, { + method : 'get' + }); + } }); } |

