diff --git a/rundeckapp/grails-app/assets/javascripts/menu/joboptions.js b/rundeckapp/grails-app/assets/javascripts/menu/joboptions.js index b98c2bb500c..8fc41f80d83 100644 --- a/rundeckapp/grails-app/assets/javascripts/menu/joboptions.js +++ b/rundeckapp/grails-app/assets/javascripts/menu/joboptions.js @@ -58,6 +58,7 @@ function Option(data) { self.descriptionHtml = ko.observable(data.descriptionHtml); self.loading = ko.observable(false); self.required = ko.observable(data.required ? true : false); + self.hidden = ko.observable(data.hidden ? true : false); self.enforced = ko.observable(data.enforced ? true : false); self.isDate = ko.observable(data.isDate ? true : false); self.dateFormat = ko.observable(data.dateFormat); diff --git a/rundeckapp/grails-app/controllers/rundeck/controllers/EditOptsController.groovy b/rundeckapp/grails-app/controllers/rundeck/controllers/EditOptsController.groovy index 3f0d8182a3f..1301ca2278f 100644 --- a/rundeckapp/grails-app/controllers/rundeck/controllers/EditOptsController.groovy +++ b/rundeckapp/grails-app/controllers/rundeck/controllers/EditOptsController.groovy @@ -16,11 +16,12 @@ package rundeck.controllers -import java.util.regex.Pattern -import java.util.regex.PatternSyntaxException import rundeck.Option import rundeck.ScheduledExecution +import java.util.regex.Pattern +import java.util.regex.PatternSyntaxException + /** * Controller for manipulating the session-stored set of Options during job edit */ @@ -498,6 +499,11 @@ class EditOptsController { opt.errors.rejectValue('required', 'option.file.required.message') return result } + + if (opt.hidden && !opt.defaultValue && !opt.defaultStoragePath) { + opt.errors.rejectValue('hidden', 'option.hidden.notallowed.message') + return result + } if (opt.enforced && (opt.values || opt.valuesList) && opt.defaultValue) { opt.convertValuesList() if(!opt.multivalued && !opt.values.contains(opt.defaultValue)) { diff --git a/rundeckapp/grails-app/domain/rundeck/Option.groovy b/rundeckapp/grails-app/domain/rundeck/Option.groovy index 0050637c287..4c0cfa7ffe6 100644 --- a/rundeckapp/grails-app/domain/rundeck/Option.groovy +++ b/rundeckapp/grails-app/domain/rundeck/Option.groovy @@ -71,6 +71,7 @@ public class Option implements Comparable{ Boolean multivalueAllSelected String optionValuesPluginType List valuesFromPlugin + Boolean hidden static belongsTo=[scheduledExecution:ScheduledExecution] static transients = ['valuesList', 'realValuesUrl', 'configMap', 'typeFile','valuesFromPlugin'] @@ -99,6 +100,7 @@ public class Option implements Comparable{ multivalueAllSelected(nullable: true) label(nullable: true) optionValuesPluginType(nullable: true) + hidden(nullable: true) } @@ -198,6 +200,9 @@ public class Option implements Comparable{ if(optionValuesPluginType) { map.optionValuesPluginType = optionValuesPluginType } + if(hidden){ + map.hidden = hidden + } return map } @@ -261,6 +266,9 @@ public class Option implements Comparable{ if(data.optionValuesPluginType) { opt.optionValuesPluginType = data.optionValuesPluginType } + if(data.hidden){ + opt.hidden = data.hidden + } return opt } /** @@ -349,7 +357,7 @@ public class Option implements Comparable{ 'dateFormat', 'values', 'valuesList', 'valuesUrl', 'valuesUrlLong', 'regex', 'multivalued', 'multivalueAllSelected', 'label', 'delimiter', 'optionValuesPluginType', - 'secureInput', 'secureExposed', 'optionType', 'configData']. + 'secureInput', 'secureExposed', 'optionType', 'configData', 'hidden']. each { k -> opt[k]=this[k] } @@ -381,7 +389,7 @@ public class Option implements Comparable{ ', optionValuesPluginType=' + optionValuesPluginType + '\'' + ", optionType='" + optionType + '\'' + ", configData='" + configData + '\'' + - + ", hidden='" + '\'' + '}' ; } diff --git a/rundeckapp/grails-app/i18n/messages.properties b/rundeckapp/grails-app/i18n/messages.properties index 323cbff2509..d2cba74b4ab 100644 --- a/rundeckapp/grails-app/i18n/messages.properties +++ b/rundeckapp/grails-app/i18n/messages.properties @@ -175,6 +175,7 @@ option.defaultValue.notallowed.message=Default Value was not in the allowed valu option.defaultValue.multivalued.notallowed.message=Default Value contains a string that was not in the allowed values list, and values are enforced: "{0}". Note: whitespace is significant. option.defaultValue.required.message=Specify a Default Value for Required options when the Job is scheduled. option.file.required.message=File option type cannot be Required when the Job is scheduled. +option.hidden.notallowed.message=Hidden options must have a default value. option.file.config.invalid.message=File option type config is not valid: {0} option.regex.invalid.message=Invalid Regular Expression: {0} option.values.regexmismatch.message=Allowed value "{0}" does not match the regex: {1} @@ -570,6 +571,8 @@ select.jobs.to.delete=Select Jobs to delete. project.name.can.only.contain.these.characters=Project name can only contain these characters\: [a-zA-Z0-9_-+.] and cannot start with a '.'. Option.required.label=Required Option.required.description=Require this option to have a non-blank value when running the Job +Option.hidden.label=Should be hidden +Option.hidden.description=Should be hidden from job run page execution=Execution plural.format={1} plural.count.format={0} {1} diff --git a/rundeckapp/grails-app/views/framework/_jobOptionsKO.gsp b/rundeckapp/grails-app/views/framework/_jobOptionsKO.gsp index a1cdd0c910e..de73c8d39b2 100644 --- a/rundeckapp/grails-app/views/framework/_jobOptionsKO.gsp +++ b/rundeckapp/grails-app/views/framework/_jobOptionsKO.gsp @@ -83,7 +83,8 @@ used by _editOptions.gsp template selectedoptsmap && null != selectedoptsmap[optName] ? selectedoptsmap[optName] : (optionSelect.defaultValue ?: ''), - valuesFromPlugin : optionSelect.valuesFromPlugin + valuesFromPlugin : optionSelect.valuesFromPlugin, + hidden : !!optionSelect.hidden ] } ]}" id="jobOptionData"/> @@ -102,48 +103,50 @@ data for configuring remote option cascading/dependencies
-
+
- -
+
- + -
+
-
- - - +
+ + + + - -
+
-
- %{----}% - -
+
+ %{----}% + +
-
-

+
+

+
diff --git a/rundeckapp/grails-app/views/scheduledExecution/_optEdit.gsp b/rundeckapp/grails-app/views/scheduledExecution/_optEdit.gsp index e8ecaa36c6f..091b094c93b 100644 --- a/rundeckapp/grails-app/views/scheduledExecution/_optEdit.gsp +++ b/rundeckapp/grails-app/views/scheduledExecution/_optEdit.gsp @@ -536,6 +536,26 @@
+
+ +
+
+ + +
+
+ + +
+
+ +
+
+