airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject airavata-php-gateway git commit: AIRAVATA-2266 : When tried to create tenant it asked to enter the auth key and the secret
Date Mon, 30 Jan 2017 18:51:07 GMT
Repository: airavata-php-gateway
Updated Branches:
  refs/heads/develop 4c47e5408 -> c4c63b78e


AIRAVATA-2266 : When tried to create tenant it asked to enter the auth key and the secret


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/c4c63b78
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/c4c63b78
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/c4c63b78

Branch: refs/heads/develop
Commit: c4c63b78e4c57b7b80e4082083b25cd8e2395282
Parents: 4c47e54
Author: scnakandala <supun.nakandala@gmail.com>
Authored: Mon Jan 30 13:51:02 2017 -0500
Committer: scnakandala <supun.nakandala@gmail.com>
Committed: Mon Jan 30 13:51:02 2017 -0500

----------------------------------------------------------------------
 app/views/admin/manage-gateway.blade.php | 70 ++++++++++++---------------
 1 file changed, 30 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/c4c63b78/app/views/admin/manage-gateway.blade.php
----------------------------------------------------------------------
diff --git a/app/views/admin/manage-gateway.blade.php b/app/views/admin/manage-gateway.blade.php
index 099bec8..795af43 100644
--- a/app/views/admin/manage-gateway.blade.php
+++ b/app/views/admin/manage-gateway.blade.php
@@ -638,52 +638,42 @@
           dataObj[updateGatewayData[i].name] = updateGatewayData[i].value;
         }
 
-        if( updateVal == "createTenant" &&
-            ( $.trim( dataObj['oauthClientId'] ) == "" || $.trim( dataObj['oauthClientSecret']
) == "") ){
-            $(".submit-actions").before("<div class='alert alert-danger fail-alert'>Tenant
creation requires Oauth Client Id and Oauth Client Secret fields to be filled.</div>");
-            $(".loading-gif").remove();
 
-        }
-        else
-        {
-            $.ajax({
-                url: "{{URL::to('/')}}/admin/update-gateway-request",
-                method: "GET",
-                data: updateGatewayData
-            }).done( function( data){
-                $(".loading-gif").remove();
-                if( data == -1 ){
-                    //errors only with -1
-                    if( updateVal == "createTenant"){
-                    $(".submit-actions").before("<div class='alert alert-danger fail-alert'>Tenant
creation has failed as Tenant with the same Domain name- airavata." + $(".gatewayAcronym").val()
+ " already exists in Identity Server. Please change Gateway Acronym and try again.");
-                    }
-                    else{
-                        $(".submit-actions").before("<div class='alert alert-danger fail-alert'>Error
updating Gateway. Please try again.");
-                    }
+        $.ajax({
+            url: "{{URL::to('/')}}/admin/update-gateway-request",
+            method: "GET",
+            data: updateGatewayData
+        }).done( function( data){
+            $(".loading-gif").remove();
+            if( data == -1 ){
+                //errors only with -1
+                if( updateVal == "createTenant"){
+                $(".submit-actions").before("<div class='alert alert-danger fail-alert'>Tenant
creation has failed as Tenant with the same Domain name- airavata." + $(".gatewayAcronym").val()
+ " already exists in Identity Server. Please change Gateway Acronym and try again.");
                 }
                 else{
-                    if( updateVal == "createTenant"){
-                        $(".submit-actions").before("<div class='alert alert-success success-alert'>Tenant
has been created with domain name- airavata." + $(".gatewayAcronym").val());
-                        $(".notCreatedGateway").addClass("hide");
-
-                        $(".createdGateway").removeClass("hide");
+                    $(".submit-actions").before("<div class='alert alert-danger fail-alert'>Error
updating Gateway. Please try again.");
+                }
+            }
+            else{
+                if( updateVal == "createTenant"){
+                    $(".submit-actions").before("<div class='alert alert-success success-alert'>Tenant
has been created with domain name- airavata." + $(".gatewayAcronym").val());
+                    $(".notCreatedGateway").addClass("hide");
 
-                    }
-                    else{
-                        $(".submit-actions").before("<div class='alert alert-success success-alert'>Gateway
has been updated successfully.");
-                    }
+                    $(".createdGateway").removeClass("hide");
 
-                    //refresh data next time if same popup is opened.
-                    var gatewayIdWithoutSpaces = dataObj['gateway_id'].replace(/\s+/g, '-');
-                    $("#view-" +  gatewayIdWithoutSpaces).data("gatewayobject", data);
-                    $("#view-" + gatewayIdWithoutSpaces ).parent().parent().find(".form-gatewayName").html(
dataObj['gatewayName']);
-                    $("#view-" + gatewayIdWithoutSpaces ).parent().parent().find(".form-gatewayURL").html(
dataObj['gatewayURL']);
                 }
-                //$(".onTenantComplete").removeClass("hide");
-                //$(".onTenantLoad").addClass("hide");
-                //$(".onTenantComplete").removeClass("hide");
-            });
-        }
+                else{
+                    $(".submit-actions").before("<div class='alert alert-success success-alert'>Gateway
has been updated successfully.");
+                }
+
+                //refresh data next time if same popup is opened.
+                var gatewayIdWithoutSpaces = dataObj['gateway_id'].replace(/\s+/g, '-');
+                $("#view-" +  gatewayIdWithoutSpaces).data("gatewayobject", data);
+                $("#view-" + gatewayIdWithoutSpaces ).parent().parent().find(".form-gatewayName").html(
dataObj['gatewayName']);
+                $("#view-" + gatewayIdWithoutSpaces ).parent().parent().find(".form-gatewayURL").html(
dataObj['gatewayURL']);
+            }
+        });
+
     });
 
     $(".gaStatuses option[value=REQUESTED]").prop("selected", true);


Mime
View raw message