Commit 38550d04 authored by Prayas Jain's avatar Prayas Jain

Added validations in manage project screen and added filters in different screens

parent 69fa85cc
......@@ -46,10 +46,9 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo
$scope.getAccountDetails();
}
$scope.getAccountDetails = function(){
var empId = myFactory.getEmpId();
$http({
method : "GET",
url : appConfig.appUri + "accountsByLoginId?loginId="+empId
url : appConfig.appUri + "accounts"
}).then(function mySuccess(response) {
if(response.data.records.length > 10){
$scope.gridOptions.enablePaginationControls = true;
......
......@@ -25,7 +25,7 @@ myApp.controller("allocationChangeReportController",function($scope,exportUiGrid
{name : 'prevBillingStatus', displayName: 'Prev Billability', enableColumnMenu: false, enableSorting: false, enableFiltering:false, width:150},
{name : 'prevBillingStartDate', displayName: 'Prev Billing Start Date',cellFilter: 'date:"dd-MMM-yyyy"', enableColumnMenu: false, enableSorting: false, enableFiltering:false, width:180},
{name : 'prevBillingEndDate', displayName: 'Prev Billing End Date',cellFilter: 'date:"dd-MMM-yyyy"', enableColumnMenu: false, enableSorting: false, enableFiltering:false,width:180},
{name : 'currentAccountName', displayName: 'Current Client', enableColumnMenu: false, enableSorting: false, enableFiltering:false,width:120},
{name : 'currentAccountName', displayName: 'Current Client', enableColumnMenu: false, enableSorting: false, enableFiltering:true,width:120},
{field : 'currentProjectName',displayName: 'Current Project', enableColumnMenu: false, enableSorting: true,enableFiltering: true,width:150},
{name : 'currentBillingStatus', displayName: 'Current Billability', enableColumnMenu: false, enableSorting: false, enableFiltering:false,width:150},
{name : 'currentBillingStartDate', displayName: 'Current Billing Start Date',cellFilter: 'date:"dd-MMM-yyyy"', enableColumnMenu: false, enableSorting: false, enableFiltering:false,width:200},
......
......@@ -31,9 +31,9 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export
columnDefs : [
{field : 'employeeId',displayName: 'Emp ID', enableColumnMenu: false, enableSorting: false,enableFiltering:true, width:100,cellTemplate: getEmpDetTemplate},
{field : 'employeeName',displayName: 'Employee Name ', enableColumnMenu: false, enableSorting: true,enableFiltering:true,width:200},
{field : 'accountName',displayName: 'Client', enableColumnMenu: false, enableSorting: true,enableFiltering:false,width:100},
{field : 'accountName',displayName: 'Client', enableColumnMenu: false, enableSorting: true,enableFiltering:true,width:100},
{field : 'domain',displayName: 'Domain', enableColumnMenu: false, enableSorting: true,enableFiltering:false,width:100},
{field : 'projectName',displayName: 'Project', enableColumnMenu: false, enableSorting: false,enableFiltering:false,width:150},
{field : 'projectName',displayName: 'Project', enableColumnMenu: false, enableSorting: false,enableFiltering:true,width:150},
{field : 'billingStartDate',displayName: 'Billing Start Date', enableColumnMenu: false, enableSorting: true,cellFilter: 'date:"dd-MMM-yyyy"',enableFiltering:false,width:150},
{field : 'billingEndDate',displayName: 'Billing End Date', enableColumnMenu: false, enableSorting: true,cellFilter: 'date:"dd-MMM-yyyy"',enableFiltering:false,width:150},
{field : 'empStatus',displayName: 'Status', enableColumnMenu: false, enableSorting: true,enableFiltering: true,width:80},
......
......@@ -107,11 +107,9 @@ myApp.controller("domainController",
}
$scope.getDomains = function() {
var empId = myFactory.getEmpId();
$http({
method : "GET",
//url : appConfig.appUri + "domains"
url : appConfig.appUri + "domainsByLoginId?loginId="+empId
url : appConfig.appUri + "domains"
})
.then(
function mySuccess(response) {
......
......@@ -31,7 +31,7 @@ myApp.controller("assignEmployeeEffortrsController",function($scope,exportUiGrid
{name : 'totalHoursSpentInWeek', displayName: 'Total Hours(HH:MM)', enableColumnMenu: false, enableSorting: false, enableFiltering:false,width :230},
{field : 'projectName',displayName: 'Project Name', enableColumnMenu: false, enableSorting: true,enableFiltering: true},
{name : 'accountName', displayName: 'Account', enableColumnMenu: false, enableSorting: false, enableFiltering:false},
{name : 'functionalOrg', displayName: 'Functional Org', enableColumnMenu: false, enableSorting: false, enableFiltering:false}
{name : 'functionalOrg', displayName: 'Functional Org', enableColumnMenu: false, enableSorting: false, enableFiltering:true}
],
enableGridMenu: true,
enableSelectAll: true,
......
......@@ -87,11 +87,9 @@ myApp.controller("loginController",function($scope, myFactory, $compile, $window
});
};
function getAllAccounts(){
var empId = myFactory.getEmpId();
$http({
method : "GET",
//url : appConfig.appUri + "accounts"
url : appConfig.appUri + "accountsByLoginId?loginId="+empId
url : appConfig.appUri + "accounts"
}).then(function mySuccess(response) {
var accounts = response.data.records;
myFactory.setAccounts(accounts);
......
......@@ -491,6 +491,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
}
$scope.selectedTab = 0;
$scope.templateTitle = 'View';
$scope.alertMsg = '';
document.getElementsByClassName("md-tab")[1].style.visibility = "hidden" ;
document.getElementsByClassName("md-tab")[2].style.visibility = "hidden" ;
$scope.isSecondTab = !$scope.isSecondTab;
......@@ -803,11 +804,8 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
}
$scope.moveToBench = function (row) {
let role;
if(row.resourceRole == 'Individual Contributor'){
role = 'Employee';
}
var record = {"id":row.id,"employeeId":row.employeeId,"projectId":row.projectId,"billableStatus":row.billableStatus,"billingEndDate":row.billingEndDate,"resourceRole":role,"billingStartDate":row.billingStartDate};
row.resourceRole == 'Individual Contributor' ? row.resourceRole = 'Employee' : row.resourceRole;
var record = {"id":row.id,"employeeId":row.employeeId,"projectId":row.projectId,"billableStatus":row.billableStatus,"billingEndDate":row.billingEndDate,"resourceRole":row.resourceRole,"billingStartDate":row.billingStartDate};
var urlRequest = "";
var loginEmpId = myFactory.getEmpId();
urlRequest = appConfig.appUri+ "resources/moveToOpenPool?loginEmpId="+loginEmpId;
......@@ -825,24 +823,35 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
$timeout(function () {
getProjectDetails($scope.projectId, $scope.status);
}, 500);
}
$mdDialog.show($mdDialog.alert({
skipHide: true,
textContent: response.data.message ,
ok: 'ok'
})).then(function () {
$scope.myForm.$setPristine();
})
}, function myError(response){
})
}else{
$scope.alertMsg=response.data.message;
if($scope.alertMsg && $scope.alertMsg != ""){
row.billingStartDate = $scope.parentData.newBillingStartDate;
row.billingEndDate = $scope.parentData.endDate;
row.resourceRole = $scope.parentData.role;
row.billableStatus = $scope.parentData.billableStatus;
}
$scope.previousRow = angular.copy(row);
}
}, function myError(response){
$scope.result = "Error";
});
});
}
}
$scope.changeAllocationStatusToEngaged = function (row) {
if(row.billableStatus == "Reserved"){
$scope.alertMsg = 'Please Update Your Billability Status From Reserved and then Move to Engage';
}else {
row.resourceRole == 'Individual Contributor' ? row.resourceRole = 'Employee' : row.resourceRole;
$scope.alertMsg ='';
var loginEmpId = myFactory.getEmpId();
var record = {"id":row.id,"employeeId":row.employeeId,"projectId":row.projectId,"billableStatus":row.billableStatus,"billingEndDate":row.billingEndDate,"resourceRole":row.resourceRole,"billingStartDate":row.billingStartDate,"status":"Engaged"};
......@@ -861,15 +870,25 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
$timeout(function () {
getProjectDetails($scope.projectId, $scope.status);
}, 500);
}
$mdDialog.show($mdDialog.alert({
skipHide: true,
textContent: response.data.message ,
ok: 'ok'
})).then(function () {
$scope.myForm.$setPristine();
})
}, function myError(response){
})
}else{
$scope.alertMsg=response.data.message;
if($scope.alertMsg && $scope.alertMsg != ""){
row.billingStartDate = $scope.parentData.newBillingStartDate;
row.billingEndDate = $scope.parentData.endDate;
row.resourceRole = $scope.parentData.role;
row.billableStatus = $scope.parentData.billableStatus;
}
$scope.previousRow = angular.copy(row);
}
}, function myError(response){
$scope.result = "Error";
});
}
......@@ -1500,6 +1519,9 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
$scope.alertMsg = "Please select a Allocation Status";
angular.element(document.getElementById('empAllocationStatus')).focus();
}
else if($scope.endDate < $scope.newBillingStartDate){
$scope.alertMsg = "Billling Start date should not exceed Billing end date";
}
/* else if(employeeModel != undefined && projectModel != undefined && action == "Add" && getExistingRecordProjectStatus(employeeModel.employeeId, projectModel.projectName)){
$scope.alertMsg = "Employee is already assigned to the selected project";
return false;
......@@ -1621,7 +1643,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
}
else {
$mdDialog.show($mdDialog.confirm({
skipHide: true,
skipHide: true,
textContent: 'Are you sure you want to cancel this?',
ok: 'ok',
cancel: 'cancel'
......
......@@ -14,7 +14,7 @@ myApp.controller("reservedReportsController",function($scope,exportUiGridService
return 'red';
}
}},
{name : 'accountName', displayName: 'Client', enableColumnMenu: false, enableSorting: false, enableFiltering:false},
{name : 'accountName', displayName: 'Client', enableColumnMenu: false, enableSorting: false, enableFiltering:true},
{field : 'projectName',displayName: 'Project Name', enableColumnMenu: false, enableSorting: true,enableFiltering: true},
{name : 'billingStartDate', displayName: 'Reserved Start Date', enableColumnMenu: false,cellFilter: 'date:"dd-MMM-yyyy"', enableSorting: false, enableFiltering:false},
{name : 'billingEndDate', displayName: 'Reserved End Date', enableColumnMenu: false,cellFilter: 'date:"dd-MMM-yyyy"', enableSorting: false, enableFiltering:false}
......
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