Commit 58397f07 authored by Prayas Jain's avatar Prayas Jain

Added Progress Bar in Open Pool Screen

parent 3e0f1967
myApp.controller("openPoolController", function($scope, $http, myFactory, $mdDialog, appConfig, exportUiGridService) { myApp.controller("openPoolController", function($scope, $http, myFactory, $mdDialog, appConfig, exportUiGridService) {
$scope.records = []; $scope.records = [];
var today = new Date();
$scope.gridOptions = { $scope.gridOptions = {
paginationPageSizes : [ 10, 20, 30, 40, 50, 100], paginationPageSizes : [ 10, 20, 30, 40, 50, 100],
paginationPageSize : 10, paginationPageSize : 10,
...@@ -12,8 +13,7 @@ myApp.controller("openPoolController", function($scope, $http, myFactory, $mdDia ...@@ -12,8 +13,7 @@ myApp.controller("openPoolController", function($scope, $http, myFactory, $mdDia
{field : 'resourceRole',displayName: 'Role', enableColumnMenu: false, enableSorting: false,enableFiltering: true,width:'*'}, {field : 'resourceRole',displayName: 'Role', enableColumnMenu: false, enableSorting: false,enableFiltering: true,width:'*'},
{field : 'designation',displayName: 'Designation', enableColumnMenu: false,enableFiltering: false,width:'*'}, {field : 'designation',displayName: 'Designation', enableColumnMenu: false,enableFiltering: false,width:'*'},
{field : 'billableStatus',displayName: 'Billability', enableColumnMenu: false,enableSorting: false,enableFiltering: true , cellFilter: 'date:"dd-MMM-yyyy"',width:'*'}, {field : 'billableStatus',displayName: 'Billability', enableColumnMenu: false,enableSorting: false,enableFiltering: true , cellFilter: 'date:"dd-MMM-yyyy"',width:'*'},
{field : 'billingStartDate',displayName: 'Billable Start Date', enableColumnMenu: false, enableSorting: false, enableFiltering: true,width:'*',cellFilter: 'date:"dd-MMM-yyyy"'}, {field : 'billingStartDate',displayName: 'Start Date', enableColumnMenu: false, enableSorting: false, enableFiltering: true,width:'*',cellFilter: 'date:"dd-MMM-yyyy"'}
{field : 'billingEndDate',displayName: 'Billable End Date', enableColumnMenu: false,enableSorting: false,enableFiltering: false , cellFilter: 'date:"dd-MMM-yyyy"',width:'*'},
], ],
enableGridMenu: true, enableGridMenu: true,
enableSelectAll: true, enableSelectAll: true,
...@@ -58,12 +58,21 @@ myApp.controller("openPoolController", function($scope, $http, myFactory, $mdDia ...@@ -58,12 +58,21 @@ myApp.controller("openPoolController", function($scope, $http, myFactory, $mdDia
}; };
$scope.gridOptions.data = []; $scope.gridOptions.data = [];
$scope.getOpenPoolRecords = function(){ $scope.getOpenPoolRecords = function(type){
$mdDialog.hide();
if(type == "onload"){
showProgressDialog("Fetching data please wait...");
}
$http({ $http({
method : "GET", method : "GET",
url : appConfig.appUri + 'resources/project/Nisum0000?status=Active' url : appConfig.appUri + 'resources/project/Nisum0000?status=Active'
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
$scope.gridOptions.data = response.data.records; $mdDialog.hide();
today.setHours(0, 0, 0, 0);
var openPoolRecords = response.data.records.filter(function (employee) {
return employee.billingEndDate >= today;
});
$scope.gridOptions.data = openPoolRecords;
if(response.data.records.length > 10){ if(response.data.records.length > 10){
$scope.gridOptions.enablePaginationControls = true; $scope.gridOptions.enablePaginationControls = true;
} }
...@@ -75,4 +84,17 @@ myApp.controller("openPoolController", function($scope, $http, myFactory, $mdDia ...@@ -75,4 +84,17 @@ myApp.controller("openPoolController", function($scope, $http, myFactory, $mdDia
$scope.gridOptions.data = []; $scope.gridOptions.data = [];
}); });
}; };
}); function showProgressDialog(msg){
$('#home').addClass('md-scroll-mask');
$mdDialog.show({
templateUrl: 'templates/progressDialog.html',
controller: ProgressController,
parent: angular.element(document.body),
clickOutsideToClose:false,
locals: {dataToPass:msg}
});
}
function ProgressController($scope, dataToPass) {
$scope.progressText = dataToPass;
}
});
\ No newline at end of file
<div class="md-padding" id="popupContainer" ng-controller="openPoolController" ng-init="getOpenPoolRecords()"> <div class="md-padding" id="popupContainer" ng-controller="openPoolController" ng-init="getOpenPoolRecords('onload')">
<div class="container-fluid mainDivHeaderClass"> <div class="container-fluid mainDivHeaderClass">
<div class="row"> <div class="row">
<div class="col-lg-12"> <div class="col-lg-12">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment