Fix refresh button 87/49087/1
authorElisha Oren <elisha.oren@hpe.com>
Thu, 1 Dec 2016 12:59:39 +0000 (14:59 +0200)
committerElisha Oren <elisha.oren@hpe.com>
Wed, 7 Dec 2016 13:26:53 +0000 (15:26 +0200)
Fix CXTMAP-725

Change-Id: Ibb8bfbaed88559a166d300aef89af5195bc20fae
Signed-off-by: Elisha Oren <elisha.oren@hpe.com>
dlux/cpeui/cpeui-module/src/main/resources/cpeui/services/cpeui.services.js
dlux/cpeui/cpeui-module/src/main/resources/cpeui/tenantsTable.controller.js

index 6e680c1d4bab1125d18fcb4eb373757ee1f13a54..44eaae9f166185e4d5a52853c80616d8dfcfba6f 100644 (file)
@@ -15,7 +15,11 @@ define(['app/cpeui/cpeui.module'],function(cpeui) {
                     callback(tenantList);
                 }
             }, function errorCallback(response) {
-                console.log(response);
+                if (response.status == 404) {
+                  callback([]);
+                } else {
+                  console.log(response);
+                }
             });
         };
 
@@ -98,6 +102,9 @@ define(['app/cpeui/cpeui.module'],function(cpeui) {
                     callback(ces);
                 }
             }, function errorCallback(response) {
+              if (response.status == 404) {
+                  callback([]);
+                }
                 console.log(response);
             });
 
@@ -196,9 +203,9 @@ define(['app/cpeui/cpeui.module'],function(cpeui) {
                   }
                 });
             }, function errorCallback(response) {
-              if (response.status == 404) {
-                callback([]);
-              }
+                if (response.status == 404) {
+                  callback([]);
+                }
                 console.log(response);
             });
         };
@@ -442,6 +449,9 @@ define(['app/cpeui/cpeui.module'],function(cpeui) {
                   callback(response.data["mef-services"]["mef-service"]);
               }
           }, function errorCallback(response) {
+              if (response.status == 404) {
+                callback([]);
+              }
               console.log(response);
           });
         };
index 5c64d6d17677fe99c5247d1d50d63d794b8c8953..eef799d9c23d892794d1ade52f170b1d79eee771 100644 (file)
@@ -2,40 +2,5 @@ define([ 'app/cpeui/cpeui.module' ], function(cpeui) {
 
   cpeui.register.controller('TenantTableCtrl', function($scope, CpeuiSvc, CpeuiDialogs, $mdDialog, $mdMedia) {
 
-    // Tenants
-
-    $scope.updateTenantView = function() {
-      CpeuiSvc.getTenantList(function(tenant_list) {
-        $scope.tenantArray = tenant_list;
-      });
-    }
-
-    $scope.AddTenant = function() {
-      CpeuiSvc.addTenant($scope.tenantId, function() {
-        $scope.updateTenantView();
-      });
-    };
-
-    $scope.tenantDialog = new CpeuiDialogs.Dialog('AddTenant', {},
-        function(obj) {
-          CpeuiSvc.addTenant(obj.id, function() {
-            $scope.updateTenantView();
-          });
-        });
-
-    $scope.OpenTenantPortal = function(tenant) {
-      $scope.currentTenent = tenant;
-      window.location = "#cpeui/tenant/" + tenant.name + "/";
-    };
-
-    $scope.DeleteTenant = function(tenantID) {
-      CpeuiDialogs.confirm(function() {
-        CpeuiSvc.deleteTenant(tenantID, function() {
-          $scope.updateTenantView();
-        });
-      });
-    };
-
-    $scope.updateTenantView();
   });
 });