You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by nd...@apache.org on 2016/09/16 05:51:48 UTC

[2/3] airavata-php-gateway git commit: AIRAVATA-2027 fix

AIRAVATA-2027 fix


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

Branch: refs/heads/develop
Commit: 73881fb64ad5d600f1231e80cb7d0bbc3ed5cc3e
Parents: daa20fb
Author: Nipurn Doshi <ni...@gmail.com>
Authored: Thu Sep 15 22:49:13 2016 -0700
Committer: Nipurn Doshi <ni...@gmail.com>
Committed: Thu Sep 15 22:49:13 2016 -0700

----------------------------------------------------------------------
 app/views/admin/manage-gateway.blade.php | 121 ++++++++++++++++----------
 1 file changed, 76 insertions(+), 45 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/73881fb6/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 dde9497..2e97abc 100644
--- a/app/views/admin/manage-gateway.blade.php
+++ b/app/views/admin/manage-gateway.blade.php
@@ -84,34 +84,47 @@
                                         <th>Gateway URL</th>
                                         <th>Project Details</th>
                                         <th>Project Abstract</th>
-                                        <th>Actions</th>
+                                        <th>
+                                            Status
+                                            <select class="gaStatuses">
+                                                <option value="ALL">ALL</option>
+                                                @foreach( $gatewayApprovalStatuses as $status)
+                                                <option value="{{$status}}">{{$status}}</option>
+                                                @endforeach
+                                            </select>
+                                        </th>
+                                        <th>
+                                        <!-- for View Button -->
+                                        </th>
                                     </tr>
                                 </thead>
                                 <tbody>
                                 @foreach( $gateways as $indexGP => $gp )
                                     @if( $gatewayApprovalStatuses[$gp->gatewayApprovalStatus] == "REQUESTED")
-                                    <tr>
+                                    <tr class="gatewayRow gatewayStatus-{{$gatewayApprovalStatuses[$gp->gatewayApprovalStatus]}}">
                                         <td>{{$gp->gatewayName }}</td>
                                         <td>{{ $gp->gatewayAdminFirstName }} {{ $gp->gatewayAdminLastName }} </td>
                                         <td>{{ $gp->gatewayURL }}</td>
                                         <td>{{ $gp->reviewProposalDescription}}</td>
                                         <td>{{ $gp->gatewayPublicAbstract}}</td>
-                                        <td>Status: {{$gatewayApprovalStatuses[$gp->gatewayApprovalStatus] }}<br/>
-                                                    <input type="button" class="btn btn-primary start-approval" data-gatewayobject="{{htmlentities(json_encode( $gp))}}" value="View"/>
+                                        <td>{{$gatewayApprovalStatuses[$gp->gatewayApprovalStatus] }}</td>
+                                        <td>
+                                            <input type="button" class="btn btn-primary btn-xs start-approval" data-gatewayobject="{{htmlentities(json_encode( $gp))}}" value="View"/>
                                         </td>
                                     </tr>
                                     @endif
                                 @endforeach
                                 @foreach( $gateways as $indexGP => $gp )
                                     @if( $gatewayApprovalStatuses[$gp->gatewayApprovalStatus] != "REQUESTED")
-                                    <tr>
+                                    <tr class="gatewayRow gatewayStatus-{{$gatewayApprovalStatuses[$gp->gatewayApprovalStatus]}}">
                                         <td>{{$gp->gatewayName }}</td>
                                         <td>{{ $gp->gatewayAdminFirstName }} {{ $gp->gatewayAdminLastName }} </td>
                                         <td>{{ $gp->gatewayURL }}</td>
                                         <td>{{ $gp->reviewProposalDescription}}</td>
                                         <td>{{ $gp->gatewayPublicAbstract}}</td>
-                                        <td>Status: {{$gatewayApprovalStatuses[$gp->gatewayApprovalStatus] }}<br/>
-                                                    <input type="button" class="btn btn-primary start-approval" data-gatewayobject="{{htmlentities(json_encode( $gp))}}" value="View"/>
+                                        <td>{{$gatewayApprovalStatuses[$gp->gatewayApprovalStatus] }}</td>
+                                        <td>
+                                            <input type="button" class="btn btn-primary btn-xs start-approval" data-gatewayobject="{{htmlentities(json_encode( $gp))}}" value="View"/>
                                         </td>
                                     </tr>
                                     @endif
@@ -298,7 +311,7 @@
                 <div class="modal-footer submit-actions">
                     <button type="submit" name="status" class="btn btn-primary notCreatedGateway update-gateway" value="createTenant">Create Tenant</button>
                     <button type="submit" name="status" class="btn btn-danger notCreatedGateway update-gateway" value="denyRequest">Deny Request</button>
