Jelajahi Sumber

[oozie] Put example conditions in the decision node branches

Romain Rigaux 11 tahun lalu
induk
melakukan
56c9bb3

+ 4 - 4
apps/oozie/src/oozie/templates/editor/coordinator_editor.mako

@@ -240,6 +240,10 @@ ${ commonheader(_("Coordinator Editor"), "Oozie", user) | n,unicode }
               
               <input type="text" data-bind="value: dataset_variable, filechooser: dataset_variable" style="margin-bottom:0; width: 300px" class="filechooser-input" />
 
+              <a href="#" data-bind="click: function(){ $root.coordinator.variables.remove(this); }, visible: $root.isEditing">
+                <i class="fa fa-minus"></i>
+              </a>
+
               <!-- ko if: dataset_type() == 'input_path' || dataset_type() == 'output_path' -->
 
 
@@ -254,10 +258,6 @@ ${ commonheader(_("Coordinator Editor"), "Oozie", user) | n,unicode }
                 <i class="fa fa-sliders"></i>
               </a>
 
-              <a href="#" data-bind="click: function(){ $root.coordinator.variables.remove(this); }, visible: $root.isEditing">
-                <i class="fa fa-minus"></i>
-              </a>
-
               <div data-bind="visible: show_advanced" style="padding: 20px">
 
                 <form class="form-horizontal">

+ 7 - 4
apps/oozie/src/oozie/templates/editor/workflow_editor.mako

@@ -197,10 +197,12 @@ ${ commonheader(_("Workflow Editor"), "Oozie", user, "40px") | n,unicode }
       <span data-bind="editable: $root.workflow.properties.description, editableOptions: {enabled: $root.isEditing(), placement: 'right', emptytext: '${_('Add a description...')}'}"></span>
     </div>
     
-    <div class="inline alert alert-warn" style="margin-left:200px" data-bind="visible: $root.workflow.properties.imported">
+    <!-- ko if: $root.workflow.properties.imported -->
+    <div class="inline alert alert-warn" style="margin-left:100px">
       ${ _('This workflow was imported from an old Hue version, save it to create a copy in the new format or') }
       <a data-bind="attr: { href: '/oozie/edit_workflow/' + $root.workflow.properties.wf1_id() }">${ _('open it in the old editor.') }</a>
-    </div>    
+    </div>
+    <!-- /ko -->
   </form>
 </div>
 
@@ -456,7 +458,8 @@ ${ commonheader(_("Workflow Editor"), "Oozie", user, "40px") | n,unicode }
 
     <div data-bind="visible: $root.isEditing" style="padding: 10px">
       <a class="custom-popover pull-right" href="javascript:void(0)" target="_blank" data-trigger="click" data-toggle="popover" data-placement="right" rel="popover" 
-        data-html="true" data-content="<strong>${ _('Examples of predicates:') }</strong><br/>${'${'} fs:fileSize(secondjobOutputDir) gt 10 * GB }
+        data-html="true" data-content="<strong>${ _('Examples of predicates:') }</strong><br/>
+                <br/>${'${'} fs:fileSize(secondjobOutputDir) gt 10 * GB }
                 <br/>
                 ${"${"} hadoop:counters('secondjob')[RECORDS][REDUCE_OUT] lt 1000000 }
                 <br/>
@@ -477,7 +480,7 @@ ${ commonheader(_("Workflow Editor"), "Oozie", user, "40px") | n,unicode }
           </a>
         </li>
       </ul>
-      <a class="pointer" data-bind="click: function(){ children.push({'to': '', 'condition': ''});}">
+      <a class="pointer" data-bind="click: function(){ children.push({'to': '', 'condition': '${'${'} 1 gt 0 }'});}">
         ${ _('Jump to another node') } <i class="fa fa-plus"></i>
       </a>
     </div>

+ 4 - 4
apps/oozie/static/js/workflow-editor.ko.js

@@ -339,8 +339,8 @@ var Workflow = function (vm, workflow) {
  
             var afterParentId = ko.mapping.toJS(newParentLink).to;
             var afterParent = self.getNodeById(afterParentId);
-            fork.children.push({'to': afterParentId, 'condition': ''});
-            fork.children.push({'to': node.id(), 'condition': ''});
+            fork.children.push({'to': afterParentId, 'condition': '${ 1 gt 0 }'});
+            fork.children.push({'to': node.id(), 'condition': '${ 1 gt 0 }'});
 
             newParentLink['to'] = fork.id();
 
@@ -361,7 +361,7 @@ var Workflow = function (vm, workflow) {
             node.set_link('to', join.id());
             node.set_link('error', '17c9c895-5a16-7443-bb81-f34b30b21548');
 
-            parent.children.push({'to': node.id(), 'condition': ''});
+            parent.children.push({'to': node.id(), 'condition': '${ 1 gt 0 }'});
           }
         } else {
           var parentWidget = vm.getWidgetPredecessor(node.id());
@@ -372,7 +372,7 @@ var Workflow = function (vm, workflow) {
           } else if (parentWidget.widgetType() == 'fork-widget') {
             var child = vm.getWidgetSuccessor(node.id());
             parent.remove_link('to', child.id());
-            parent.children.push({'to': node.id(), 'condition': ''});
+            parent.children.push({'to': node.id(), 'condition': '${ 1 gt 0 }'});
 
             node.set_link('to', child.id());
             node.set_link('error', '17c9c895-5a16-7443-bb81-f34b30b21548');