Parcourir la source

HUE-4116 [editor] Avoid JS error on coordinator save

Enrico Berti il y a 9 ans
Parent
commit
7f5040c

+ 4 - 3
apps/oozie/src/oozie/static/oozie/js/coordinator-editor.ko.js

@@ -234,10 +234,11 @@ var CoordinatorEditorViewModel = function (coordinator_json, credentials_json, w
         if (data.status == 0) {
           self.coordinator.id(data.id);
           self.coordinator.tracker().markCurrentStateAsClean();
-          if (cb) {
+          if (typeof cb === 'function') {
             cb(data);
-          } else {
-        	$(document).trigger("info", data.message);
+          }
+          else {
+        	  $(document).trigger("info", data.message);
           }
           if (window.location.search.indexOf("coordinator") == -1) {
             window.location.hash = '#coordinator=' + data.id;

+ 2 - 2
apps/oozie/src/oozie/templates/editor2/common_scheduler.inc.mako

@@ -231,7 +231,7 @@ from django.utils.translation import ugettext as _
               %endif
 
               <span data-bind="visible: $root.isEditing">
-                <input type="text" class="filechooser-input dataset-input" data-bind="value: dataset_variable, filechooser: dataset_variable, attr: { placeholder:
+                <input type="text" class="filechooser-input dataset-input" data-bind="value: dataset_variable, valueUpdate:'afterkeydown', filechooser: dataset_variable, attr: { placeholder:
                   dataset_type() == 'input_path' ? '${ _ko("Required data path dependency to start the worklow") }' :
                   dataset_type() == 'output_path' ? '${ _ko("Data path created by the workflow") }' :
                   'e.g. 1, 2, 3, /data/logs, ${"$"}{coord:nominalTime()}' },
@@ -385,7 +385,7 @@ from django.utils.translation import ugettext as _
 
 </%def>
 
-<%def name="import_modals()">\
+<%def name="import_modals()">
 
 <div id="chooseWorkflowDemiModal" class="demi-modal fade" data-backdrop="false">
   <div class="modal-body">