Fix for Bug 403: Install button does not work correctly first time if flow is edited... 02/5302/2
authordeepankar <deepankar.gupta@tcs.com>
Thu, 13 Feb 2014 08:55:34 +0000 (14:25 +0530)
committerDeepankar Gupta <deepankar.gupta@tcs.com>
Thu, 13 Feb 2014 11:05:46 +0000 (11:05 +0000)
Root Cause: Whenever user edits a flow entry, page.js file passes the value of installInHw as true always (line ). If the flow is not installed in the hardware, this reverts the value of installInHw from false to true causing this issue.

Fix: Changes Done:
1. In page.js file, On edit click button a new variable install is defined, which is assigned to the value of installInHw(true/false) in respect to a flow entry.
2. The variable install is passed to the edit function instead of passing the value as true always

Change-Id: I4e0df2a3061d165b8ab534dff44d4c196e7d9872
Signed-off-by: deepankar <deepankar.gupta@tcs.com>
opendaylight/web/flows/src/main/resources/js/page.js

index 094562fac07252b182e601774e79209d0a473e20..ab8301bf73dd21fb842aeee16b3a80dc647039a2 100644 (file)
@@ -457,7 +457,8 @@ one.f.flows = {
             var editButton = one.lib.dashlet.button.single("Edit Flow", one.f.flows.id.dashlet.edit, "btn-primary", "btn-mini");
             var $editButton = one.lib.dashlet.button.button(editButton);
             $editButton.click(function() {
-                var $modal = one.f.flows.modal.initialize(true);
+               var install = flow['flow']['installInHw'];
+                var $modal = one.f.flows.modal.initialize(true,install);
                 $modal.modal().on('shown',function(){
                     var $port = $('#'+one.f.flows.id.modal.form.port);
                     $('#'+one.f.flows.id.modal.form.nodes).trigger("change");
@@ -550,7 +551,7 @@ one.f.flows = {
                 return $p;
             }
         },
-        initialize : function(edit) {
+        initialize : function(edit,install) {
             var h3;
             if(edit) {
                 h3 = "Edit Flow Entry";
@@ -571,7 +572,7 @@ one.f.flows = {
             if (edit) {
                 // bind edit flow button
                 $('#'+one.f.flows.id.modal.edit, $modal).click(function() {
-                    one.f.flows.modal.save($modal, 'true', true);
+                    one.f.flows.modal.save($modal, install, true);
                 });
             } else {
                 // bind add flow button