From dbad0e4110f7bb202d165b9cb73bd13de46576ce Mon Sep 17 00:00:00 2001 From: srikanthv02 Date: Thu, 9 Feb 2017 13:10:30 +0530 Subject: [PATCH 1/2] Resolved some spinner issues and performance --- .../bots/controller/editParamsCtrl.js | 1 + .../dashboard/bots/controller/libraryCtrl.js | 72 +++++++++++-------- .../sections/dashboard/bots/view/library.html | 2 +- 3 files changed, 43 insertions(+), 32 deletions(-) diff --git a/client/cat3/src/partials/sections/dashboard/bots/controller/editParamsCtrl.js b/client/cat3/src/partials/sections/dashboard/bots/controller/editParamsCtrl.js index 845dd0693..95fd8119a 100644 --- a/client/cat3/src/partials/sections/dashboard/bots/controller/editParamsCtrl.js +++ b/client/cat3/src/partials/sections/dashboard/bots/controller/editParamsCtrl.js @@ -153,6 +153,7 @@ } } var param={ + inlineLoader:true, url:'/bots/' + items.botId + '/execute', data: reqBody }; 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 c9212cc2b..5f5d6beec 100644 --- a/client/cat3/src/partials/sections/dashboard/bots/controller/libraryCtrl.js +++ b/client/cat3/src/partials/sections/dashboard/bots/controller/libraryCtrl.js @@ -30,7 +30,7 @@ $scope.botLibrarySearch = ''; $scope.showLoadMore = false; $scope.showRecords = false; - + $scope.initGrids = function(){ $scope.botLibGridOptions={}; $scope.botLibGridOptions.columnDefs= [ @@ -127,6 +127,8 @@ $scope.botsDetails = function(result) { $scope.botLibGridOptions.data = []; + $scope.showLoadMore = false; + $scope.showRecords = false; $scope.botLibGridOptions.totalItems = result.metaData.totalRecords; $scope.botLibGridOptions.data = result.bots; if(result.metaData.totalRecords >= 18) { @@ -138,6 +140,7 @@ $scope.showRecords = false; } $scope.statusBar = "Showing " + ($scope.botLibGridOptions.data.length === 0 ? "0" : "1") + " to " + $filter('number')($scope.botLibGridOptions.data.length) + " of " + $filter('number')(result.metaData.totalRecords) + " entries"; + $scope.isBotLibraryPageLoading = false; }; $scope.clearSearchString = function() { @@ -147,10 +150,13 @@ $scope.botLibraryGridView = function() { lib.gridOptions=[]; var param={ + inlineLoader:true, url:'/bots?page=' + $scope.paginationParams.page +'&pageSize=' + $scope.paginationParams.pageSize +'&sortBy=' + $scope.paginationParams.sortBy +'&sortOrder=' + $scope.paginationParams.sortOrder }; genSevs.promiseGet(param).then(function (result) { $timeout(function() { + $scope.showLoadMore = false; + $scope.showRecords = false; $scope.botLibGridOptions.totalItems = result.metaData.totalRecords; if(result.metaData.totalRecords >= 18) { $scope.showLoadMore = true; @@ -168,9 +174,9 @@ $scope.botLibGridOptions.data = result.bots; } $scope.statusBar = "Showing " + ($scope.botLibGridOptions.data.length === 0 ? "0" : "1") + " to " + $filter('number')($scope.botLibGridOptions.data.length) + " of " + $filter('number')(result.metaData.totalRecords) + " entries"; + $scope.isBotLibraryPageLoading = false; //$scope.filterBy(); }, 100); - $scope.isBotLibraryPageLoading = false; }, function(error) { $scope.isBotLibraryPageLoading = false; toastr.error(error); @@ -222,14 +228,12 @@ }; } genSevs.promiseGet(param).then(function (result) { - $timeout(function() { - $scope.botsDetails(result); - if($scope.isCardViewActive){ - for(var i=0;i -
+
No data Available
From 7312ab9d8aec6756bcac5f96ce3a589b611c534b Mon Sep 17 00:00:00 2001 From: srikanthv02 Date: Thu, 9 Feb 2017 13:17:19 +0530 Subject: [PATCH 2/2] Made a common function --- .../dashboard/bots/controller/libraryCtrl.js | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) 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 5f5d6beec..90be8efd4 100644 --- a/client/cat3/src/partials/sections/dashboard/bots/controller/libraryCtrl.js +++ b/client/cat3/src/partials/sections/dashboard/bots/controller/libraryCtrl.js @@ -28,8 +28,12 @@ $scope.paginationParams.sortBy = 'createdOn'; $scope.paginationParams.sortOrder = 'desc'; $scope.botLibrarySearch = ''; - $scope.showLoadMore = false; - $scope.showRecords = false; + $scope.showLoadRecord = function() { + $scope.showLoadMore = false; + $scope.showRecords = false; + }; + + $scope.showLoadRecord(); $scope.initGrids = function(){ $scope.botLibGridOptions={}; @@ -127,8 +131,7 @@ $scope.botsDetails = function(result) { $scope.botLibGridOptions.data = []; - $scope.showLoadMore = false; - $scope.showRecords = false; + $scope.showLoadRecord(); $scope.botLibGridOptions.totalItems = result.metaData.totalRecords; $scope.botLibGridOptions.data = result.bots; if(result.metaData.totalRecords >= 18) { @@ -136,8 +139,7 @@ $scope.showRecords = true; } if(result.metaData.totalRecords == $scope.botLibGridOptions.data.length) { - $scope.showLoadMore = false; - $scope.showRecords = false; + $scope.showLoadRecord(); } $scope.statusBar = "Showing " + ($scope.botLibGridOptions.data.length === 0 ? "0" : "1") + " to " + $filter('number')($scope.botLibGridOptions.data.length) + " of " + $filter('number')(result.metaData.totalRecords) + " entries"; $scope.isBotLibraryPageLoading = false; @@ -155,8 +157,7 @@ }; genSevs.promiseGet(param).then(function (result) { $timeout(function() { - $scope.showLoadMore = false; - $scope.showRecords = false; + $scope.showLoadRecord(); $scope.botLibGridOptions.totalItems = result.metaData.totalRecords; if(result.metaData.totalRecords >= 18) { $scope.showLoadMore = true; @@ -309,8 +310,7 @@ $scope.setCardView = function() { $scope.isBotLibraryPageLoading = true; - $scope.showLoadMore = false; - $scope.showRecords = false; + $scope.showLoadRecord(); $scope.botLibGridOptions.data = []; $scope.isCardViewActive = true; $scope.botsCardViewSelection = "bots-tab-active"; @@ -425,8 +425,7 @@ }; $rootScope.$on('BOTS_LIBRARY_REFRESH', function() { lib.summary(); - $scope.showLoadMore = false; - $scope.showRecords = false; + $scope.showLoadRecord(); $scope.isBotLibraryPageLoading = true; $scope.botLibGridOptions.data = []; if($scope.botLibrarySearch){