فهرست منبع

[oozie] Fix Coordinator SLA edition

Workflow editor expects a list of dicts of observables.
Coordinator used to only have an observable array of dicts.

If we want to re-use the same utils/forms we need a more complex SLA object for Coordinator.
Romain Rigaux 12 سال پیش
والد
کامیت
c5e2440

+ 1 - 1
apps/oozie/src/oozie/templates/editor/coordinator_properties.mako

@@ -100,7 +100,7 @@
                   .appendTo(form);
           $("<input>").attr("type", "hidden")
                   .attr("name", "sla")
-                  .attr("value", ko.utils.stringifyJson(window.slaModel.sla))
+                  .attr("value", ko.toJSON(window.slaModel.sla))
                   .appendTo(form);
 
           form.submit();

+ 2 - 2
apps/oozie/src/oozie/templates/editor/edit_coordinator.mako

@@ -44,6 +44,7 @@ ${ layout.menubar(section='coordinators') }
 </style>
 
 <script src="/static/ext/js/knockout-min.js" type="text/javascript" charset="utf-8"></script>
+<script src="/static/ext/js/knockout.mapping-2.3.2.js" type="text/javascript" charset="utf-8"></script>
 <script src="/static/ext/js/routie-0.3.0.min.js" type="text/javascript" charset="utf-8"></script>
 
 
@@ -440,7 +441,6 @@ ${ layout.menubar(section='coordinators') }
 <form class="form-horizontal" id="edit-dataset-form"></form>
 
 
-
 % if coordinator.id:
   <div class="modal hide" id="edit-dataset-modal" style="z-index:1500;width:850px"></div>
 
@@ -601,7 +601,7 @@ ${ layout.menubar(section='coordinators') }
 
       var slaModel = function() {
         var self = this;
-        self.sla = ko.observableArray(${ coordinator.sla_jsescaped | n,unicode });
+        self.sla = ko.mapping.fromJS(${ coordinator.sla_jsescaped | n,unicode });
       };
 
       window.slaModel = new slaModel();