From f0713bea27d1818ccd2f55a4c3eefe35fb197b71 Mon Sep 17 00:00:00 2001 From: Divakar Konakalla Date: Tue, 29 Nov 2016 17:08:39 +0530 Subject: [PATCH] bots running & failed page refresh issue when deleting a bot. --- .../sections/dashboard/bots/botsCtrl.js | 2 -- .../dashboard/bots/controller/libraryCtrl.js | 22 +++++++++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/client/cat3/src/partials/sections/dashboard/bots/botsCtrl.js b/client/cat3/src/partials/sections/dashboard/bots/botsCtrl.js index 8aa97d902..34b9e2b0a 100644 --- a/client/cat3/src/partials/sections/dashboard/bots/botsCtrl.js +++ b/client/cat3/src/partials/sections/dashboard/bots/botsCtrl.js @@ -48,8 +48,6 @@ }); }]) .controller('botsCtrl',['$scope', '$rootScope', '$state', function ($scope, $rootScope, $state) { - /*var treeNames = ['Bots']; - $rootScope.$emit('treeNameUpdate', treeNames);*/ $state.go('dashboard.bots.library'); $rootScope.stateItems = $state.params; }]); diff --git a/client/cat3/src/partials/sections/dashboard/bots/controller/libraryCtrl.js b/client/cat3/src/partials/sections/dashboard/bots/controller/libraryCtrl.js index 4e6093f5a..86403d016 100644 --- a/client/cat3/src/partials/sections/dashboard/bots/controller/libraryCtrl.js +++ b/client/cat3/src/partials/sections/dashboard/bots/controller/libraryCtrl.js @@ -65,7 +65,16 @@ genSevs.promiseDelete(param).then(function (response) { if (response) { toastr.success('Successfully deleted'); - lib.init(); + if($scope.totalBotsSelected) { + lib.init(); + } else if($scope.runningBotsselected) { + $scope.showBotsRunning(); + } else if($scope.failedBotsselected) { + $scope.showFailedBots(); + } else { + lib.init(); + } + lib.summary(); } }, function(data) { toastr.error('error:: ' + data.toString()); @@ -87,7 +96,16 @@ genSevs.promiseDelete(param).then(function (response) { if (response) { toastr.success('Successfully deleted'); - lib.init(); + if($scope.totalBotsSelected) { + lib.init(); + } else if($scope.runningBotsselected) { + $scope.showBotsRunning(); + } else if($scope.failedBotsselected) { + $scope.showFailedBots(); + } else { + lib.init(); + } + lib.summary(); } }, function(data) { toastr.error('error:: ' + data.toString());