Browse Source

HUE-2734 [oozie] Refresh arrows of decision nodes

Fixed also the display of the node
Enrico Berti 10 years ago
parent
commit
860ed80

+ 5 - 4
apps/oozie/src/oozie/templates/editor2/common_workflow.mako

@@ -298,19 +298,20 @@
       </a>
       </a>
       <ul data-bind="foreach: children" class="unstyled">
       <ul data-bind="foreach: children" class="unstyled">
         <li>
         <li>
-          ${ _('If') } <input type="text" data-bind="value: $data['condition']" />
+          ${ _('If') } <input type="text" class="input-medium" data-bind="value: $data['condition']" />
           ${ _('go to') }
           ${ _('go to') }
           <select data-bind="options: $root.workflow.nodeIds,
           <select data-bind="options: $root.workflow.nodeIds,
                      optionsText: function(item) {return $root.workflow.nodeNamesMapping()[item]; },
                      optionsText: function(item) {return $root.workflow.nodeNamesMapping()[item]; },
-                     value: $data['to']
+                     value: $data['to'],
+                     event: { change: function(){ $(document).trigger('drawArrows') } }
                      ">
                      ">
           </select>
           </select>
-          <a class="pointer" data-bind="click: function(){ $parent.children.remove(this);}">
+          <a class="pointer" data-bind="click: function(){ $parent.children.remove(this); $(document).trigger('drawArrows')}">
             <i class="fa fa-minus"></i>
             <i class="fa fa-minus"></i>
           </a>
           </a>
         </li>
         </li>
       </ul>
       </ul>
-      <a class="pointer" data-bind="click: function(){ children.push({'to': '', 'condition': '${'${'} 1 gt 0 }'});}">
+      <a class="pointer" data-bind="click: function(){ children.push({'to': '', 'condition': '${'${'} 1 gt 0 }'}); $(document).trigger('drawArrows')}">
         ${ _('Jump to another node') } <i class="fa fa-plus"></i>
         ${ _('Jump to another node') } <i class="fa fa-plus"></i>
       </a>
       </a>
     </div>
     </div>

+ 2 - 2
apps/oozie/src/oozie/templates/editor2/workflow_editor.mako

@@ -565,7 +565,7 @@ ${ dashboard.import_bindings() }
       var $el = $(this);
       var $el = $(this);
       if (!$el.is("a") && !$el.is("input") && !$el.is("i") && !$el.is("button")) {
       if (!$el.is("a") && !$el.is("input") && !$el.is("i") && !$el.is("button")) {
         var w = ko.dataFor($el.parents(".card-widget")[0]);
         var w = ko.dataFor($el.parents(".card-widget")[0]);
-        if (!w.oozieExpanded() && !w.ooziePropertiesExpanded() && ["start-widget", "end-widget", "fork-widget", "join-widget", "decision-widget"].indexOf(w.widgetType()) == -1 && $el.width() < 500){
+        if (!w.oozieExpanded() && !w.ooziePropertiesExpanded() && ["start-widget", "end-widget", "fork-widget", "join-widget"].indexOf(w.widgetType()) == -1 && $el.width() < 500){
           $el.addClass("zoom-in");
           $el.addClass("zoom-in");
         }
         }
       }
       }
@@ -576,7 +576,7 @@ ${ dashboard.import_bindings() }
   var lastExpandedWidget = null;
   var lastExpandedWidget = null;
   function setLastExpandedWidget(widget) {
   function setLastExpandedWidget(widget) {
     lastExpandedWidget = widget;
     lastExpandedWidget = widget;
-    if (! widget.oozieExpanded() && ["start-widget", "end-widget", "fork-widget", "join-widget", "decision-widget"].indexOf(widget.widgetType()) == -1){
+    if (! widget.oozieExpanded() && ["start-widget", "end-widget", "fork-widget", "join-widget"].indexOf(widget.widgetType()) == -1){
       var _el = $("#wdg_" + widget.id());
       var _el = $("#wdg_" + widget.id());
       _el.find(".widget-main-section").removeClass("zoom-in");
       _el.find(".widget-main-section").removeClass("zoom-in");
       if (_el.width() < 500){
       if (_el.width() < 500){