-                    <button type="submit" name="status" class="btn btn-primary createdGateway update-gateway" value="updateGateway">Update Gateway Information</button>
+                    <button type="submit" name="status" class="btn btn-primary createdGateway update-gateway" value="updateGateway">Update Gateway</button>
                     <button type="submit" name="status" class="btn btn-danger createdGateway update-gateway" value="deactivateGateway">Deactivate Gateway</button>
                 </div>
             </form>
@@ -587,8 +600,8 @@
         editableInputs( $("#update-gateway-request"), true);
 
         if( gatewayApprovalStatuses[ gatewayObject.gatewayApprovalStatus] == "REQUESTED"){
-            $(".createdGateway").addClass("hide");
-            $(".notCreatedGateway").removeClass("hide");
+            //$(".createdGateway").addClass("hide");
+            //$(".notCreatedGateway").removeClass("hide");
         }
         else if( gatewayApprovalStatuses[ gatewayObject.gatewayApprovalStatus] == "CANCELLED" ||
             gatewayApprovalStatuses[ gatewayObject.gatewayApprovalStatus] == "DENIED" ||
@@ -606,45 +619,63 @@
     });
 
     $(".update-gateway").click( function( ev){
-            ev.preventDefault();
-             $(this).prepend( "<img class='loading-gif' src='<?php echo URL::to('/'); ?>/assets/ajax-loader.gif'/>");
-            $(".fail-alert").remove();
-            $(".success-alert").remove();
-            var updateVal = $(this).val();
-            var updateGatewayData = $("#update-gateway-request").serializeArray();
-                
-            updateGatewayData.push({name: updateVal, value: true});
-
-            $.ajax({
-                url: "{{URL::to('/')}}/admin/update-gateway-request",
-                method: "GET",
-                data: updateGatewayData
-            }).done( function( data){
-                $(".loading-gif").remove();
-                if( data == -1 ){
-                    if( updateVal == "createTenant"){
-                    $(".submit-actions").after("<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").after("<div class='alert alert-danger fail-alert'>Error updating Gateway. Please try again.");
-                    }
+        ev.preventDefault();
+         $(this).prepend( "<img class='loading-gif' src='<?php echo URL::to('/'); ?>/assets/ajax-loader.gif'/>");
+        $(".fail-alert").remove();
+        $(".success-alert").remove();
+        var updateVal = $(this).val();
+        var updateGatewayData = $("#update-gateway-request").serializeArray();
+            
+        updateGatewayData.push({name: updateVal, value: true});
+
+        $.ajax({
+            url: "{{URL::to('/')}}/admin/update-gateway-request",
+            method: "GET",
+            data: updateGatewayData
+        }).done( function( data){
+            $(".loading-gif").remove();
+            if( data == -1 ){
+                if( updateVal == "createTenant"){
+                $(".submit-actions").after("<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( data == 1){
-                    if( updateVal == "createTenant"){
-                        $(".submit-actions").after("<div class='alert alert-success success-alert'>Tenant has been created with domain name- airavata." + $(".gatewayAcronym").val());
-                    }
-                    else{
-                        $(".submit-actions").after("<div class='alert alert-success success-alert'>Gateway has been updated successfully.");
-                    }
-                    $(".createdGateway").removeClass("hide");
+                else{
+                    $(".submit-actions").after("<div class='alert alert-danger fail-alert'>Error updating Gateway. Please try again.");
+                }
+            }
+            else if( data == 1){
+                if( updateVal == "createTenant"){
+                    $(".submit-actions").after("<div class='alert alert-success success-alert'>Tenant has been created with domain name- airavata." + $(".gatewayAcronym").val());
                     $(".notCreatedGateway").addClass("hide");
-
                 }
-                //$(".onTenantComplete").removeClass("hide");
-                //$(".onTenantLoad").addClass("hide");
-                //$(".onTenantComplete").removeClass("hide");
-            });
+                else{
+                    $(".submit-actions").after("<div class='alert alert-success success-alert'>Gateway has been updated successfully.");
+                }
+                $(".createdGateway").removeClass("hide");
+
+            }
+            //$(".onTenantComplete").removeClass("hide");
+            //$(".onTenantLoad").addClass("hide");
+            //$(".onTenantComplete").removeClass("hide");
         });
+    });
+
+    $(".gaStatuses option[value=REQUESTED]").prop("selected", true);
+    $(".gatewayRow").slideUp();
+    $(".gatewayStatus-REQUESTED").slideDown();
+
+    $(".gaStatuses").on( 'change', function(){
+
+        var statusToShow = $(this).val();
+        if( statusToShow == "ALL"){
+            $(".gatewayRow").slideDown();
+        }
+        else
+        {
+            $(".gatewayRow").slideUp();
+            var gatewayApprovalStatuses = $.parseJSON( $(".gatewayApprovalStatuses").val() );
+            $(".gatewayStatus-" + statusToShow ).slideDown();
+        }
+    });
 
     $(".deny-approval").click( function(){
         $(".gatewayid-for-approval").val( $(this).data("gatewayid")).html(  $(this).data("gatewayid"));