From 670236832fa2c21517574ca6bed65e8684dd20e9 Mon Sep 17 00:00:00 2001 From: Greg Schueler Date: Wed, 24 Jul 2013 16:10:47 -0400 Subject: [PATCH] Improve remote option warning messages and behavior for #467 * update text when remote value json is empty * fix detection after form submit of missing values * fix auto reload of remote values after form submit --- rundeckapp/grails-app/i18n/messages.properties | 2 ++ .../views/framework/_commandOptions.gsp | 17 ++++++++++------- .../views/framework/_remoteOptionValuesJS.gsp | 2 +- rundeckapp/web-app/css/main.css | 4 ++++ 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/rundeckapp/grails-app/i18n/messages.properties b/rundeckapp/grails-app/i18n/messages.properties index bc821375b2f..b97e6c58b15 100644 --- a/rundeckapp/grails-app/i18n/messages.properties +++ b/rundeckapp/grails-app/i18n/messages.properties @@ -403,3 +403,5 @@ project.archive.import.jobUUIDBehavior.preserve.label=Retain UUIDs project.archive.import.jobUUIDBehavior.remove.label=Generate new UUIDs project.archive.import.jobUUIDBehavior.remove.description=A new UUID will be generated for each Job created. scheduledExecution.uuid.unique=Cannot create a Job with UUID {2}: a Job already exists with this UUID. Change the UUID or delete the other Job. +option.value.required=required +option.remote.dependency.emptyresult=No values to choose from. Make sure to select a value for the following input options\: diff --git a/rundeckapp/grails-app/views/framework/_commandOptions.gsp b/rundeckapp/grails-app/views/framework/_commandOptions.gsp index 05405bb134b..d576bd924e6 100644 --- a/rundeckapp/grails-app/views/framework/_commandOptions.gsp +++ b/rundeckapp/grails-app/views/framework/_commandOptions.gsp @@ -35,14 +35,14 @@ used by _editOptions.gsp template %{--determine if option has all dependencies met--}% - + - Select a value for these options: ${optiondependencies[optName].join(', ').encodeAsHTML()} + ${optiondependencies[optName].join(', ').encodeAsHTML()} @@ -60,11 +60,14 @@ used by _editOptions.gsp template - Required Option - ${hasError.encodeAsHTML()} + Required Option + ${hasError.encodeAsHTML()} + + + @@ -92,7 +95,7 @@ used by _editOptions.gsp template + value="${!optiondependencies[optName] || selectedoptsmap && optiondependencies[optName].every {selectedoptsmap[it]}}"/> remoteOptions.addOptionDependencies("${optName.encodeAsJavaScript()}", ${optiondependencies[optName] as JSON}); @@ -101,7 +104,7 @@ used by _editOptions.gsp template remoteOptions.addOptionDeps("${optName.encodeAsJavaScript()}", ${dependentoptions[optName] as JSON}); - + <%-- Will be a drop down list, so trigger change automatically. --%> remoteOptions.setOptionAutoReload("${optName.encodeAsJavaScript()}",true); diff --git a/rundeckapp/grails-app/views/framework/_remoteOptionValuesJS.gsp b/rundeckapp/grails-app/views/framework/_remoteOptionValuesJS.gsp index 923f78a1a65..4761cd13d0f 100644 --- a/rundeckapp/grails-app/views/framework/_remoteOptionValuesJS.gsp +++ b/rundeckapp/grails-app/views/framework/_remoteOptionValuesJS.gsp @@ -268,7 +268,7 @@ var RemoteOptionControl = Class.create({ elem.innerHTML = ""; //insert note var note = new Element('div',{class:'info note emptyMessage'}); - note.appendChild(document.createTextNode('Select a value for these options: ')); + note.appendChild(document.createTextNode('No values to choose from. Make sure to set a value for the following input options: ')); if(this.dependencies[name]){ note.appendChild(document.createTextNode(this.dependencies[name].join(', '))); } diff --git a/rundeckapp/web-app/css/main.css b/rundeckapp/web-app/css/main.css index 9b155dd285c..72461762203 100644 --- a/rundeckapp/web-app/css/main.css +++ b/rundeckapp/web-app/css/main.css @@ -423,6 +423,10 @@ h1 { padding-right:4px; background:none; } +span.reqwarning{ + font-style: italic; + color: orange; +} .body { padding: 25px;