Repository: airavata-php-gateway
Updated Branches:
  refs/heads/develop 1811d7632 -> bcbdb4b92


AIRAVATA-2230 Auto load queue view when only 1 compute resource

When there are multiple compute resources available the first option
has value of empty string. Loading the queue view for the compute
resource id of empty string throws an error server side.  This code
change prevents that error from happening.


Project: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/commit/bcbdb4b9
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/bcbdb4b9
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/bcbdb4b9

Branch: refs/heads/develop
Commit: bcbdb4b9229a735f883dec3bee7f47fdff5c59fc
Parents: 1811d76
Author: Marcus Christie <[email protected]>
Authored: Wed Nov 16 14:22:18 2016 -0500
Committer: Marcus Christie <[email protected]>
Committed: Wed Nov 16 14:22:18 2016 -0500

----------------------------------------------------------------------
 app/views/experiment/create-complete.blade.php | 29 ++++++++++++---------
 1 file changed, 16 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/bcbdb4b9/app/views/experiment/create-complete.blade.php
----------------------------------------------------------------------
diff --git a/app/views/experiment/create-complete.blade.php 
b/app/views/experiment/create-complete.blade.php
index 7ae755a..a5bc94d 100755
--- a/app/views/experiment/create-complete.blade.php
+++ b/app/views/experiment/create-complete.blade.php
@@ -109,19 +109,22 @@
 
     //Selecting the first option as the default
     $( document ).ready(function() {
-        var crId = $("#compute-resource").val();
-        $(".loading-img ").removeClass("hide");
-        $.ajax({
-            url: '../experiment/getQueueView',
-            type: 'get',
-            data: {crId: crId},
-            success: function (data) {
-                $(".queue-view").html(data);
-                $(".loading-img ").addClass("hide");
-            },error : function(data){
-                $(".loading-img ").addClass("hide");
-            }
-        });
+        var $cr = $("#compute-resource");
+        var crId = $cr.val();
+        if ($cr.children("option").size() === 1 && crId !== "") {
+            $(".loading-img ").removeClass("hide");
+            $.ajax({
+                url: '../experiment/getQueueView',
+                type: 'get',
+                data: {crId: crId},
+                success: function (data) {
+                    $(".queue-view").html(data);
+                    $(".loading-img ").addClass("hide");
+                },error : function(data){
+                    $(".loading-img ").addClass("hide");
+                }
+            });
+        }
     });
 
     //Setting the file input view JS code

Reply via email to