Ver Fonte

HUE-7698 [oozie] Added warning when there is a space in the shell action

Romain Rigaux há 7 anos atrás
pai
commit
1d923f87cd

+ 1 - 1
apps/oozie/src/oozie/templates/editor2/common_workflow.mako

@@ -1707,7 +1707,7 @@
   <div class="row-fluid" data-bind="with: $root.workflow.getNodeById(id())" style="padding: 10px">
     <div data-bind="visible: $root.isEditing">
       <div data-bind="visible: ! $parent.ooziePropertiesExpanded()" class="nowrap">
-        <input type="text" data-bind="value: properties.shell_command" validate="nonempty"/>
+        <input type="text" data-bind="value: properties.shell_command" validate="nospace"/>
         <span data-bind='template: { name: "common-fs-link", data: {path: properties.shell_command(), with_label: false} }'></span>
 
         <div class="row-fluid">

+ 5 - 1
apps/oozie/src/oozie/templates/editor2/workflow_editor.mako

@@ -830,7 +830,11 @@ ${ utils.submit_popup_event() }
   function validateFields() {
     var _hasErrors = false;
     $("[validate]").each(function () {
-      if ($(this).attr("validate") == "nonempty" && $.trim($(this).val()) == "") {
+      if ($(this).attr("validate") == "nospace" && ($(this).val().indexOf(' ') >= 0 || $.trim($(this).val()) == "")) {
+        $(this).addClass("with-errors");
+        _hasErrors = true;
+      }
+      else if ($(this).attr("validate") == "nonempty" && $.trim($(this).val()) == "") {
         $(this).addClass("with-errors");
         _hasErrors = true;
       }